This project contains automated end-to-end tests for the Finmars web application, utilizing Playwright for browser automation and testing.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
Before running the tests, ensure you have Node.js installed on your system. You can download it from Node.js official website.
- Clone the repository to your local machine.
- Navigate to the project directory.
- Install the required dependencies by running:
npm install- Install Playwright browsers:
npx playwright install --with-depsYou can run different sets of tests using the scripts defined in package.json. Here are the commands for running specific test suites:
- To run all tests:
npm run test- To run configuration tests:
npm run configuration- To run reports tests:
npm run reportsThis project uses GitLab CI/CD for continuous integration and deployment. The CI pipeline is defined in .gitlab-ci.yml, which includes steps for:
- Installing dependencies.
- Running tests across different environments.
- Generating and storing test reports.
Test results are generated in the playwright-report directory, with an HTML report for viewing in a web browser. Additionally, JUnit reports are generated for integration with CI systems.
If you have to contribute, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Write your code and add tests if applicable.
- Ensure your code passes existing tests.
- Submit a pull request with a clear description of your changes.
This section lists some common Playwright commands that are useful during development and testing.
-
Run all tests: Executes all test suites.
npx playwright test -
Run tests in a specific file: Executes tests in a specified test file.
npx playwright test path/to/test-file.spec.js -
Run tests with a specific tag: Executes tests marked with a specific tag.
npx playwright test -g @yourTag -
Run tests in headed mode: Executes tests in a browser with UI.
npx playwright test --headed -
Generate code coverage: Generates code coverage report.
npx playwright test --coverage -
Open Playwright Inspector: Opens the Playwright Inspector for debugging tests.
npx playwright codegen
-
Update browsers: Downloads or updates browsers used by Playwright.
npx playwright install