-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TEST] [E2E] Added test for setting balance and exporting gift cards #4650
Merged
karola312
merged 12 commits into
main
from
tests-for-setting-balance-and-exporting-gift-cards
Mar 15, 2024
Merged
Changes from 8 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
2c9b6d8
Added test for setting balance and exporting gift cards
karola312 61cc591
add changeset
karola312 ae9fd28
Fixes after review
karola312 9062d91
Fixes after review
karola312 551e905
Fix mailpit url
karola312 d3a3567
Fix mailpit env variable
karola312 6cf701f
Fix mailpit url
karola312 fbb4cc4
changes after review
karola312 9c68092
Merge branch 'main' into tests-for-setting-balance-and-exporting-gift…
karola312 51614be
Merge branch 'main' into tests-for-setting-balance-and-exporting-gift…
karola312 a06cb48
Merge branch 'main' into tests-for-setting-balance-and-exporting-gift…
karola312 db23b91
Merge branch 'main' into tests-for-setting-balance-and-exporting-gift…
karola312 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,6 +63,7 @@ jobs: | |
E2E_USER_NAME: ${{ secrets.CYPRESS_USER_NAME }} | ||
E2E_USER_PASSWORD: ${{ secrets.CYPRESS_USER_PASSWORD }} | ||
E2E_PERMISSIONS_USERS_PASSWORD: ${{ secrets.CYPRESS_PERMISSIONS_USERS_PASSWORD }} | ||
MAILPITURL: ${{ secrets.CYPRESS_MAILPITURL }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here |
||
|
||
merge-reports: | ||
if: '!cancelled()' | ||
|
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 |
---|---|---|
|
@@ -70,6 +70,7 @@ jobs: | |
E2E_USER_NAME: ${{ secrets.CYPRESS_USER_NAME }} | ||
E2E_USER_PASSWORD: ${{ secrets.CYPRESS_USER_PASSWORD }} | ||
E2E_PERMISSIONS_USERS_PASSWORD: ${{ secrets.CYPRESS_PERMISSIONS_USERS_PASSWORD }} | ||
MAILPITURL: ${{ secrets.CYPRESS_MAILPITURL }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and here |
||
|
||
merge-reports: | ||
if: '!cancelled()' | ||
|
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(); | ||
karola312 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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(); | ||
} | ||
karola312 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} |
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not cypress, i think you meant
${{ secrets.MAILPITURL }}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you approve it and maybe in next PR I will fix all variables: CYPRESS_MAILPITURL, CYPRESS_PERMISSIONS_USERS_PASSWORD, CYPRESS_USER_PASSWORD, CYPRESS_USER_NAME etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the status of it? Those comments has 3 weeks