diff --git a/.gitignore b/.gitignore index 9fd6689..f236965 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ -report.json -cucumber_report.html +report.json +cucumber_report.html /node_modules \ No newline at end of file diff --git a/README.md b/README.md index b911105..1bb4585 100644 --- a/README.md +++ b/README.md @@ -1,58 +1,58 @@ -# Sample Playwright Automation Test - -## System Requirements - -node >= v18.5.x - -npm >= v7 - - -## Setup - -// Install Visual Studio Code (or any editor) - -https://code.visualstudio.com/download - - -// Install Node.js - -https://nodejs.org/en/download - - -```bash -git clone https://github.com/automationExamples/Playwright-Cucumber-Exercise.git -npm install -npx playwright install -``` - -### Recommended vscode extensions - -Cucumber v1.7.0 - -Cucumber (Gherkin) Support enhanced for Behat - - -## Instructions -To run the test -```bash -npm run test -``` - -After running, to generate the cucumber report (cucumber_report.html) -```bash -npm run report -``` - -It is not expected that you complete every task, however, please give your best effort - -You will be scored based on your ability to complete the following tasks: - -- [ ] Install and setup this repository on your personal computer -- [ ] Complete the automation tasks listed below - -### Tasks -- [ ] Modify the scenario 'Validate the login page title' from [login.feature](features/login.feature#8) which runs but fails. Determine the cause of the failure and update the scenario to pass in the test -- [ ] Extend the scenario 'Validate login error message' from [login.feature](features/login.feature#10) which runs and passes but is missing a step. Extend the scenario to validate the error message received. -- [ ] Modify and extend the 'Validate successful purchase text' from [purchase.feature](features/purchase.feature#6) with steps for each comment listed. Consider writing a new steps.ts file along with an appropriate page.ts -- [ ] Modify and extend the 'Validate product sort by price sort' from [product.feature](features/product.feature#6) with steps for each comment listed. Utilize the Scenario Outline and Examples table to parameterize the test -- [ ] Extend the testing coverage with anything you believe would be beneficial +# Sample Playwright Automation Test + +## System Requirements + +node >= v18.5.x + +npm >= v7 + + +## Setup + +// Install Visual Studio Code (or any editor) + +https://code.visualstudio.com/download + + +// Install Node.js + +https://nodejs.org/en/download + + +```bash +git clone https://github.com/automationExamples/Playwright-Cucumber-Exercise.git +npm install +npx playwright install +``` + +### Recommended vscode extensions + +Cucumber v1.7.0 + +Cucumber (Gherkin) Support enhanced for Behat + + +## Instructions +To run the test +```bash +npm run test +``` + +After running, to generate the cucumber report (cucumber_report.html) +```bash +npm run report +``` + +It is not expected that you complete every task, however, please give your best effort + +You will be scored based on your ability to complete the following tasks: + +- [ ] Install and setup this repository on your personal computer +- [ ] Complete the automation tasks listed below + +### Tasks +- [ ] Modify the scenario 'Validate the login page title' from [login.feature](features/login.feature#8) which runs but fails. Determine the cause of the failure and update the scenario to pass in the test +- [ ] Extend the scenario 'Validate login error message' from [login.feature](features/login.feature#10) which runs and passes but is missing a step. Extend the scenario to validate the error message received. +- [ ] Modify and extend the 'Validate successful purchase text' from [purchase.feature](features/purchase.feature#6) with steps for each comment listed. Consider writing a new steps.ts file along with an appropriate page.ts +- [ ] Modify and extend the 'Validate product sort by price sort' from [product.feature](features/product.feature#6) with steps for each comment listed. Utilize the Scenario Outline and Examples table to parameterize the test +- [ ] Extend the testing coverage with anything you believe would be beneficial diff --git a/cucumber.js b/cucumber.js index e8192d6..3a50f58 100644 --- a/cucumber.js +++ b/cucumber.js @@ -1,3 +1,3 @@ -module.exports = { - default: `--require-module ts-node/register --require './steps/**/*.ts' --require './hooks/**/*.ts --format @cucumber/pretty-formatter` +module.exports = { + default: `--require-module ts-node/register --require './steps/**/*.ts' --require './hooks/**/*.ts --format @cucumber/pretty-formatter` }; \ No newline at end of file diff --git a/cucumber_report.html b/cucumber_report.html new file mode 100644 index 0000000..4f97105 --- /dev/null +++ b/cucumber_report.html @@ -0,0 +1,1147 @@ + + + +
++ Expand All + | + Collapse All +
++
+
+
+
+
+
+