Skip to content

Commit

Permalink
Update e2e for new homepage (#5284)
Browse files Browse the repository at this point in the history
* update e2e for new homepage

* enable new home page

---------

Co-authored-by: Paweł Chyła <[email protected]>
  • Loading branch information
Cloud11PL and poulch committed Nov 29, 2024
1 parent 6990b1e commit e947997
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 31 deletions.
5 changes: 5 additions & 0 deletions .changeset/long-colts-shout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": patch
---

E2E tests are now updated for new home page meaing that they don't fail when new home page is enabled.
52 changes: 26 additions & 26 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"@graphql-codegen/typescript-apollo-client-helpers": "^2.1.10",
"@graphql-codegen/typescript-operations": "^2.2.4",
"@graphql-codegen/typescript-react-apollo": "^3.2.5",
"@playwright/test": "^1.40.0",
"@playwright/test": "^1.47.0",
"@saleor/app-sdk": "0.47.2",
"@sentry/cli": "^2.33.0",
"@swc/jest": "^0.2.26",
Expand Down
2 changes: 0 additions & 2 deletions playwright/pages/homePage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export class HomePage {
readonly sales = page.getByTestId("sales-analytics"),
readonly orders = page.getByTestId("orders-analytics"),
readonly activity = page.getByTestId("activity-card"),
readonly topProducts = page.getByTestId("top-products"),
readonly ordersReadyToFulfill = page.getByTestId("orders-to-fulfill"),
readonly paymentsWaitingForCapture = page.getByTestId("orders-to-capture"),
readonly productsOutOfStock = page.getByTestId("out-of-stock-analytics"),
Expand All @@ -35,7 +34,6 @@ export class HomePage {
async expectHomePageElementsToBeVisible() {
await expect(this.sales).toBeVisible();
await expect(this.activity).toBeVisible();
await expect(this.topProducts).toBeVisible();
await expect(this.productsOutOfStock).toBeVisible();
}
}
3 changes: 2 additions & 1 deletion playwright/pages/loginPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ export class LoginPage {
await this.typeEmail(userEmail);
await this.typePassword(userPassword);
await this.clickSignInButton();
await expect(this.homePage.welcomeMessage).toContainText("Hello there,", {
// This check shouldn't be tied to user's email or first/last name
await expect(this.homePage.welcomeMessage).toContainText("welcome to your Store Dashboard", {
timeout: 15000,
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/welcomePage/WelcomePageTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const WelcomePageTitle = () => {
const userName = getUserName(user, true);

return (
<Text as="h1" size={9}>
<Text as="h1" size={9} data-test-id="home-header">
<FormattedMessage
defaultMessage="Hello {userName}, welcome to your Store Dashboard"
id="0+zatS"
Expand Down

0 comments on commit e947997

Please sign in to comment.