-
-
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
c19dff6
fix typo in buttons name
kkrawczyk123 36ab8db
update fixtures with new pages
kkrawczyk123 2d41d6c
add new pages and elements
kkrawczyk123 637ae90
add comments to putaway test
kkrawczyk123 de73c41
improve wait for loading tab
kkrawczyk123 7f57543
improve navigation on rows on putaway list
kkrawczyk123 3c8e0f8
improvements after review
kkrawczyk123 aedfaaf
improve flaky receiving tests
kkrawczyk123 5380ae8
improve data cleanups in putaway tests
kkrawczyk123 bc5fef1
add improvements to receiving tests
kkrawczyk123 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
42 changes: 42 additions & 0 deletions
42
src/pages/putaway/putawayDetails/AddCommentToPutawayPage.ts
This file contains hidden or 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,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'); | ||
|
kkrawczyk123 marked this conversation as resolved.
kkrawczyk123 marked this conversation as resolved.
|
||
| } | ||
|
|
||
| get recipientOptions() { | ||
| return this.page.locator('#recipient_id_chosen .chosen-results li'); | ||
|
kkrawczyk123 marked this conversation as resolved.
kkrawczyk123 marked this conversation as resolved.
|
||
| } | ||
|
|
||
| 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; | ||
This file contains hidden or 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
72 changes: 72 additions & 0 deletions
72
src/pages/putaway/putawayDetails/components/CommentsTable.ts
This file contains hidden or 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,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'); | ||
|
kkrawczyk123 marked this conversation as resolved.
|
||
| } | ||
| } | ||
|
|
||
| class Row extends BasePageModel { | ||
| row: Locator; | ||
| constructor(page: Page, row: Locator) { | ||
| super(page); | ||
| this.row = row; | ||
| } | ||
|
|
||
| get comment() { | ||
| return this.row.getByRole('cell').nth(2); | ||
| } | ||
|
|
||
| get recipient() { | ||
| return this.row.getByRole('cell').nth(0); | ||
| } | ||
|
|
||
| get sender() { | ||
| return this.row.getByRole('cell').nth(1); | ||
| } | ||
|
|
||
| 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; | ||
This file contains hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.