This template is mostly generated by chat GPT with RDF template via RAG. 50% coding - Please do following steps to start setup.
- Download Node.js from the official website.
- Choose the LTS version (recommended for most users) for stability.
- Run the installer and follow the on-screen instructions:
- Accept the license agreement.
- Choose the default installation path.
- Ensure the checkbox for "Automatically install necessary tools" is selected. This will set up useful dependencies like Python and Visual Studio Build Tools if required.
- After installation, verify Node.js and npm (Node Package Manager) are installed by opening a terminal (Command Prompt/PowerShell) and running:
node -v npm -v
You should see version numbers for both Node.js and npm.
-
Clone the source on your local machine
-
Open VScode -> open project -> open terminal -> executing the command
npm install
-
Open VScode -> Extensions
- Search and install playwright plugin (
first installation
) - Search and install Prettier - Code formatter (
first installation
)
- Search and install playwright plugin (
- Fill up the username and password on each test environment with the created account -> save
- Let default configs in
playwright.config.ts
as usual - Switch to testing tab -> then select the Project name that contains test file to executed
- Select any located files in directory
tests/e2e/
to execute (you should see the green arrow to execute enable)
- View the executing script defined in
package.json
- To executing on the desired environment -> Open terminal and executing command ex:
npm run test:e2e:local
npm run test:api:local
- Should not commit the UserCredential to Git (.env, user.json (autogenerated after login))
- Should not commit the result file to git
- Should not commit the node module to git
- The demo only get and save access token from auth server and store in ACCESSTOKEN variable store on each env file. It base on the USERNAME and PASSWORD values of created account
- see in
TEST_PROJECT/API/tests/features/API_Feature_1/feature_1-api-module.spec.ts
- Open the terminal and using the following command
ENV=local npx playwright test --project=api_testing --grep "@tagA|@tagB"
- Wait until the execution done will have automatically generated the allure report
NOTE: Please note that if the tag is not set yet or project directory is set wrong within playwright.config.ts -> It will show error as "not test found"