-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Conversation
🦋 Changeset detectedLatest commit: 7af9cb5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
playwright/pages/basePage.ts
Outdated
await this.page.locator('[class="clip-region"]').waitFor({ state: "attached" }); | ||
await this.page.locator('[class="clip-region"]').locator("textarea").fill(content); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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); | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | |
this.gridInput = this.page.locator('[class="clip-region"]').locator("textarea") | |
} |
playwright/pages/basePage.ts
Outdated
@@ -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}"]`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.gridCanvas = page.locator(`[data-testid="${DEFAULT_GRID_TEST_ID}"]`); | |
this.gridCanvas = page.locator(`[data-testid="data-grid-canvas"]`); |
playwright/pages/basePage.ts
Outdated
@@ -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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
readonly pageHeader: Locator; | |
readonly pageHeader: Locator; | |
readonly gridInput: Locator; |
playwright/pages/basePage.ts
Outdated
@@ -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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const DEFAULT_GRID_TEST_ID = "data-grid-canvas" |
* Fixture for grid * Fixture for grid * Fixture for grid
Screenshots
Pull Request Checklist
data-test-id
are added for new elementsTest 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.
CONTAINERS=2