Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
130 commits
Select commit Hold shift + click to select a range
44eed7a
Created new rules to ensure testing suite checks itself before branch…
shayfaber Jun 30, 2025
e38c421
Updated pipeline to install playwright browsers and combined manual s…
shayfaber Jun 30, 2025
f9a69f1
Added environment variables to setup step
shayfaber Jun 30, 2025
62b63ad
Echo variables to .env file
shayfaber Jun 30, 2025
133aa16
Removed variable echo, uncommented rule for test_mirror_pipeline
shayfaber Jun 30, 2025
82024bb
Updated testing suite so the setup is a before script rather than a s…
shayfaber Jun 30, 2025
76459a9
Updated instructions to explicitly install playwright
shayfaber Jun 30, 2025
767f807
Remove unnecessary step in pipeline, split set-up and running of suit…
shayfaber Jul 1, 2025
2286bc6
Moved variables to make them global
shayfaber Jul 1, 2025
60b2e8a
Set up dependency for run_testing_suite, set node_modules folder from…
shayfaber Jul 1, 2025
97d88db
Set 'needs' back up in 'run_testing_suite' to ensure this step does n…
shayfaber Jul 1, 2025
6762edb
Add files to setup artifact that are required for running the suite
shayfaber Jul 1, 2025
0f28ff8
Reinstall playwright browsers during run phase to ensure their presence.
shayfaber Jul 1, 2025
fa804b4
Reinstall playwright and browsers during run phase to ensure their pr…
shayfaber Jul 1, 2025
09d7469
Added workaround to product.page.ts (l141-143) to fix Webkit test issue
shayfaber Jul 1, 2025
40c632c
Created new rules to ensure testing suite checks itself before branch…
shayfaber Jun 30, 2025
12f3c57
Updated pipeline to install playwright browsers and combined manual s…
shayfaber Jun 30, 2025
8899bc1
Added environment variables to setup step
shayfaber Jun 30, 2025
632189a
Echo variables to .env file
shayfaber Jun 30, 2025
430e3f3
Removed variable echo, uncommented rule for test_mirror_pipeline
shayfaber Jun 30, 2025
83187f9
Updated testing suite so the setup is a before script rather than a s…
shayfaber Jun 30, 2025
f6f2b1f
Updated instructions to explicitly install playwright
shayfaber Jun 30, 2025
dc99f66
Remove unnecessary step in pipeline, split set-up and running of suit…
shayfaber Jul 1, 2025
f94f6a0
Moved variables to make them global
shayfaber Jul 1, 2025
3ed76f3
Set up dependency for run_testing_suite, set node_modules folder from…
shayfaber Jul 1, 2025
4e54186
Set 'needs' back up in 'run_testing_suite' to ensure this step does n…
shayfaber Jul 1, 2025
6307969
Add files to setup artifact that are required for running the suite
shayfaber Jul 1, 2025
3bf5b3f
Reinstall playwright browsers during run phase to ensure their presence.
shayfaber Jul 1, 2025
5e4cf10
Reinstall playwright and browsers during run phase to ensure their pr…
shayfaber Jul 1, 2025
1e427b3
Added workaround to product.page.ts (l141-143) to fix Webkit test issue
shayfaber Jul 1, 2025
08cb61e
removed unused variables
Jul 3, 2025
15d0a9f
Updated gitlab pipeline file to exclude 'need' line
shayfaber Jul 7, 2025
2af3568
Readded 'need' line to ensure proper order of execution
shayfaber Jul 7, 2025
36b4181
Fixed incorrect locator, improved notification validator
shayfaber Jul 7, 2025
b13e9a6
Reworked add first address function in account.page.ts
shayfaber Jul 7, 2025
17cd13c
Improved state selector locator
shayfaber Jul 7, 2025
8a4a5f5
modified function addConfigurableProductToCart
shayfaber Jul 7, 2025
570eba3
updated poms to make tests succeed
Jul 9, 2025
bcdffa5
Modified gitignore, fixed login test, fixed account.spec.ts
shayfaber Jul 14, 2025
b2dfbe5
Updated ci instructions to mkdir before running npm install
shayfaber Jul 14, 2025
ecd5453
Added tests folder to artifact collection
shayfaber Jul 14, 2025
c20645d
Modified call to setup.spec.ts on line 54
shayfaber Jul 14, 2025
1d1bf82
Reworking line 54 to try and find tests
shayfaber Jul 14, 2025
29031d2
Created test.config example file, updated pipeline to use grep again
shayfaber Jul 14, 2025
c1b5a30
test.config.ts alteration to check if running in CI
shayfaber Jul 14, 2025
b0d761b
Reverted test.config.exampe.ts
shayfaber Jul 14, 2025
512bb10
Added console.log to playwright.config.example.ts
shayfaber Jul 14, 2025
8a721da
Specified call to setup.spec.ts
shayfaber Jul 14, 2025
e6c2884
added ls command to gitlab pipeline
shayfaber Jul 14, 2025
90e8b1d
pipeline change: specified folder from which to pull setup.spec.ts
shayfaber Jul 14, 2025
b63ca49
removed incorrect slash in pipeline line 57
shayfaber Jul 14, 2025
24eb2eb
Changed image to latest windows
shayfaber Jul 14, 2025
d19ceef
Updated windows image pull
shayfaber Jul 14, 2025
949615b
Updating gitlab ci yml
shayfaber Jul 14, 2025
21513ea
Updated gitlab-cy yml
shayfaber Jul 14, 2025
ead8f1f
updated gitlab ci yml
shayfaber Jul 14, 2025
8cc4871
Updated install script to set default values in CI
shayfaber Jul 14, 2025
c06f8f4
Removed CI boolean from line 56
shayfaber Jul 14, 2025
139eeb8
playwright.config console.log line 51
shayfaber Jul 14, 2025
bda9f11
Added check on line 23
shayfaber Jul 14, 2025
cc9db9c
Removed unused file
Jul 14, 2025
ffab930
updated pw config file to get the correct spec files
Jul 14, 2025
f21928e
remove console.log and updated gitlab-ci
Jul 14, 2025
dc57d08
renamed stage to create_testing_suite, removed manual method and read…
Jul 14, 2025
8dda6ca
fixed renaming in step
Jul 14, 2025
13affb3
fixed renaming in step
Jul 14, 2025
52c5f6f
Added header locator for menu element
Jul 15, 2025
780243f
Merge branch '216-fix-multimatch-in-mainmenu-page-na-login-wacht-op-z…
Jul 17, 2025
04679eb
Changes to category.page.ts
shayfaber Jul 22, 2025
772be7c
WIP: prevent false negatives on account address tests by increasing s…
shayfaber Jul 22, 2025
e316bf0
WIP: fixing false negatives on address book tests by improving stability
shayfaber Jul 23, 2025
d359b18
WIP: fixing false negatives in addressbook tests by improving stability
shayfaber Jul 23, 2025
f1b3c3d
now searches for the config files and merges them
Jul 24, 2025
3b655dc
readded ts-check
Jul 24, 2025
c8bc260
Edit index.ts
Jul 24, 2025
ea6c950
Updated @config string to only need the base-tests/config folder
Jul 24, 2025
83651e0
Rewriting the setup files
shayfaber Jul 16, 2025
960eb61
WIP: rewrite and fixes of setup.spec.ts
shayfaber Jul 16, 2025
b40c12b
WIP setup.spec.ts
shayfaber Jul 21, 2025
a646141
WIP: fixing setup.spec.ts
shayfaber Jul 21, 2025
9050781
Rewrote setup.spec.ts and magentoAdmin.page.ts
shayfaber Jul 21, 2025
3ee0678
Moved selectors to appropriate JSON files
shayfaber Jul 21, 2025
9e7a9ac
renamed register.spec tag and updated var to let
Jul 22, 2025
f535576
Removed unused statements and readded tests/config folder for config …
Jul 25, 2025
23e91f3
Ensure side menu visibility with for reliable navigation
Jul 25, 2025
6cbbc6e
Ensure side menu visibility with for reliable navigation
Jul 25, 2025
d6007e5
Moved beforeEach above .describe and
Jul 25, 2025
67f8432
Removed waitfor
Jul 25, 2025
3831aa2
Merge branch '220-setup-spec-herschrijven' into '184-gitlab-ci-cd'
Jul 25, 2025
beb7360
Fixed test Change_product_quantity_in_cart
shayfaber Jul 21, 2025
f9efc13
Added .click on qty input field.
Jul 25, 2025
4ea4814
Added .click on qty input field.
Jul 25, 2025
7ef2a2d
Rewritten magewire util, updated checkout spec and page files.
Jul 17, 2025
73caa40
removed redundend this.magewire.waitFo... and changed it to this.wait…
Jul 17, 2025
10b838d
Merge branch '217-test-faalt-door-race-condition-en-onbetrouwbare-not…
Jul 28, 2025
7e405d7
Merge branch '219-verbeter-wachten-op-magewire-loading-element-in-che…
Jul 28, 2025
5b7b72c
Merge branch '184-gitlab-ci-cd' into '223-analyseer-en-verbeter-algem…
Jul 28, 2025
c662425
Edit .gitlab-ci.yml (removed 'max-failures=1' l.76)
Jul 28, 2025
1ac053a
Merge branch '223-analyseer-en-verbeter-algemene-stabiliteit-van-e2e-…
Jul 28, 2025
0c14007
Fixed issue in Guest payment method test where state selection caused…
shayfaber Jul 29, 2025
3dbc571
Fixed mistake in checkout test, rewrote waitForMagewireDomIdle functi…
shayfaber Jul 29, 2025
37f0924
Added noWaitAfter to locatorHandler
shayfaber Jul 29, 2025
f36be12
Added waitForURL call on line 73 of checkouk.page.ts
shayfaber Jul 29, 2025
b2cf06b
Merge branch '231-fix-magewire-issues-die-false-negatives-veroorzaken…
Jul 29, 2025
9d823c0
Merge branch '184-gitlab-ci-cd' into 'main'
Jul 29, 2025
088f3b8
Merge branch 'staging' into 'main'
Jul 29, 2025
e578f60
readded testing gitlab mirror
Jul 29, 2025
383e94b
test rebase of gitlab into github
Jul 29, 2025
dd12225
test rebase of gitlab into github
Jul 29, 2025
927882c
test rebase of gitlab into github
Jul 29, 2025
0b604f7
test rebase of gitlab into github
Jul 29, 2025
87d0f5a
revert renaming
Jul 29, 2025
5f58f6d
changing order of pipelines where testing the suite is first, then mi…
Jul 29, 2025
0f9f4c7
Trial and error on gitlab ci
Jul 29, 2025
9c6fe6b
wip
Jul 29, 2025
6d2abfd
wip
Jul 29, 2025
8979322
wip
Jul 29, 2025
ef0199b
wip
Jul 29, 2025
d83ca63
wip
Jul 29, 2025
9cec569
wip
Jul 29, 2025
e9459b8
wip
Jul 29, 2025
3c98857
wip
Jul 29, 2025
9f412aa
wip
Jul 29, 2025
318e937
wip
Jul 29, 2025
b426dfc
possible fix
Jul 29, 2025
fd77e0f
fixed mirror_to_gitlab error
Jul 31, 2025
a39a3c6
Merge branch 'main' into '232-fix-gitlab-mirror'
Jul 31, 2025
4c52993
Merge branch '232-fix-gitlab-mirror' into 'main'
Jul 31, 2025
6ab8388
Add git trace to the export script, and cleanup the ci for testing pu…
Aug 1, 2025
b31faf0
Update .gitlab-ci.yml file
Aug 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ PLAYWRIGHT_REVIEW_URL=https://hyva-demo.elgentos.io/
MAGENTO_ADMIN_SLUG=
MAGENTO_ADMIN_USERNAME=
MAGENTO_ADMIN_PASSWORD=
MAGENTO_THEME_LOCALE=

MAGENTO_THEME_LOCALE=
MAGENTO_NEW_ACCOUNT_PASSWORD=
MAGENTO_EXISTING_ACCOUNT_EMAIL_CHROMIUM=
MAGENTO_EXISTING_ACCOUNT_EMAIL_FIREFOX=
Expand All @@ -16,6 +16,4 @@ MAGENTO_EXISTING_ACCOUNT_CHANGED_PASSWORD=

MAGENTO_COUPON_CODE_CHROMIUM=
MAGENTO_COUPON_CODE_FIREFOX=
MAGENTO_COUPON_CODE_WEBKIT=

CAPTCHA_BYPASS=
MAGENTO_COUPON_CODE_WEBKIT=
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ node_modules/
/test-results/
/auth-storage/
/playwright-report/
/base-tests/

#files
/*.config.ts
Expand Down
10 changes: 7 additions & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ image: node:18-bullseye
stages:
- mirror

variables:
GIT_DEPTH: 0
GIT_TRACE: 1

mirror_to_github:
stage: mirror
only:
Expand All @@ -15,10 +19,10 @@ mirror_to_github:
- git config --global user.name "developer-elgentos"
- git config --global user.email "[email protected]"
script:
- git remote add github [email protected]:elgentos/magento2-playwright.git
- git fetch github main
- git fetch origin main
- git checkout -B main origin/main
- git remote add github [email protected]:elgentos/magento2-playwright.git
- git fetch github main
- git push github main:gitlab-main

test_mirror_pipeline:
Expand All @@ -33,4 +37,4 @@ test_mirror_pipeline:
- git config --global user.name "developer-elgentos"
- git config --global user.email "[email protected]"
script:
- git ls-remote [email protected]:elgentos/magento2-playwright.git
- git ls-remote [email protected]:elgentos/magento2-playwright.git
13 changes: 11 additions & 2 deletions install.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,17 @@ async function install() {
const envPath = path.join('.env');
let envContent = '';

// for (const [key, value] of Object.entries(envVars)) {
// const userInput = await question(`Enter ${ key } (default: ${ value.default }): `);
// envContent += `${ key }=${ userInput || value.default }\n`;
// }

const isCI = process.env.CI === 'true';
for (const [key, value] of Object.entries(envVars)) {
const userInput = await question(`Enter ${ key } (default: ${ value.default }): `);
let userInput = '';
if (!isCI) {
userInput = await question(`Enter ${ key } (default: ${ value.default }): `);
}
envContent += `${ key }=${ userInput || value.default }\n`;
}

Expand All @@ -58,4 +67,4 @@ async function install() {
rl.close();
}

install();
install();
21 changes: 14 additions & 7 deletions playwright.config.example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,38 @@ import fs from "node:fs";
dotenv.config({ path: path.resolve(__dirname, '.env') });

function getTestFiles(baseDir: string, customDir?: string): string[] {
const baseFiles = new Set(fs.readdirSync(baseDir).filter(file => file.endsWith('.spec.ts')));
const baseFiles = new Set(
fs.readdirSync(baseDir)
.filter(file => file.endsWith('.spec.ts'))
.map(file => path.join(baseDir, file))
);

if (!customDir || !fs.existsSync(customDir)) {
return Array.from(baseFiles);
}

const customFiles = fs.readdirSync(customDir).filter(file => file.endsWith('.spec.ts'));
const customFiles = fs.readdirSync(customDir)
.filter(file => file.endsWith('.spec.ts'))
.map(file => path.join(customDir, file));

if(customFiles.length === 0) {
if (customFiles.length === 0) {
return Array.from(baseFiles);
}

const testFiles = new Set<string>();

// Get base files that have an override in custom
for (const file of baseFiles) {
const baseFilePath = path.join(baseDir, file);
const customFilePath = path.join(customDir, file);
const baseFilePath = path.join(baseDir, path.basename(file));
const customFilePath = path.join(customDir, path.basename(file));

testFiles.add(fs.existsSync(customFilePath) ? customFilePath : baseFilePath);
}

// Add custom tests that aren't in base
for (const file of customFiles) {
if (!baseFiles.has(file)) {
testFiles.add(path.join(customDir, file));
if (!baseFiles.has(path.basename(file))) {
testFiles.add(file);
}
}

Expand All @@ -49,6 +55,7 @@ const testFiles = getTestFiles(
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: '.',
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
Expand Down
114 changes: 34 additions & 80 deletions tests/account.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ test.describe('Account information actions', {annotation: {type: 'Account Dashbo
}

// Create account

await registerPage.createNewAccount(faker.person.firstName(), faker.person.lastName(), emailPasswordUpdatevalue, passwordInputValue);

// Update password
Expand Down Expand Up @@ -128,74 +127,32 @@ test.describe('Account information actions', {annotation: {type: 'Account Dashbo

test.describe.serial('Account address book actions', { annotation: {type: 'Account Dashboard', description: 'Tests for the Address Book'},}, () => {

/**
* @feature Magento 2 Add First Address to Account
* @scenario User adds a first address to their account
* @given I am logged in
* @and I am on the account dashboard page
* @when I go to the page where I can add my address
* @and I haven't added an address yet
* @when I fill in the required information
* @and I click the save button
* @then I should see a notification my address has been updated.
* @and The new address should be selected as default and shipping address
*/

test('Add_first_address',{ tag: ['@account-credentials', '@hot'] }, async ({page}, testInfo) => {
const accountPage = new AccountPage(page);
let addNewAddressTitle = page.getByRole('heading', {level: 1, name: UIReference.newAddress.addNewAddressTitle});

if(await addNewAddressTitle.isHidden()) {
await accountPage.deleteAllAddresses();
testInfo.annotations.push({ type: 'Notification: deleted addresses', description: `All addresses are deleted to recreate the first address flow.` });
await page.goto(slugs.account.addressNewSlug);
}

const firstAddress = inputValues.firstAddress;
const streetValue = firstAddress.firstStreetAddressValue + ' ' + Math.floor(Math.random() * 100 + 1);
const companyName = faker.company.name();
await accountPage.addNewAddress({
company: companyName,
phone: firstAddress.firstPhoneNumberValue,
street: streetValue,
zip: firstAddress.firstZipCodeValue,
city: firstAddress.firstCityValue,
state: firstAddress.firstProvinceValue,
country: firstAddress.firstNonDefaultCountry,
});

await expect(page.getByText(companyName)).toBeVisible();
await expect(page.getByText(streetValue)).toBeVisible();
test.beforeEach(async ({page}) => {
await page.goto(slugs.account.addressIndexSlug);
await page.waitForLoadState();
});

/**
* @feature Add an address
* @given I am logged in
* @and I am on the account dashboard page
* @and I am on the account dashboard page
* @when I go to the page where I can add another address
* @when I fill in the required information
* @and I click the save button
* @and I click the save button
* @then I should see a notification my address has been updated.
* @and The new address should be listed
* @and The new address should be listed
*/
test('Add_another_address',{ tag: ['@account-credentials', '@hot'] }, async ({page}) => {
test('Add_an_address',{ tag: ['@address-actions', '@hot'] }, async ({page}) => {
await page.goto(slugs.account.addressNewSlug);
const accountPage = new AccountPage(page);

const secondAddress = inputValues.secondAddress;
const companyName = faker.company.name();
const streetValue = secondAddress.secondStreetAddressValue + ' ' + Math.floor(Math.random() * 100 + 1);
await accountPage.addNewAddress({
company: companyName,
phone: secondAddress.secondPhoneNumberValue,
street: streetValue,
zip: secondAddress.secondZipCodeValue,
city: secondAddress.secondCityValue,
state: secondAddress.secondProvinceValue,
country: secondAddress.secondNonDefaultCountry,
});

await expect(page.getByText(companyName)).toBeVisible();
await expect(page.getByText(streetValue)).toBeVisible();
const address = `${faker.location.streetAddress()} ${Math.floor(Math.random() * 100 + 1)}`;
const company = faker.company.name();

await accountPage.addNewAddress({ company: company, street: address});

await expect(page.getByText(address).first(), `Expect new address to be listed`).toBeVisible();
await expect(page.getByText(company).first(), `Expect new company name to be listed`).toBeVisible();
});

/**
Expand All @@ -210,35 +167,31 @@ test.describe.serial('Account address book actions', { annotation: {type: 'Accou
* @then I should see a notification my address has been updated.
* @and The updated address should be visible in the addres book page.
*/
test('Edit_existing_address',{ tag: ['@account-credentials', '@hot'] }, async ({page}) => {
test('Edit_existing_address',{ tag: ['@address-actions', '@hot'] }, async ({page}) => {
const accountPage = new AccountPage(page);
await page.goto(slugs.account.addressNewSlug);
await page.goto(slugs.account.addressBookSlug);
let editAddressButton = page.getByRole('link', {name: UIReference.accountDashboard.editAddressIconButton}).first();
let isDefaultAddress = false;

if(await editAddressButton.isHidden()){
// The edit address button was not found, add another address first.
await accountPage.addNewAddress();
if(await page.getByRole('link', { name: 'Change Shipping Address arrow' }).isVisible()) {
isDefaultAddress = true;
} else {
expect (page.url(), `Edit address button not found, check URL is to the new address page`).toBe(slugs.account.addressNewSlug);
await accountPage.addNewAddress();
}
}

await page.goto(slugs.account.addressBookSlug);
const editAddress = inputValues.editedAddress;
const companyName = faker.company.name();
const streetValue = editAddress.editStreetAddressValue + ' ' + Math.floor(Math.random() * 100 + 1);
await accountPage.editExistingAddress({
firstName: editAddress.editfirstNameValue,
lastName: editAddress.editLastNameValue,
company: companyName,
street: streetValue,
zip: editAddress.editZipCodeValue,
city: editAddress.editCityValue,
state: editAddress.editStateValue,
});

await expect(page.getByText(companyName)).toBeVisible();
await expect(page.getByText(streetValue)).toBeVisible();
// const companyName = faker.company.name();
const address = `${faker.location.streetAddress()} ${Math.floor(Math.random() * 100 + 1)}`;
await accountPage.editExistingAddress({street:address}, isDefaultAddress);

// await expect(page.getByText(companyName)).toBeVisible();
await expect(page.getByText(address).first()).toBeVisible();
});

test('Missing_required_field_prevents_creation',{ tag: ['@account-credentials'] }, async ({page}) => {
test('Missing_required_field_prevents_creation',{ tag: ['@address-actions'] }, async ({page}) => {
await page.goto(slugs.account.addressNewSlug);
const accountPage = new AccountPage(page);

Expand All @@ -261,13 +214,14 @@ test.describe.serial('Account address book actions', { annotation: {type: 'Accou
* @then I should see a notification my address has been deleted.
* @and The address should be removed from the overview.
*/
test('Delete_an_address',{ tag: ['@account-credentials', '@hot'] }, async ({page}, testInfo) => {
test('Delete_an_address',{ tag: ['@address-actions', '@hot'] }, async ({page}, testInfo) => {
const accountPage = new AccountPage(page);
await page.goto(slugs.account.addressBookSlug);

let deleteAddressButton = page.getByRole('link', {name: UIReference.accountDashboard.addressDeleteIconButton}).first();

if(await deleteAddressButton.isHidden()) {
await page.goto(slugs.account.addressNewSlug);
// The delete address button was not found, add another address first.
await accountPage.addNewAddress();
}
await accountPage.deleteFirstAddressFromAddressBook();
Expand Down
11 changes: 3 additions & 8 deletions tests/cart.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,6 @@ test.describe('Cart functionalities (guest)', () => {

test.describe('Price checking tests', () => {

// Test: Configurable Product Input check from PDP to checkout
// test.step: add configurable product to cart, return priceOnPDP and productAmount as variables
// test.step: call function retrieveCheckoutPrices() to go to checkout, retrieve values
// test.step: call function compareRetrievedPrices() to compare price on PDP to price in checkout

/**
* @feature Simple Product price/amount check from PDP to Checkout
* @given none
Expand All @@ -176,9 +171,9 @@ test.describe('Price checking tests', () => {
* @and the price in the checkout should equal the price of the product * the amount of the product
*/
test('Simple_product_cart_data_consistent_from_PDP_to_checkout',{ tag: ['@cart-price-check', '@cold']}, async ({page}) => {
var productPagePrice: string;
var productPageAmount: string;
var checkoutProductDetails: string[];
let productPagePrice: string;
let productPageAmount: string;
let checkoutProductDetails: string[];

const cart = new CartPage(page);

Expand Down
41 changes: 37 additions & 4 deletions tests/category.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,63 @@ import { test } from '@playwright/test';

import CategoryPage from '@poms/frontend/category.page';

test('Filter_category_on_size',{ tag: ['@category', '@cold']}, async ({page, browserName}) => {
/**
* @feature Filter category page
* @scenario User filters category page on size L
* @given I navigate to the category page
* @when I open the Size filter category
* @and I click the size L button
* @then the URL should reflect this filter
* @and I should see fewer products
*/
test('Filter_category_on_size',{ tag: ['@category', '@cold']}, async ({page}) => {
const categoryPage = new CategoryPage(page);
await categoryPage.goToCategoryPage();

await categoryPage.filterOnSize(browserName);
await categoryPage.filterOnSize();
});

/**
* @feature Sort category page by price
* @scenario User sorts category page by price
* @given I navigate to the category page
* @when I open the 'Sort' dropdown
* @and I click the price button
* @then the URL should reflect this filter
* @and I should see products sorted by price
*/
test('Sort_category_by_price',{ tag: ['@category', '@cold']}, async ({page}) => {
const categoryPage = new CategoryPage(page);
await categoryPage.goToCategoryPage();

await categoryPage.sortProducts('price');
});

/**
* @feature products per page
* @scenario User updates the amount of products shown on the page
* @given I navigate to the category page
* @when I change the 'Show' dropdown
* @then the URl should reflect this filter
* @and the amount of items should be the new amount I've selected
*/
test('Change_amount_of_products_shown',{ tag: ['@category', '@cold'],}, async ({page}) => {
const categoryPage = new CategoryPage(page);
await categoryPage.goToCategoryPage();

await categoryPage.showMoreProducts();
// insert your code here
});

/**
* @feature View switcher
* @scenario User switches from the grid to the list view
* @given I navigate to the category page
* @when I click the grid or list mode button
* @then the URl should reflect this updated view
* @and the reported selected view should not be the same as it was before I clicked the button
*/
test('Switch_from_grid_to_list_view',{ tag: ['@category', '@cold'],}, async ({page}) => {
const categoryPage = new CategoryPage(page);
await categoryPage.goToCategoryPage();
await categoryPage.switchView();
});
});
Loading