Skip to content

Commit

Permalink
Update playwright/tests/giftCards.spec.ts
Browse files Browse the repository at this point in the history
Co-authored-by: Wojciech Mista <wojciech.mista@hotmail.com>
  • Loading branch information
yellowee and Cloud11PL committed May 10, 2024
1 parent d449870 commit 3e26163
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion playwright/pages/dialogs/issueGiftCardDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export class IssueGiftCardDialog extends BasePage {
readonly expiryPeriodAmountInput = page.locator('[name="expiryPeriodAmount"]'),
readonly tagsInput = page.getByTestId("gift-card-tag-select-field").locator("input"),
readonly cardCode = page.getByTestId("cardCode"),

readonly giftCardExpireFields = page.getByTestId("gift-card-expire-data-fields"),
readonly sendToCustomerCheckbox = page
.getByTestId("send-to-customer-section")
.locator('input[type="checkbox"]'),
Expand Down Expand Up @@ -71,6 +71,8 @@ export class IssueGiftCardDialog extends BasePage {

async clickSendExpireDateCheckbox() {
await this.sendExpireDateCheckbox.click();
await expect(this.sendExpireDateCheckbox.isChecked()).toBeTruthy();
await this.giftCardExpireFields.waitFor({ state: "attached" });

Check failure on line 75 in playwright/pages/dialogs/issueGiftCardDialog.ts

View workflow job for this annotation

GitHub Actions / run-tests (1/2)

[chromium] › giftCards.spec.ts:43:5 › TC: SALEOR_106 Issue gift card with specific customer and expiry date @e2e @gift

1) [chromium] › giftCards.spec.ts:43:5 › TC: SALEOR_106 Issue gift card with specific customer and expiry date @e2e @gift Error: locator.waitFor: Test timeout of 90000ms exceeded. Call log: - waiting for getByTestId('gift-card-expire-data-fields') at ../pages/dialogs/issueGiftCardDialog.ts:75 73 | await this.sendExpireDateCheckbox.click(); 74 | await expect(this.sendExpireDateCheckbox.isChecked()).toBeTruthy(); > 75 | await this.giftCardExpireFields.waitFor({ state: "attached" }); | ^ 76 | } 77 | 78 | async clickRequiresActivationCheckbox() { at IssueGiftCardDialog.clickSendExpireDateCheckbox (/home/runner/work/saleor-dashboard/saleor-dashboard/playwright/pages/dialogs/issueGiftCardDialog.ts:75:37) at /home/runner/work/saleor-dashboard/saleor-dashboard/playwright/tests/giftCards.spec.ts:47:3
}

async clickRequiresActivationCheckbox() {
Expand Down
4 changes: 2 additions & 2 deletions playwright/tests/giftCards.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ test("TC: SALEOR_106 Issue gift card with specific customer and expiry date @e2e
await giftCardsPage.issueGiftCardDialog.typeExpiryPeriodAmount("2");
await giftCardsPage.issueGiftCardDialog.clickSendToCustomerCheckbox();
await giftCardsPage.issueGiftCardDialog.selectCustomer("e2e-customer to-be-activated");
await giftCardsPage.issueGiftCardDialog.clickIssueButton(),
await expect(giftCardsPage.issueGiftCardDialog.cardCode).toBeVisible();
await giftCardsPage.issueGiftCardDialog.clickIssueButton();
await expect(giftCardsPage.issueGiftCardDialog.cardCode).toBeVisible();

const code = (await giftCardsPage.issueGiftCardDialog.cardCode.innerText()).slice(-4);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const GiftCardCreateExpirySelect: React.FC<GiftCardCreateExpirySelectProps> = ({
)}

{expiryType === "EXPIRY_PERIOD" && (
<div className={classes.periodField}>
<div data-test-id="gift-card-expire-data-fields" className={classes.periodField}>
<TimePeriodField
isError={!!errors?.expiryDate}
helperText={getGiftCardErrorMessage(errors?.expiryDate, intl)}
Expand Down

0 comments on commit 3e26163

Please sign in to comment.