In this task you need to create tests for the /product endpoint of the FakeStoreAPI.
-
Open the forked repo in VSCode.
-
Create a new branch by running
git checkout -b task_solution
. -
Run the installation commands:
npm ci
npx playwright install
- Create new tests under the subfolders of
products
folder:
create/createProductPositive.spec.js
;read/getProductById.spec.js
;update/updateProductPositive.spec.js
;delete/deleteProductById.spec.js
;
- Follow the test steps in comments of each spec file.
- Use
tests/users/**.spec.js
files as example. - Create class
ProductsAPI.js
under thesrc/api/endpoints
and add all the methods for work with the/products
endpoint. UseUsersAPI.js
as exapmle. - Create helper fixtures in file
tests/_fixtures/fixturesProductsApi.ts
file. Do not forget to merge new fixture file to the ``tests/_fixtures/fixtures.ts`. - Run all your tests and make sure they pass.
- Add and commit all your updates.
- Push the code to the origin.
- Create a PR for your changes.
- Keep implementing suggestions from code review until your PR is approved.