Merge pull request #98 from beatz174-bit/codex/add-test-case-for-quantity-controls
Add e2e test for pick list quantity controls
This commit is contained in:
@@ -109,6 +109,7 @@ test.describe('Active pick list', () => {
|
|||||||
await expect(page.getByText('Playwright Cola Zero')).toBeVisible();
|
await expect(page.getByText('Playwright Cola Zero')).toBeVisible();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('adjusts item quantities with increment and decrement controls', async ({ page }) => {
|
||||||
test('toggles picked visibility and disables the filter when all items are picked', async ({ page }) => {
|
test('toggles picked visibility and disables the filter when all items are picked', async ({ page }) => {
|
||||||
await page.goto('/');
|
await page.goto('/');
|
||||||
|
|
||||||
@@ -179,6 +180,24 @@ test.describe('Active pick list', () => {
|
|||||||
.first()
|
.first()
|
||||||
.click();
|
.click();
|
||||||
|
|
||||||
|
const quantityLabel = page.getByText('Qty: 1 Unit');
|
||||||
|
await expect(quantityLabel).toBeVisible();
|
||||||
|
|
||||||
|
await page.getByRole('button', { name: 'Increase quantity' }).click();
|
||||||
|
await expect(page.getByText('Qty: 2 Unit')).toBeVisible();
|
||||||
|
|
||||||
|
await page.reload();
|
||||||
|
await expect(page.getByText('Qty: 2 Unit')).toBeVisible();
|
||||||
|
|
||||||
|
const decrementButton = page.getByRole('button', { name: 'Decrease quantity' });
|
||||||
|
await decrementButton.click();
|
||||||
|
await decrementButton.click();
|
||||||
|
await decrementButton.click();
|
||||||
|
|
||||||
|
await expect(page.getByText('Qty: 1 Unit')).toBeVisible();
|
||||||
|
|
||||||
|
await page.reload();
|
||||||
|
await expect(page.getByText('Qty: 1 Unit')).toBeVisible();
|
||||||
const showPickedToggle = page.getByLabel('Show picked');
|
const showPickedToggle = page.getByLabel('Show picked');
|
||||||
const itemToggles = page.getByRole('checkbox', { name: 'Toggle picked status' });
|
const itemToggles = page.getByRole('checkbox', { name: 'Toggle picked status' });
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user