From dee4e493c2c86a1e702ac75629a7cc24480ab59f Mon Sep 17 00:00:00 2001 From: najeeb1023 Date: Mon, 17 Jun 2024 20:32:20 +0200 Subject: [PATCH 1/2] feat: added new test scenario for women shopping, changed menSection_feature -> userShopping.feature --- package.json | 3 ++- src/test/features/MenSection.feature | 17 ------------ src/test/features/UserShopping.feature | 26 +++++++++++++++++++ src/test/hooks/hooks.ts | 2 +- .../pages/{MenSection.ts => UserShopping.ts} | 2 +- .../steps/{menSection.ts => userShopping.ts} | 2 +- 6 files changed, 31 insertions(+), 21 deletions(-) delete mode 100644 src/test/features/MenSection.feature create mode 100644 src/test/features/UserShopping.feature rename src/test/pages/{MenSection.ts => UserShopping.ts} (97%) rename src/test/steps/{menSection.ts => userShopping.ts} (91%) diff --git a/package.json b/package.json index 0bd021d..f641c72 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,8 @@ "version": "1.0.0", "main": "index.js", "scripts": { - "lunaapp": "cucumber-js --config=config/cucumber.js" + "lunaapp": "cucumber-js --config=config/cucumber.js", + "lunaapp:tag": "cucumber-js --config=config/cucumber.js --tags " }, "keywords": [], "author": "", diff --git a/src/test/features/MenSection.feature b/src/test/features/MenSection.feature deleted file mode 100644 index 44ed2c4..0000000 --- a/src/test/features/MenSection.feature +++ /dev/null @@ -1,17 +0,0 @@ -@MenSection - -Feature: Verify that the user is able to login into an already registered account. - - User wants to see some times. - - Background: User is landed on the webpage. - Given The user lands at the webpage. - - Scenario: User shops for Men Jackets. - When The user clicks on the "
" section. - And The user clicks on "" option. - Then The products are shown. - - Examples: - | Section | Attire | - | Men | Tanks | \ No newline at end of file diff --git a/src/test/features/UserShopping.feature b/src/test/features/UserShopping.feature new file mode 100644 index 0000000..d040722 --- /dev/null +++ b/src/test/features/UserShopping.feature @@ -0,0 +1,26 @@ +@UserShopping + +Feature: Verify that the user is able to purchase some item. + + User wants to buy something. + + Background: User is landed on the webpage. + Given The user lands at the webpage. + + Scenario: User shops for Men Jackets. + When The user clicks on the "
" section. + And The user clicks on "" option. + Then The products are shown. + + Examples: + | Section | Attire | + | Men | Tees | + + Scenario: User shops for Women Jackets. + When The user clicks on the "
" section. + And The user clicks on "" option. + Then The products are shown. + + Examples: + | Section | Attire | + | Women | Bras & Tanks | \ No newline at end of file diff --git a/src/test/hooks/hooks.ts b/src/test/hooks/hooks.ts index f45fd38..8832450 100644 --- a/src/test/hooks/hooks.ts +++ b/src/test/hooks/hooks.ts @@ -26,5 +26,5 @@ After(async function ({pickle, result}) { AfterAll(async function () { await pageFixture.page.waitForTimeout(3000); - await browser.close(); + // await browser.close(); }); \ No newline at end of file diff --git a/src/test/pages/MenSection.ts b/src/test/pages/UserShopping.ts similarity index 97% rename from src/test/pages/MenSection.ts rename to src/test/pages/UserShopping.ts index acb9621..be4db64 100644 --- a/src/test/pages/MenSection.ts +++ b/src/test/pages/UserShopping.ts @@ -1,5 +1,5 @@ import { pageFixture } from "../hooks/pageFixture"; -import * as menSectionPage from "../../../src/test/resources/menSectionPage.json" +import * as menSectionPage from "../resources/menSectionPage.json" import { PageElement } from "../resources/interfaces/iPageElement"; import { Page, expect } from "@playwright/test"; diff --git a/src/test/steps/menSection.ts b/src/test/steps/userShopping.ts similarity index 91% rename from src/test/steps/menSection.ts rename to src/test/steps/userShopping.ts index c32e6ea..54e73a1 100644 --- a/src/test/steps/menSection.ts +++ b/src/test/steps/userShopping.ts @@ -1,5 +1,5 @@ import { When, Then, setDefaultTimeout } from "@cucumber/cucumber"; -import { MenSection } from "../pages/MenSection"; +import { MenSection } from "../pages/UserShopping"; import { pageFixture } from "../hooks/pageFixture"; setDefaultTimeout(60000); From d02d8e91e9c6d53ef286aa8dd11ed51900491839 Mon Sep 17 00:00:00 2001 From: najeeb1023 Date: Mon, 17 Jun 2024 21:00:55 +0200 Subject: [PATCH 2/2] feat: added new test scenario for women shopping, changed menSection_feature -> userShopping.feature --- src/test/hooks/hooks.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/hooks/hooks.ts b/src/test/hooks/hooks.ts index 8832450..f45fd38 100644 --- a/src/test/hooks/hooks.ts +++ b/src/test/hooks/hooks.ts @@ -26,5 +26,5 @@ After(async function ({pickle, result}) { AfterAll(async function () { await pageFixture.page.waitForTimeout(3000); - // await browser.close(); + await browser.close(); }); \ No newline at end of file