Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
846c3b5
Fix failing e2e due to invalid assertions
witoszekdev Jan 28, 2026
9a60d87
fix: add missing test-id in datagrid
witoszekdev Jan 28, 2026
f6b1de2
fix: add new fragment for updating order lines, to re-fetch stale data
witoszekdev Jan 28, 2026
7aa927f
fix: add missing fetch for changed shipping method, separate props
witoszekdev Jan 28, 2026
64fb341
Merge branch 'main' into fix-e2e-notifiactions-check
witoszekdev Jan 29, 2026
070ea13
revert changes
witoszekdev Jan 29, 2026
3c7a98b
fix: gift card assertions
witoszekdev Jan 29, 2026
c72fa4a
add command to delete auth
witoszekdev Jan 29, 2026
b3577f7
fix: add missing data-test-id
witoszekdev Jan 29, 2026
8c26119
fix: change assertion for channel availability text
witoszekdev Jan 29, 2026
9aec35f
fix: remove assertion for copied to clipboard
witoszekdev Jan 29, 2026
a0d4de4
add changeset
witoszekdev Jan 30, 2026
756060c
add missing waitfor, add scroll into view
witoszekdev Jan 30, 2026
34eb8a1
fix test await usage, add more waitfor
witoszekdev Jan 30, 2026
a1bb071
update assertion for permissions, add waitfor url in shipping methods
witoszekdev Jan 30, 2026
8631732
add watfor for new metadata edition, update assertions and selectors
witoszekdev Jan 30, 2026
24c8dfb
add skill
witoszekdev Jan 30, 2026
56680a1
move skill to plugin
witoszekdev Jan 30, 2026
3ee63df
fix taxes page test failing
witoszekdev Jan 30, 2026
401baa8
Delete claude plugin - for separate PR
witoszekdev Jan 30, 2026
6a88f22
fix: metadata save failure - check mutation
witoszekdev Jan 30, 2026
ca16b6a
Merge branch 'main' into fix-e2e-notifiactions-check
witoszekdev Jan 30, 2026
44da815
delete skill - moved to separate PR
witoszekdev Jan 30, 2026
73a7cea
fix locator taxes
witoszekdev Jan 30, 2026
bc08fc7
Merge branch 'main' into fix-e2e-notifiactions-check
witoszekdev Feb 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/running-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,9 @@ You are ready to run Playwright commands like:
```shell
pnpm run e2e
```

Note that if you have changed `BASE_URL` to run tests on different environment you will need to clear login data which is stored locally in `playwright/.auth` folder:

```
pnpm run e2e:clean-auth
```
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"dev": "vite --host",
"dev:no-strict": "cross-env VITE_DISABLE_STRICT_MODE=true vite --host",
"e2e": "pnpm exec playwright test --grep \"#e2e\"",
"e2e:clean-auth": "rm -rf ./playwright/.auth",
"e2e:ui": "pnpm exec playwright test --ui",
"extract-messages": "formatjs extract 'src/**/*.{ts,tsx}' --ignore '**/*.d.ts' --out-file locale/defaultMessages.json --format scripts/formatter.cjs",
"fetch-local-schema": "node scripts/fetch-local-schema.cjs",
Expand Down
3 changes: 3 additions & 0 deletions playwright/data/copy.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
export const AVAILABILITY = {
/** Used for product pages with new AvailabilityCard */
in1Of: "In 1 of",
/** Used for voucher/discount pages with old ChannelsAvailabilityCard */
in1OutOf: "In 1 out of",
};
4 changes: 1 addition & 3 deletions playwright/pages/productPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ export class ProductPage extends BasePage {
constructor(
page: Page,
readonly productsNames = page.getByTestId("name"),
readonly productAvailableInChannelsText = page.getByTestId(
"product-available-in-channels-text",
),
readonly productAvailableInChannelsText = page.getByTestId("availability-card"),
readonly createProductButton = page.getByTestId("add-product"),
readonly cogShowMoreButtonButton = page.getByTestId("show-more-button"),
readonly exportButton = page.getByTestId("export"),
Expand Down
5 changes: 2 additions & 3 deletions playwright/tests/customers.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,11 @@ test("TC: SALEOR_207 Issue a new gift card for the customer #e2e #customer", asy
await customersPage.issueGiftCardDialog.typeCustomTag(faker.lorem.word());
await customersPage.issueGiftCardDialog.typeNote(faker.lorem.sentences(3));
await customersPage.issueGiftCardDialog.clickIssueButton();
await customersPage.expectSuccessBanner();
await giftCardsPage.expectSuccessBanner({ message: "Gift card created" });
await expect(giftCardsPage.issueGiftCardDialog.cardCode).toBeVisible();

await giftCardsPage.issueGiftCardDialog.clickCopyCodeButton();
await giftCardsPage.expectSuccessBanner();
await giftCardsPage.expectSuccessBanner({ message: "Copied to clipboard" });
await giftCardsPage.issueGiftCardDialog.clickOkButton();
await giftCardsPage.expectElementIsHidden(giftCardsPage.giftCardDialog);
await giftCardsPage.expectSuccessBanner({ message: "Successfully created gift card" });
});
7 changes: 4 additions & 3 deletions playwright/tests/giftCards.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ test("TC: SALEOR_105 Issue gift card #e2e #gift", async () => {
await giftCardsPage.issueGiftCardDialog.clickRequiresActivationCheckbox();
await giftCardsPage.issueGiftCardDialog.clickIssueButton();
await expect(giftCardsPage.issueGiftCardDialog.cardCode).toBeVisible();
await giftCardsPage.expectSuccessBanner({ message: "Gift card created" });

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

await giftCardsPage.issueGiftCardDialog.clickCopyCodeButton();
await giftCardsPage.expectSuccessBanner();
await giftCardsPage.expectSuccessBanner({ message: "Copied to clipboard" });
await giftCardsPage.issueGiftCardDialog.clickOkButton();
await giftCardsPage.giftCardDialog.waitFor({ state: "hidden" });
await giftCardsPage.expectSuccessBanner({ message: "Successfully created gift card" });
await giftCardsPage.gotoGiftCardsListView();
await giftCardsPage.gridCanvas
.getByText(`Code ending with ${code}`)
Expand All @@ -43,13 +43,14 @@ test("TC: SALEOR_106 Issue gift card with specific customer and expiry date #e2e
await giftCardsPage.issueGiftCardDialog.clickSendToCustomerCheckbox();
await giftCardsPage.issueGiftCardDialog.selectCustomer("e2e-customer to-be-activated");
await giftCardsPage.issueGiftCardDialog.clickIssueButton();
await giftCardsPage.expectSuccessBanner({ message: "Gift card created" });
await expect(giftCardsPage.issueGiftCardDialog.cardCode).toBeVisible();

const fullCode = await giftCardsPage.issueGiftCardDialog.cardCode.innerText();

await giftCardsPage.issueGiftCardDialog.clickOkButton();
await giftCardsPage.giftCardDialog.waitFor({ state: "hidden" });
await giftCardsPage.expectSuccessBanner({ message: "Successfully created gift card" });
await giftCardsPage.expectSuccessBanner({ message: "Copied to clipboard" });
await giftCardsPage.gotoGiftCardsListView();
await giftCardsPage.searchAndFindRowIndexes(fullCode);
expect(
Expand Down
2 changes: 1 addition & 1 deletion playwright/tests/product.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ test("TC: SALEOR_46 As an admin, I should be able to update a product by uploadi
await expect(
productPage.productAvailableInChannelsText,
"Label copy shows 1 out of 7 channels ",
).toContainText(AVAILABILITY.in1OutOf);
).toContainText(AVAILABILITY.in1Of);
expect(
await productPage.productImage.count(),
"Newly added single image should be present",
Expand Down
1 change: 1 addition & 0 deletions src/components/notifications/Toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ export const Toast = ({ id, type, title, description, action }: ToastProps) => {

return (
<Box
data-test-type={type}
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The attribute name data-test-type is inconsistent with the naming convention used throughout the codebase. All other test identifiers use data-test-id. Consider using data-test-id="toast" and differentiating by the type value, or use a more specific name like data-test-id={toast-${type}} to maintain consistency with the rest of the codebase.

Copilot uses AI. Check for mistakes.
display="flex"
alignItems="flex-start"
gap={3}
Expand Down
66 changes: 66 additions & 0 deletions src/fragments/orders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,72 @@ export const fragmentOrderLine = gql`
}
`;

// Slim fragment for order line mutations - includes only data that changes
// when lines are added/updated/deleted (lines + pricing + shipping if no longer required)
export const fragmentOrderLinesUpdate = gql`
fragment OrderLinesUpdate on Order {
id
lines {
...OrderLine
}
subtotal {
gross {
...Money
}
net {
...Money
}
}
total {
gross {
...Money
}
net {
...Money
}
tax {
...Money
}
}
undiscountedTotal {
gross {
...Money
}
net {
...Money
}
}
# Shipping can change when lines are deleted/added
# (shippingMethod, shippingPrice, shippingMethodName are reset when isShippingRequired becomes false)
isShippingRequired
shippingMethod {
id
}
shippingPrice {
gross {
amount
currency
}
}
shippingMethodName
collectionPointName
# Available shipping methods can change based on order contents (weight, items)
shippingMethods {
id
name
price {
...Money
}
active
message
}
# Discounts shown in order summary
discounts {
...OrderDiscount
}
}
`;

export const fragmentOrderLineMetadata = gql`
fragment OrderLineMetadata on OrderLine {
metadata {
Expand Down
Loading
Loading