-
-
Notifications
You must be signed in to change notification settings - Fork 0
OBPIH-7963 Cycle Count - item with negative inventory #102
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
4048b61
42e6467
f0f9106
a5defee
ec8f4d2
ed1c776
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 |
|---|---|---|
|
|
@@ -8,17 +8,23 @@ import ToCountTable from '@/pages/manageCycleCount/components/ToCountTable'; | |
| class ManageCycleCountPage extends BasePageModel { | ||
| allProductsTable: AllProductsTable; | ||
| toCountTable: ToCountTable; | ||
| toResolveTable: ToCountTable; | ||
|
|
||
| constructor(page: Page) { | ||
| super(page); | ||
| this.allProductsTable = new AllProductsTable(page); | ||
| this.toCountTable = new ToCountTable(page); | ||
| this.toResolveTable = new ToCountTable(page); | ||
| } | ||
|
|
||
| async goToPage() { | ||
| await this.page.goto(CYCLE_COUNT_URL.base); | ||
| } | ||
|
|
||
| async goToPerformCycleCount() { | ||
| await this.page.goto(`${CYCLE_COUNT_URL.base}?tab=TO_COUNT`); | ||
| } | ||
|
|
||
| async isLoaded() { | ||
| await expect(this.allProductsTab).toBeVisible(); | ||
| } | ||
|
|
@@ -64,10 +70,30 @@ class ManageCycleCountPage extends BasePageModel { | |
| } | ||
|
|
||
| async searchProduct(productName: string) { | ||
| await this.searchInput.fill(productName); | ||
| await this.searchInput.click(); | ||
| await this.page.keyboard.press('ControlOrMeta+A'); | ||
|
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. add a comment about the 'ControlOrMeta+A' |
||
| await this.searchInput.pressSequentially(productName, { delay: 20 }); | ||
| await expect(this.searchInput).toHaveValue(productName); | ||
| await this.filterButton.click(); | ||
| } | ||
|
|
||
| get negativeQuantityFilterGroup() { | ||
| return this.page.locator('.filter-group', { | ||
| has: this.page.locator('label[for="negativeQuantity"]'), | ||
| }); | ||
| } | ||
|
|
||
| get negativeQuantityCheckbox() { | ||
| return this.negativeQuantityFilterGroup.getByRole('checkbox'); | ||
| } | ||
|
|
||
| async openNegativeQuantityTooltip() { | ||
| const trigger = this.negativeQuantityFilterGroup.locator('[data-tooltipped]'); | ||
| await trigger.hover(); | ||
| const describedBy = await trigger.getAttribute('aria-describedby'); | ||
| return this.page.locator(`#${describedBy}`); | ||
| } | ||
|
|
||
|
Comment on lines
+80
to
+96
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 explain what's going on with the |
||
| // ACTIONS | ||
| get markAsToCountButton() { | ||
| return this.page.getByRole('button', { name: 'Mark as To Count' }); | ||
|
|
@@ -76,6 +102,10 @@ class ManageCycleCountPage extends BasePageModel { | |
| get startCountButton() { | ||
| return this.page.getByRole('button', { name: 'Start Count' }); | ||
| } | ||
|
|
||
| get startResolutionButton() { | ||
| return this.page.getByRole('button', { name: 'Start resolution' }); | ||
| } | ||
| } | ||
|
|
||
| export default ManageCycleCountPage; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,10 @@ class RecountStepTable extends BasePageModel { | |
| row(index: number) { | ||
| return new Row(this.page, this.rows.nth(index)); | ||
| } | ||
|
|
||
| rowByBinLocation(binLocationName: string) { | ||
| return new Row(this.page, this.rows.filter({ hasText: binLocationName }).first()); | ||
|
Comment on lines
+18
to
+19
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. I think we should have |
||
| } | ||
| } | ||
|
|
||
| class Row extends BasePageModel { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| Product code,Product,Lot number,Expiration date,Bin location,Quantity,Comment | ||
| 7,CC-product-one,,,CC-BIN-1,100, | ||
| 9,CC-product-three,,,CC-BIN-2,10, |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,6 +46,8 @@ test.describe('Perform cycle count for item', () => { | |
| confirmToRecountStepPage, | ||
| productShowPage, | ||
| }) => { | ||
| test.setTimeout(120_000); | ||
|
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. Add a comment about what is taking so long to execute |
||
|
|
||
| const USER = await mainUserService.getUser(); | ||
|
|
||
| await test.step('Assert content of inventory menu', async () => { | ||
|
|
@@ -69,8 +71,13 @@ test.describe('Perform cycle count for item', () => { | |
|
|
||
| await test.step('Search for product on All Products tab', async () => { | ||
| await manageCycleCountPage.openAllProductsTab(); | ||
| await manageCycleCountPage.searchProduct(productName); | ||
| await expect(manageCycleCountPage.allProductsTable.rows).toHaveCount(1); | ||
|
|
||
| await expect(async () => { | ||
| await manageCycleCountPage.searchProduct(productName); | ||
| await expect(manageCycleCountPage.allProductsTable.rows).toHaveCount( | ||
| 1 | ||
| ); | ||
| }).toPass({ timeout: 30_000, intervals: [2000, 3000, 5000] }); | ||
| }); | ||
|
|
||
| await test.step('Assert Last Counted date on All Products tab matches stock card', async () => { | ||
|
|
||
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.
That URL with the tab should be placed in the URL files