-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migrated create products tests to Playwright (#4273)
- Loading branch information
1 parent
8957582
commit e71633a
Showing
12 changed files
with
126 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"saleor-dashboard": minor | ||
--- | ||
|
||
migrated create products tests to Playwright |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export const PRODUCTS = { | ||
singleProductType: { | ||
id: "UHJvZHVjdFR5cGU6Njcy", | ||
name: "Single product type", | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { URL_LIST } from "@data/url"; | ||
import type { Locator, Page } from "@playwright/test"; | ||
import { expect } from "@playwright/test"; | ||
|
||
export class BasePage { | ||
public page: Page; | ||
public pageHeader: Locator; | ||
|
||
constructor(page: Page) { | ||
this.page = page; | ||
this.pageHeader = page.getByTestId("page-header"); | ||
} | ||
async gotoCreateProductPage(productTypeId: string) { | ||
await this.page.goto( | ||
`${URL_LIST.products}${URL_LIST.productsAdd}${productTypeId}`, | ||
); | ||
await expect(this.pageHeader).toBeVisible({ timeout: 10000 }); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import type { Locator, Page } from "@playwright/test"; | ||
|
||
export class ChannelSelectDialog { | ||
readonly page: Page; | ||
readonly allChannelsCheckbox: Locator; | ||
readonly displayedChannels: Locator; | ||
readonly confirmButton: Locator; | ||
readonly displayedChannelsCheckboxes: Locator; | ||
|
||
constructor(page: Page) { | ||
this.page = page; | ||
this.allChannelsCheckbox = page.locator("[name='allChannels']"); | ||
this.displayedChannels = page.getByTestId("channel-row"); | ||
this.displayedChannelsCheckboxes = page.locator("[type=checkbox]"); | ||
this.confirmButton = page.getByTestId("submit"); | ||
} | ||
|
||
async clickAllChannelsCheckbox() { | ||
await this.allChannelsCheckbox.click(); | ||
} | ||
async selectFirstChannel() { | ||
await this.displayedChannels | ||
.first() | ||
.locator(this.displayedChannelsCheckboxes) | ||
.click(); | ||
} | ||
async clickConfirmButton() { | ||
await this.confirmButton.first().click(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters