- Clone git project into your machine
git clone https://github.com/vandakiara/code-challenge-mercedes.git
- Enter the project root folder and run
npm install
- There are now 2 possible paths (always in the root of the project):
-
If you want to open cypress, run on different browsers from your system, and see the tests run on the browser in real time:
-
npm run cypress
This will open the cypress window where you can select in which browser to run
After choosing a browser, all you need to do is click on
Run 1 integration spec
This will open the chosen browser and run the tests in real time
-
-
If you want to run the tests in the background and generate reports:
- Chrome:
npm run tests:chrome
- Firefox:
npm run tests:firefox
- Edge:
npm run tests:edge
Generated reports can be found inside
cypress/results
- final results are in thecypress/results/report.html
file. They should look like the screenshot below and be interactive.If there are test failures, screenshots will be captured and saved in
cypress/screenshots
.Videos are captured automatically and will be accessible in
cypress/videos
. - Chrome:
-
- Other than the inherent limitations for Cypress, such as a lack of support for Safari currently, the following points should be considered:
- Tests were run only on Linux machines
- This means that the
npm run tests:browser
scripts may fail on Windows environments, due to the difference in commands. If such is the case, you may opt to runnpm run cypress
instead. If you're feeling adventurous, you may edit thepackage.json
file and edit thedelete:...
scripts to usermdir /S /Q cypress\\results || true
(for example) instead ofrm cypress/results/* ; rm cypress/results/assets/* || true
.
- This means that the
- The site being tested is heavy on resources - due to resource constraints, some tests may be flaky due to loading times. All tests were passing at the time of writing this, so running them again should make them pass.
- Tests were run only on Linux machines
Hint: All banners are clickable and have relevant links!