-
Open the forked repo in VSCode.
-
Create a new branch by running
git checkout -b task_solution. -
Run the installation commands:
npm cinpx playwright install
-
Add all the edit article tests you have created in the previous homework.
-
Create the
fixturesArticles.tsfile in thetests/_fixturesfolder. -
Add the following test scope fixtures to the file:
createArticlePageto initialize theCreateArticlePagepageviewArticlePageto initialize theViewArticlePagepageeditArticlePageto initialize theEditArticlePagepagearticleWithoutTagsto generate random article test dataarticleWithOneTagto generate random article test dataarticleWithTwoTagsto generate random article test data
-
Merge fixtures from the
fixturesArticles.tsto thefixtures.tsfile. -
Add a logger to the input parameters of the
generateNewArticleData.js, outputting a messageNew article generated: ${article}to the debug log. Use thegenerateNewUserData.jsfile as an example. -
Update all the article tests to use fixtures.
-
Re-run all your tests and make sure they pass after the updates.
-
Change the log level from
errortodebugin theloggerfixture. Run thenpx playwright testcommand and observe the logs reported. -
Change the log level from
debugtoinfoin theloggerfixture. Run thenpx playwright testcommand and observe the logs reported. -
Change the log level from
debugtowarnin theloggerfixture. Run thenpx playwright testcommand and observe the logs reported. -
Change the log level from
warntoerrorin theloggerfixture. Run thenpx playwright testcommand and observe the logs reported.
- 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.