Skip to content

Commit

Permalink
Fixes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
karola312 committed Jan 31, 2024
1 parent 61cc591 commit ae9fd28
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .github/actions/run-pw-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ inputs:
SHARD:
description: "Shard number"
required: true
MAILPITURL:
description: "mailpit uri"
required: true

runs:
using: "composite"
steps:
Expand All @@ -43,6 +47,7 @@ runs:
E2E_USER_PASSWORD: ${{ inputs.E2E_USER_PASSWORD }}
E2E_PERMISSIONS_USERS_PASSWORD: ${{ inputs.E2E_PERMISSIONS_USERS_PASSWORD }}
SHARD_NUMBER: ${{ inputs.SHARD }}
MAILPITURL: ${{ inputs.MAILPITURL }}
run: npm run qa:pw-e2e -- --shard "$SHARD_NUMBER"

- name: Upload blob report to GitHub Actions Artifacts
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pr-automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,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 }}

merge-reports:
if: '!cancelled()'
Expand Down
1 change: 1 addition & 0 deletions playwright/pages/dialogs/exportGiftCardsDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ export class ExportGiftCardsDialog {
const fileExtensionCheckbox = this.page.getByTestId(fileExtension);
await fileExtensionCheckbox.click();
await this.submitButton.click();
await this.submitButton.waitFor({state: "hidden"})
}
}
4 changes: 2 additions & 2 deletions playwright/pages/giftCardsPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { ResendGiftCardCodeDialog } from "@dialogs/resendGiftCardCodeDialog";
import { MetadataSeoPage } from "@pageElements/metadataSeoPage";
import { BasePage } from "@pages/basePage";
import type { Page } from "@playwright/test";
import { ExportGiftCardsDialog } from "./dialogs/exportGiftCardsDialog";
import { SetGiftCardsBalanceDialog } from "./dialogs/setGiftCardBalanceDialog";
import { ExportGiftCardsDialog } from "@dialogs/exportGiftCardsDialog";
import { SetGiftCardsBalanceDialog } from "@dialogs/setGiftCardBalanceDialog";

export class GiftCardsPage extends BasePage {
readonly page: Page;
Expand Down
12 changes: 5 additions & 7 deletions playwright/tests/girftCards.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ import { MailpitService } from "@api/mailpit";

test.use({ storageState: "playwright/.auth/admin.json" });
let giftCardsPage: GiftCardsPage;
test.beforeEach(({ page }) => {
let mailpitService: MailpitService;
test.beforeEach(({ page, request }) => {
giftCardsPage = new GiftCardsPage(page);
mailpitService = new MailpitService(request);
});

test("TC: SALEOR_105 Issue gift card @e2e @gift", async () => {
Expand Down Expand Up @@ -108,23 +110,19 @@ test("TC: SALEOR_112 Set gift card balance @e2e @gift", async () => {
await giftCardsPage.setGiftCardsBalanceDialog.setBalance("34")
await giftCardsPage.expectSuccessBanner();
});
test("TC: SALEOR_113 Export gift card codes in XLSX file @e2e @gift", async ({request}) => {
test("TC: SALEOR_113 Export gift card codes in XLSX file @e2e @gift", async () => {
await giftCardsPage.gotoGiftCardsListView();
await giftCardsPage.clickExportGiftCards();
await giftCardsPage.exportGiftCardsDialog.exportGiftCardCodes("XLSX");
const mailpitService = new MailpitService(request);
await mailpitService.checkDoesUserReceivedExportedData(
process.env.E2E_USER_NAME!,
"Your exported gift cards data is ready",
);
});
test("TC: SALEOR_114 Export gift card codes in CSV file @e2e @gift", async ({
request,
}) => {
test("TC: SALEOR_114 Export gift card codes in CSV file @e2e @gift", async () => {
await giftCardsPage.gotoGiftCardsListView();
await giftCardsPage.clickExportGiftCards();
await giftCardsPage.exportGiftCardsDialog.exportGiftCardCodes("CSV");
const mailpitService = new MailpitService(request);
await mailpitService.checkDoesUserReceivedExportedData(
process.env.E2E_USER_NAME!,
"Your exported gift cards data is ready",
Expand Down

0 comments on commit ae9fd28

Please sign in to comment.