This is a technical exercise for the Factorial Calculator web app.
Warning This project was build with NodeJS v20.2.0
To get started with the project, follow these steps:
-
Clone the repository:
git clone https://github.com/pedroAVS/playwright-tech-challenge.git
-
Install the dependencies:
npm install
To install the dependencies, execute the tests and see the report execute the script:
sh test.sh
note: make sure that the file has the correct permissions (chomd +x test.sh)
To run the tests, use the following command:
npm test
The tests will execute and generate a report with the test results.
Currently the tests will execute on push and pull requests to the Main repository. Report artifacts are made available, as well as an Allure report served on a github page (check the latest pages-build-deployment for the link of the page).
The workflow can be triggered manually by accessing "Run Tests and Publish Report" workflow and clicking on "Run workflow"
The test configuration can be found in the playwright.config.ts
file. Modify this file to customize the test settings, such as browser type, test timeout, and test retries.
The project follows the following file structure:
playwright-tech-challenge/
├── Documentation
│ ├── Exercise 1
│ │ └── Evidences
│ └── Exercise 2
├── package.json
├── package-lock.json
├── playwright.config.ts
├── tests/
│ ├── pageobjects
│ │ └── apiResponse.model.ts
│ ├── utils
│ │ └── helpers
│ │ └── calculatorUtils.ts
│ │ └── networkUtils.ts
│ │ └── testApiUtils.ts
│ │ └── testValuesUtils.ts
│ ├── calculator.spec.ts/
└── tsconfig.json
Documentation
: Contains the reports and acceptance criteria in a markdown language format.package.json
andpackage-lock.json
: Define the project dependencies and scripts.playwright.config.ts
: Configuration file for Playwright.tests/
: Contains the source code for the tests.pageobjects/
: contains the calculator class file used in the testscalculator.page.ts
: Object repository for storing all web elements and operations on the calculator page
utils/
: Contains multiple functions that aids on tests execution while keeping the code easy to maintain and to scale uphelpers
: Helper functions containing the constants, creating the range of numbers to test, and a factorial converter
calculator.spec.ts
: Contains the main test scripts.
tsconfig.json
: TypeScript configuration file.
This project is licensed under the MIT License.