-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* change billing and shipping address in orders * Create twenty-games-complain.md * test rename
- Loading branch information
1 parent
8e0e208
commit 5546daa
Showing
10 changed files
with
248 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"saleor-dashboard": minor | ||
--- | ||
|
||
Shipping Adress change test | ||
Billing Adress change test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,104 @@ | ||
import type { Locator, Page } from "@playwright/test"; | ||
import type { Page } from "@playwright/test"; | ||
|
||
export class AddressDialog { | ||
readonly page: Page; | ||
readonly existingAddressRadioButton: Locator; | ||
readonly newAddressRadioButton: Locator; | ||
readonly submitButton: Locator; | ||
|
||
constructor(page: Page) { | ||
this.page = page; | ||
this.newAddressRadioButton = page | ||
constructor( | ||
page: Page, | ||
readonly newAddressRadioButton = page | ||
.getByTestId("newAddress") | ||
.locator('[value="newAddress"]'); | ||
this.existingAddressRadioButton = page | ||
.locator('[value="newAddress"]'), | ||
readonly existingAddressRadioButton = page | ||
.getByTestId("customerAddress") | ||
.locator('[value="customerAddress"]'); | ||
.locator('[value="customerAddress"]'), | ||
|
||
this.submitButton = page.getByTestId("submit"); | ||
} | ||
readonly submitButton = page.getByTestId("submit"), | ||
readonly firstNameInput = page | ||
.getByTestId("first-name-input") | ||
.locator("input"), | ||
readonly lastNameInput = page | ||
.getByTestId("last-name-input") | ||
.locator("input"), | ||
readonly companyNameInput = page | ||
.getByTestId("company-name-input") | ||
.locator("input"), | ||
readonly phoneInput = page.getByTestId("phone-input").locator("input"), | ||
readonly cityInput = page.getByTestId("city-input").locator("input"), | ||
readonly zipInput = page.getByTestId("zip-input").locator("input"), | ||
readonly addressLine1Input = page | ||
.getByTestId("address-line-1-input") | ||
.locator("input"), | ||
readonly addressLine2Input = page | ||
.getByTestId("address-line-2-input") | ||
.locator("input"), | ||
readonly countrySelect = page.getByTestId( | ||
"address-edit-country-select-field", | ||
), | ||
readonly countryAreaSelect = page.getByTestId( | ||
"address-edit-country-area-field", | ||
), | ||
readonly selectOptions = page.getByTestId( | ||
"single-autocomplete-select-option", | ||
), | ||
) {} | ||
|
||
async clickConfirmButton() { | ||
await this.submitButton.click(); | ||
} | ||
async clickCountrySelect() { | ||
await this.countrySelect.click(); | ||
} | ||
async clickNewAddressRadioButton() { | ||
await this.newAddressRadioButton.click(); | ||
} | ||
|
||
async typeFirstName(name = "Test") { | ||
await this.firstNameInput.fill(name); | ||
} | ||
async typeLastName(lastName = "Automation") { | ||
await this.lastNameInput.fill(lastName); | ||
} | ||
async typeCompanyName(companyName = "Saleor") { | ||
await this.companyNameInput.fill(companyName); | ||
} | ||
async typePhone(phone = "123456789") { | ||
await this.phoneInput.fill(phone); | ||
} | ||
async typeAddressLine1(addressLine1 = "Teczowa") { | ||
await this.addressLine1Input.fill(addressLine1); | ||
} | ||
async typeAddressLine2(addressLine2 = "7") { | ||
await this.addressLine2Input.fill(addressLine2); | ||
} | ||
async typeCity(cityName = "Wroclaw") { | ||
await this.cityInput.fill(cityName); | ||
} | ||
async typeZip(zip = "53-601") { | ||
await this.zipInput.fill(zip); | ||
} | ||
|
||
async completeAddressFormAllFields(customerInfo: { | ||
firstName: string; | ||
lastName: string; | ||
companyName: string; | ||
phone: string; | ||
addressLine1: string; | ||
addressLine2: string; | ||
cityName: string; | ||
zip: string; | ||
country: string; | ||
countryArea?: string; | ||
}) { | ||
await this.typeFirstName(customerInfo.firstName); | ||
await this.typeLastName(customerInfo.lastName); | ||
await this.typeCompanyName(customerInfo.companyName); | ||
await this.typePhone(customerInfo.phone); | ||
await this.typeAddressLine1(customerInfo.addressLine1); | ||
await this.typeAddressLine2(customerInfo.addressLine2); | ||
await this.typeCity(customerInfo.cityName); | ||
await this.typeZip(customerInfo.zip); | ||
await this.clickCountrySelect(); | ||
await this.countrySelect.locator("input").fill(customerInfo.country); | ||
await this.selectOptions.filter({ hasText: customerInfo.country }).click(); | ||
await this.clickConfirmButton(); | ||
await this.submitButton.waitFor({ state: "hidden" }); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.