-
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.
Migrate vouchers tests to playwright (#4578)
* change billing and shipping address in orders * Create twenty-games-complain.md * test rename * Draft orders bulk delete & Create draft order tests * Vouchers tests * TC numbers update * migrated vouchers tests * removed doubled changeset * assign voucher tests
- Loading branch information
1 parent
bcbed0d
commit bb1401b
Showing
27 changed files
with
691 additions
and
56 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,15 @@ | ||
--- | ||
"saleor-dashboard": minor | ||
--- | ||
|
||
Create voucher with auto-generated codes and fixed amount discount | ||
Create voucher with manual code and percentage discount | ||
Edit voucher to have free shipping discount | ||
Edit voucher Usage Limits: used in total, per customer, staff only, code used once | ||
Create voucher with minimum value of order, | ||
Edit voucher minimum quantity of items | ||
Delete voucher | ||
Bulk delete voucher | ||
Edit voucher - assign voucher to specific product | ||
Edit voucher - assign voucher to specific collection | ||
Edit voucher - assign voucher to specific category |
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,3 @@ | ||
export const AVAILABILITY = { | ||
in1OutOf7Channels: "In 1 out of 7 channels", | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import type { Page } from "@playwright/test"; | ||
|
||
export class AddVoucherCodeDialog { | ||
constructor( | ||
page: Page, | ||
readonly quantityInput = page.getByTestId("quantity-input"), | ||
readonly prefixInput = page.getByTestId("prefix-input"), | ||
readonly confirmButton = page.getByTestId("confirm-button"), | ||
readonly enterCodeInput = page.getByTestId("enter-code-input"), | ||
) {} | ||
|
||
async typeCodesQuantity(quantity = "10") { | ||
await this.quantityInput.fill(quantity); | ||
} | ||
async typeCodesPrefix(prefix = "automation") { | ||
await this.prefixInput.fill(prefix); | ||
} | ||
async typeCode(code = "123456789") { | ||
await this.enterCodeInput.fill(code); | ||
} | ||
async clickConfirmButton() { | ||
await this.confirmButton.click(); | ||
} | ||
} |
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,26 @@ | ||
import type { Page } from "@playwright/test"; | ||
|
||
export class AssignSpecificProductsDialog { | ||
readonly page: Page; | ||
|
||
constructor( | ||
page: Page, | ||
readonly nameInput = page.getByTestId("value-name").locator("input"), | ||
readonly assignAndSaveButton = page.locator("button[type='submit']"), | ||
) { | ||
this.page = page; | ||
} | ||
|
||
async clickAssignAndSaveButton() { | ||
await this.assignAndSaveButton.click(); | ||
await this.assignAndSaveButton.waitFor({ state: "hidden" }); | ||
} | ||
|
||
async assignSpecificProductsByNameAndSave(nameAkaText: string) { | ||
const specificProductCheckbox = await this.page | ||
.getByRole("row", { name: nameAkaText }) | ||
.getByRole("checkbox"); | ||
await specificProductCheckbox.click(); | ||
await this.clickAssignAndSaveButton(); | ||
} | ||
} |
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,13 @@ | ||
import type { Page } from "@playwright/test"; | ||
|
||
export class DeleteVoucherDialog { | ||
readonly page: Page; | ||
|
||
constructor(page: Page, readonly deleteButton = page.getByTestId("submit")) { | ||
this.page = page; | ||
} | ||
|
||
async clickDeleteButton() { | ||
await this.deleteButton.first().click(); | ||
} | ||
} |
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,13 @@ | ||
import type { Page } from "@playwright/test"; | ||
|
||
export class DeleteVouchersDialog { | ||
readonly page: Page; | ||
|
||
constructor(page: Page, readonly deleteButton = page.getByTestId("submit")) { | ||
this.page = page; | ||
} | ||
|
||
async clickDeleteButton() { | ||
await this.deleteButton.first().click(); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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.