-
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.
[TEST] [E2E] Added test for setting balance and exporting gift cards (#…
…4650) * Added test for setting balance and exporting gift cards * add changeset * Fixes after review * Fixes after review * Fix mailpit url * Fix mailpit env variable * Fix mailpit url * changes after review
- Loading branch information
Showing
11 changed files
with
116 additions
and
10 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,5 @@ | ||
--- | ||
"saleor-dashboard": minor | ||
--- | ||
|
||
Rewritten tests for setting balance and exporting gift cards |
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
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,16 @@ | ||
import { Page } from "@playwright/test"; | ||
|
||
export class ExportGiftCardsDialog { | ||
readonly page: Page; | ||
|
||
constructor(page: Page, readonly submitButton = page.getByTestId("submit")) { | ||
this.page = page; | ||
} | ||
|
||
async exportGiftCardCodes(fileExtension: string) { | ||
const fileExtensionCheckbox = this.page.getByTestId(fileExtension); | ||
await fileExtensionCheckbox.click(); | ||
await this.submitButton.click(); | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Page } from "@playwright/test"; | ||
|
||
export class SetGiftCardsBalanceDialog { | ||
readonly page: Page; | ||
|
||
constructor( | ||
page: Page, | ||
readonly submitButton = page.getByTestId("submit"), | ||
readonly enterAmountInput = page.locator('[name="balanceAmount"]'), | ||
) { | ||
this.page = page; | ||
} | ||
|
||
async setBalance(balance: string){ | ||
await this.enterAmountInput.fill(balance); | ||
await this.submitButton.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
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