We decided to introduce an enum that contains a list of the status codes currently in use.
This will improve the overall project maintainability, and at the same time save us from code repetition.
enums directory created in src\api\enums
enum file created: src\api\enums\api-status-code.enum.ts with 5 status codes: 200, 400, 401, 404, 422
How to use it in tests
import file via:
import { HttpStatusCode } from "@_src_api/enums/api-status-code.enum";
when writing assertion use enum name and enum's member name, e.g.:
when writing an assertion that uses status code that is not a member of the enum, please adjust the file and add it to the enum by following convention: {name}{code} = {code}
You can check the name using this gist
@kat-kan: let's discuss our approach shortly during tomorrow's video meeting. I've already prepared the changes so if you agree they're fine, I can raise PR to address this
Resolves #48
Scope of changes
We decided to introduce an enum that contains a list of the status codes currently in use. This will improve the overall project maintainability, and at the same time save us from code repetition.
src\api\enums
src\api\enums\api-status-code.enum.ts
with 5 status codes: 200, 400, 401, 404, 422How to use it in tests
import file via:
when writing assertion use enum name and enum's member name, e.g.:
when writing an assertion that uses status code that is not a member of the enum, please adjust the file and add it to the enum by following convention:
{name}{code} = {code}
You can check the name using this gistPR steps completed:
kawqa-gad-playwright
project's git commit message formatAdditional changes - not related to the initial PR
\.husky\pre-commit