Skip to content
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

Playwright fixture for handling grid events #4502

Merged
merged 3 commits into from
Nov 30, 2023
Merged

Conversation

andrzejewsky
Copy link
Member

Screenshots

Pull Request Checklist

  1. This code contains UI changes
  2. All visible strings are translated with proper context including data-formatting
  3. Attributes data-test-id are added for new elements
  4. The changes are tested in Chrome/Firefox/Safari browsers and in light/dark mode
  5. Your code works with the latest stable version of the core
  6. I added changesets file (instructions in contribution guide

Test environment config

API_URI=https://automation-dashboard.staging.saleor.cloud/graphql/
APPS_MARKETPLACE_API_URI=https://apps.staging.saleor.io/api/v2/saleor-apps

Do you want to run more stable tests?

To run all tests, just select the stable checkbox. To speed up tests, increase the number of containers. Tests will be re-run only when the "run e2e" label is added.

  1. stable
  2. app
  3. attribute
  4. category
  5. collection
  6. customer
  7. giftCard
  8. homePage
  9. login
  10. menuNavigation
  11. navigation
  12. orders
  13. pages
  14. payments
  15. permissions
  16. plugins
  17. productType
  18. products
  19. sales
  20. shipping
  21. translations
  22. variants
  23. vouchers

CONTAINERS=2

@andrzejewsky andrzejewsky requested review from a team, poulch and Droniu November 29, 2023 14:54
Copy link

changeset-bot bot commented Nov 29, 2023

🦋 Changeset detected

Latest commit: 7af9cb5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
saleor-dashboard Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot temporarily deployed to pr-grid-fixture-pw November 29, 2023 14:55 Destroyed
@github-actions github-actions bot temporarily deployed to storybook pr-grid-fixture-pw November 29, 2023 14:55 Destroyed
poulch
poulch previously approved these changes Nov 29, 2023
Comment on lines 109 to 110
await this.page.locator('[class="clip-region"]').waitFor({ state: "attached" });
await this.page.locator('[class="clip-region"]').locator("textarea").fill(content);
Copy link
Member

@wojteknowacki wojteknowacki Nov 29, 2023

Choose a reason for hiding this comment

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

Suggested change
await this.page.locator('[class="clip-region"]').waitFor({ state: "attached" });
await this.page.locator('[class="clip-region"]').locator("textarea").fill(content);
await this.page.locator(this.gridInput).waitFor({ state: "attached" });
await this.page.locator(this.gridInput).fill(content);

@@ -13,7 +15,7 @@ export class BasePage {
constructor(page: Page) {
this.page = page;
this.pageHeader = page.getByTestId("page-header");
this.gridCanvas = page.locator('[data-testid="data-grid-canvas"]');
this.gridCanvas = page.locator(`[data-testid="${DEFAULT_GRID_TEST_ID}"]`);
this.successBanner = page.locator(LOCATORS.successBanner);
this.errorBanner = page.locator(LOCATORS.errorBanner);
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
}
this.gridInput = this.page.locator('[class="clip-region"]').locator("textarea")
}

@@ -13,7 +15,7 @@ export class BasePage {
constructor(page: Page) {
this.page = page;
this.pageHeader = page.getByTestId("page-header");
this.gridCanvas = page.locator('[data-testid="data-grid-canvas"]');
this.gridCanvas = page.locator(`[data-testid="${DEFAULT_GRID_TEST_ID}"]`);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
this.gridCanvas = page.locator(`[data-testid="${DEFAULT_GRID_TEST_ID}"]`);
this.gridCanvas = page.locator(`[data-testid="data-grid-canvas"]`);

@@ -3,6 +3,8 @@ import { URL_LIST } from "@data/url";
import type { Locator, Page } from "@playwright/test";
import { expect } from "@playwright/test";

const DEFAULT_GRID_TEST_ID = "data-grid-canvas"

export class BasePage {
readonly page: Page;
readonly pageHeader: Locator;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
readonly pageHeader: Locator;
readonly pageHeader: Locator;
readonly gridInput: Locator;

@@ -3,6 +3,8 @@ import { URL_LIST } from "@data/url";
import type { Locator, Page } from "@playwright/test";
import { expect } from "@playwright/test";

const DEFAULT_GRID_TEST_ID = "data-grid-canvas"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const DEFAULT_GRID_TEST_ID = "data-grid-canvas"

@andrzejewsky andrzejewsky merged commit 0314e1d into main Nov 30, 2023
15 of 17 checks passed
@andrzejewsky andrzejewsky deleted the grid-fixture-pw branch November 30, 2023 10:30
poulch pushed a commit that referenced this pull request Dec 19, 2023
* Fixture for grid

* Fixture for grid

* Fixture for grid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

3 participants