-
Notifications
You must be signed in to change notification settings - Fork 2.2k
WJ test for assignment task #9137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
filewen
wants to merge
24
commits into
Kong:develop
Choose a base branch
from
filewen:wj-test
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added a new e2e test under smoke. (wj.test.ts)
Added a new test framework and a workflow. Here is the README of this framework:
WJ Test Framework
1. Core Design
a. Data-Driven Testing
Customize test data in CSV files to quickly expand the range of test scenarios.
b. Test Case Management
Define test files to flexibly select test cases for execution and unify the management of test cases to run (see
Test Execution via Test File Management
for details).Execute test cases through the
TestRunner
.c. CI Integration
d. Test Reporting
Generate HTML reports automatically after test execution.
e. To-Be-Expanded Features
Send test result reports via email.
Extend test files: Filter and execute test cases by test case levels and tags.
Organize and design UI test cases using the POM (Page Object Model) pattern.
2. Test Data Files
a. Each row in the data file drives one test case. For example, the CSV file below will make the
TestRunner
generate three test cases in the same group:b. Write test case logic according to standard Playwright test file conventions, and reference fields in the data file via the
record
parameter.c. The
TestRunner
automatically matches the data file with the same name as the test file. For example:Test file:
http_request.test.ts
Corresponding data file:
http_request_data.csv
d. If no data file is provided, the
TestRunner
will execute the test case directly.3. Test Case Execution
a. Direct Test Execution
You can also run tests in the workspace root directory (
packages/wj-test
):b. Test Execution via Test Files
Test File Description
The framework supports controlling test cases to execute via a CSV test file:
File name:
test-config.csv
CSV file format:
Field Description
run
: Specifies whether to execute the test case. Value options:yes
|no
(default:yes
).path
: The directory where the test cases are stored. If onlypath
is specified (withoutfilename
), it means all test cases under the directory will be executed.filename
: The name of the test case (without the.test.ts
suffix).4. CI Integration (GitHub Action)
I created a new workflow for wj-test on GitHub:
Workflow name:
WJ Tests of Insomnia App
Workflow file name:
wj-test.yml
After the "Install packages" step in this workflow, the test cases under
wj-test
will be executed. Once the tests are completed, an HTML test report will be generated, which can be viewed here:https://filewen.github.io/insomnia/
5. File Structure
Root path:
packages/wj-test
6. Additional Notes
a. For testing convenience, I simplified some components when starting the tests:
Insomnia user information is not loaded: Test cases start from "Local Scratch" to simulate a new user scenario.
Local Webserver is not started: Requests point to external public APIs.
b. In the action workflow, due to a lack of permission to access
@kong/insomnia-plugin-external-vault
in my forked repository, I removednpm run verify-bundle-plugins -w insomnia
from thepostinstall
script inpackage.json
. This should be added back for official use.