Skip to content

Commit

Permalink
feat: NEXT-40275 - add account address creation page (#271)
Browse files Browse the repository at this point in the history
  • Loading branch information
ocavli authored Jan 20, 2025
1 parent ba5ff25 commit efa74f0
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/page-objects/StorefrontPages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { Search } from './storefront/Search';
import { SearchSuggest } from './storefront/SearchSuggest';
import { CustomRegister } from './storefront/CustomRegister';
import { CheckoutOrderEdit } from './storefront/CheckoutOrderEdit';
import { AccountAddressCreate } from './storefront/AccountAddresssCreate';

export interface StorefrontPageTypes {
StorefrontHome: Home;
Expand All @@ -36,6 +37,7 @@ export interface StorefrontPageTypes {
StorefrontAccountProfile: AccountProfile;
StorefrontAccountOrder: AccountOrder;
StorefrontAccountAddresses: AccountAddresses;
StorefrontAccountAddressCreate: AccountAddressCreate;
StorefrontAccountPayment: AccountPayment;
StorefrontSearch: Search;
StorefrontSearchSuggest: SearchSuggest;
Expand All @@ -58,6 +60,7 @@ export const StorefrontPageObjects = {
AccountProfile,
AccountOrder,
AccountAddresses,
AccountAddressCreate,
AccountPayment,
Search,
SearchSuggest,
Expand Down Expand Up @@ -123,6 +126,10 @@ export const test = base.extend<FixtureTypes>({
await use(new AccountAddresses(StorefrontPage));
},

StorefrontAccountAddressCreate: async ({ StorefrontPage }, use) => {
await use(new AccountAddressCreate(StorefrontPage));
},

StorefrontAccountPayment: async ({ StorefrontPage }, use) => {
await use(new AccountPayment(StorefrontPage));
},
Expand Down
32 changes: 32 additions & 0 deletions src/page-objects/storefront/AccountAddresssCreate.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import type { Page, Locator } from '@playwright/test';
import type { PageObject } from '../../types/PageObject';

export class AccountAddressCreate implements PageObject {
public readonly salutationDropdown: Locator;
public readonly firstNameInput: Locator;
public readonly lastNameInput: Locator;
public readonly companyInput: Locator;
public readonly departmentInput: Locator;
public readonly streetInput: Locator;
public readonly zipcodeInput: Locator;
public readonly cityInput: Locator;
public readonly countryDropdown: Locator;
public readonly saveAddressButton: Locator;

constructor(public readonly page: Page) {
this.salutationDropdown = page.locator('#addresspersonalSalutation');
this.firstNameInput = page.locator('#addresspersonalFirstName');
this.lastNameInput = page.locator('#addresspersonalLastName');
this.companyInput = page.locator('#addresscompany');
this.departmentInput = page.locator('#addressdepartment');
this.streetInput = page.locator('#addressAddressStreet');
this.zipcodeInput = page.locator('#addressAddressZipcode');
this.cityInput = page.locator('#addressAddressCity');
this.countryDropdown = page.locator('#addressAddressCountry');
this.saveAddressButton = page.locator('.address-form-submit');
}

url() {
return 'account/address/create';
}
}

0 comments on commit efa74f0

Please sign in to comment.