-
-
Notifications
You must be signed in to change notification settings - Fork 0
OBPIH-7920 Putaway - add comment to putaway #95
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
base: main
Are you sure you want to change the base?
Changes from all commits
c19dff6
36ab8db
2d41d6c
637ae90
de73c41
7f57543
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| import { expect } from '@playwright/test'; | ||
|
|
||
| import BasePageModel from '@/pages/BasePageModel'; | ||
|
|
||
| class AddCommentToPutawayPage extends BasePageModel { | ||
| async isLoaded() { | ||
| await expect( | ||
| this.page.getByRole('heading', { name: 'Add Comment' }) | ||
| ).toBeVisible(); | ||
| } | ||
|
|
||
| get commentField() { | ||
| return this.page.locator('#comment'); | ||
| } | ||
|
|
||
| get saveButton() { | ||
| return this.page.getByRole('button', { name: 'Save' }); | ||
| } | ||
|
|
||
| get recipientDropdown() { | ||
| return this.page.locator('#recipient_id_chosen .chosen-single'); | ||
| } | ||
|
|
||
| get recipientOptions() { | ||
| return this.page.locator('#recipient_id_chosen .chosen-results li'); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. :( |
||
| } | ||
|
|
||
| async selectRecipient(name: string) { | ||
| await this.recipientDropdown.click(); | ||
|
|
||
| await this.recipientOptions.filter({ hasText: name }).click(); | ||
| } | ||
|
|
||
| get senderName() { | ||
| return this.page | ||
| .locator('tr.prop') | ||
| .filter({ hasText: 'From' }) | ||
| .locator('td.value'); | ||
| } | ||
| } | ||
|
|
||
| export default AddCommentToPutawayPage; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| import { expect, Locator, Page } from '@playwright/test'; | ||
|
|
||
| import BasePageModel from '@/pages/BasePageModel'; | ||
|
|
||
| class CommentsTable extends BasePageModel { | ||
| constructor(page: Page) { | ||
| super(page); | ||
| } | ||
|
|
||
| async isLoaded() { | ||
| await expect( | ||
| this.page.getByRole('heading').getByText('Comments') | ||
| ).toBeVisible(); | ||
| } | ||
|
|
||
| get table() { | ||
| return this.page.getByRole('table').filter({ | ||
| hasText: 'Comment', | ||
| }); | ||
| } | ||
|
|
||
| get rows() { | ||
| return this.table.getByRole('row'); | ||
| } | ||
|
|
||
| row(index: number) { | ||
| return new Row(this.page, this.rows.nth(index)); | ||
| } | ||
|
|
||
| getColumnHeader(columnName: string) { | ||
| return this.table.getByRole('row').getByText(columnName, { exact: true }); | ||
| } | ||
|
|
||
| async clickDeleteCommentButton(index: number) { | ||
| this.page.once('dialog', (dialog) => dialog.accept()); | ||
| await this.row(index).deleteButton.click(); | ||
| } | ||
|
|
||
| get emptyCommentTable() { | ||
| return this.page.locator('.fade.center.empty').getByText('No comments'); | ||
| } | ||
| } | ||
|
|
||
| class Row extends BasePageModel { | ||
| row: Locator; | ||
| constructor(page: Page, row: Locator) { | ||
| super(page); | ||
| this.row = row; | ||
| } | ||
|
|
||
| get commentContent() { | ||
| return this.row.getByRole('cell').nth(2); | ||
| } | ||
|
|
||
| get recipientContent() { | ||
| return this.row.getByRole('cell').nth(0); | ||
| } | ||
|
|
||
| get senderContent() { | ||
| return this.row.getByRole('cell').nth(1); | ||
| } | ||
|
Comment on lines
+51
to
+61
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not just |
||
|
|
||
| get editButton() { | ||
| return this.row.getByRole('link', { name: 'Edit', exact: true }); | ||
| } | ||
|
|
||
| get deleteButton() { | ||
| return this.row.getByRole('link', { name: 'Delete', exact: true }); | ||
| } | ||
| } | ||
|
|
||
| export default CommentsTable; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,6 +55,12 @@ class StartStep extends BasePageModel { | |
| async closeDisplayedError() { | ||
| return this.page.locator('.alert-close-icon').first().click(); | ||
| } | ||
|
|
||
| get orderNumberValue() { | ||
| return this.page.locator( | ||
| '[data-testid=\'wizardTitle\'] > div > span:nth-of-type(2)' | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. :(((((((((((((((((((( Can you make something like byDataTestId and then check if this container has a child? |
||
| ); | ||
| } | ||
| } | ||
|
|
||
| export default StartStep; | ||
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.
:(