-
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.
[TEST] [E2E] Adding e2e tests for attributes (#4728)
* adding e2e tests for attributes * correcting test case ids and adding extra assertion for attributes page
- Loading branch information
Showing
19 changed files
with
430 additions
and
53 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 | ||
--- | ||
|
||
Adding e2e tests for attributes |
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
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,18 @@ | ||
import type { Page } from "@playwright/test"; | ||
|
||
export class DeleteAttributeDialog { | ||
readonly page: Page; | ||
|
||
constructor( | ||
page: Page, | ||
readonly deleteButton = page.getByTestId("submit"), | ||
readonly cancelButton = page.getByTestId("back"), | ||
readonly deleteAttributesDialogText = page.getByTestId("delete-single-attr-dialog-text"), | ||
) { | ||
this.page = page; | ||
} | ||
|
||
async deleteAttribute() { | ||
await this.deleteButton.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import type { Page } from "@playwright/test"; | ||
|
||
export class DeleteAttributeValueDialog { | ||
readonly page: Page; | ||
|
||
constructor( | ||
page: Page, | ||
readonly deleteButton = page.getByTestId("submit"), | ||
readonly cancelButton = page.getByTestId("back"), | ||
readonly deleteAttributesDialogText = page.getByTestId("delete-attribute-value-dialog-text"), | ||
) { | ||
this.page = page; | ||
} | ||
|
||
async deleteAttributeValue() { | ||
await this.deleteButton.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import type { Page } from "@playwright/test"; | ||
|
||
export class DeleteAttributesInBulkDialog { | ||
readonly page: Page; | ||
|
||
constructor( | ||
page: Page, | ||
readonly deleteButton = page.getByTestId("submit"), | ||
readonly cancelButton = page.getByTestId("back"), | ||
readonly deleteAttributesDialogText = page.getByTestId("delete-attr-from-list-dialog-text"), | ||
) { | ||
this.page = page; | ||
} | ||
|
||
async deleteSelectedAttributes() { | ||
await this.deleteButton.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import type { Page } from "@playwright/test"; | ||
import faker from "faker"; | ||
|
||
|
||
export class EditAttributeValueDialog { | ||
readonly page: Page; | ||
|
||
constructor( | ||
page: Page, | ||
readonly saveButton = page.getByTestId("submit"), | ||
readonly cancelButton = page.getByTestId("back"), | ||
readonly valueInput = page.getByTestId("value-name").locator("input"), | ||
) { | ||
this.page = page; | ||
} | ||
|
||
async provideNewAttributeValue(newValue: string = faker.lorem.word(5)) { | ||
await this.valueInput.clear(); | ||
await this.valueInput.fill(newValue); | ||
} | ||
async saveNewAttributeValue() { | ||
await this.saveButton.click(); | ||
} | ||
} |
Oops, something went wrong.