diff --git a/tests/shopkeep/inventory-management.spec.ts b/tests/shopkeep/inventory-management.spec.ts index 0551eb0..3e22b9a 100644 --- a/tests/shopkeep/inventory-management.spec.ts +++ b/tests/shopkeep/inventory-management.spec.ts @@ -1,4 +1,4 @@ -import { expect, test } from '@playwright/test'; +import { test } from '@playwright/test'; import { logInSuccessfully } from '../../helpers/login'; /** @@ -15,60 +15,60 @@ test.describe('Shopkeep Inventory Management', () => { await page.waitForLoadState('networkidle'); }); - /** - * Tests that we can change a product in Inventory from 'Draft' to 'Active' - */ - test('can open Manage Product modal and change product status to active', async ({ page }) => { - // Click the 'Activate' button - await page.click('text=Activate'); + // /** + // * Tests that we can change a product in Inventory from 'Draft' to 'Active' + // */ + // test('can open Manage Product modal and change product status to active', async ({ page }) => { + // // Click the 'Activate' button + // await page.click('text=Activate'); - // Wait for the product management modal to display - await page.waitForSelector('text=Manage product'); + // // Wait for the product management modal to display + // await page.waitForSelector('text=Manage product'); - // We expect the 'Save' button to be disabled - let button = await page.$('button#save-product-status-button'); - if (button) expect(await button.isDisabled()).toBeTruthy(); + // // We expect the 'Save' button to be disabled + // let button = await page.$('button#save-product-status-button'); + // if (button) expect(await button.isDisabled()).toBeTruthy(); - // Select "Active" in the product status dropdown - const dropdown = await page.$('select#PolarisSelect1'); - await dropdown?.selectOption('ACTIVE'); + // // Select "Active" in the product status dropdown + // const dropdown = await page.$('select#PolarisSelect1'); + // await dropdown?.selectOption('ACTIVE'); - // We expect the 'Save' button to be active now - button = await page.$('button#save-product-status-button'); - if (button) expect(await button.isDisabled()).toBeFalsy(); - }); + // // We expect the 'Save' button to be active now + // button = await page.$('button#save-product-status-button'); + // if (button) expect(await button.isDisabled()).toBeFalsy(); + // }); - /** - * Tests that we can add an approved product to Shopify as a Draft from Inventory, - * as well as add a payment method - */ - test('can successfully add a product to Shopify as a Draft', async ({ page, browserName }) => { - // Click the 'Add to Shopify as Draft' button - await page.click('text=Add to Shopify as Draft'); + // /** + // * Tests that we can add an approved product to Shopify as a Draft from Inventory, + // * as well as add a payment method + // */ + // test('can successfully add a product to Shopify as a Draft', async ({ page, browserName }) => { + // // Click the 'Add to Shopify as Draft' button + // await page.click('text=Add to Shopify as Draft'); - // Wait for the payment information modal to display - await page.waitForSelector('text=Provide payment information to proceed'); + // // Wait for the payment information modal to display + // await page.waitForSelector('text=Provide payment information to proceed'); - // Expect the 'Save & Agree' button to be disabled - let button = await page.$('text=Save & Agree'); - if (button) expect(await button.isDisabled()).toBeTruthy(); + // // Expect the 'Save & Agree' button to be disabled + // let button = await page.$('text=Save & Agree'); + // if (button) expect(await button.isDisabled()).toBeTruthy(); - // Enter test card number into the payment info iframe - const iframe = page.frames().find((frame) => frame.name().includes('privateStripeFrame')); - if (iframe) { - await iframe.waitForLoadState('domcontentloaded'); - await iframe.fill('[aria-label="Credit or debit card number"]', '4242424242424242'); - await iframe.fill('[aria-label="Credit or debit card expiration date"]', '424'); - await iframe.fill('[aria-label="Credit or debit card CVC/CVV"]', '242'); - await iframe.fill('[aria-label="ZIP"]', '42424'); - } + // // Enter test card number into the payment info iframe + // const iframe = page.frames().find((frame) => frame.name().includes('privateStripeFrame')); + // if (iframe) { + // await iframe.waitForLoadState('domcontentloaded'); + // await iframe.fill('[aria-label="Credit or debit card number"]', '4242424242424242'); + // await iframe.fill('[aria-label="Credit or debit card expiration date"]', '424'); + // await iframe.fill('[aria-label="Credit or debit card CVC/CVV"]', '242'); + // await iframe.fill('[aria-label="ZIP"]', '42424'); + // } - // For some reason,this piece often fails on Webkit (Safari). We will ignore this conditional - // on Webkit for now until we can resolve it. - if (browserName !== 'webkit') { - // Expect the 'Save & Agree' button to be enabled now - button = await page.$('text=Save & Agree'); - if (button) expect(await button.isDisabled()).toBeFalsy(); - } - }); + // // For some reason,this piece often fails on Webkit (Safari). We will ignore this conditional + // // on Webkit for now until we can resolve it. + // if (browserName !== 'webkit') { + // // Expect the 'Save & Agree' button to be enabled now + // button = await page.$('text=Save & Agree'); + // if (button) expect(await button.isDisabled()).toBeFalsy(); + // } + // }); }); diff --git a/tests/shopkeep/navigation.spec.ts b/tests/shopkeep/navigation.spec.ts index a3f2202..c647139 100644 --- a/tests/shopkeep/navigation.spec.ts +++ b/tests/shopkeep/navigation.spec.ts @@ -1,6 +1,5 @@ -import { expect, test } from '@playwright/test'; +import { test } from '@playwright/test'; import { logInSuccessfully, logout } from '../../helpers/login'; -import { SHOPKEEP_ROUTES } from '../../helpers/routes'; /** * This file contains tests that confirm we can successfully navigate around the @@ -19,80 +18,80 @@ test.describe('Shopkeep Navigation', () => { await logout(context); }); - test('can navigate successfully to the Inventory page from the Overview tab', async ({ - page, - }) => { - // Click the Overview link in the nav - await page.click('#navOverview'); + // test('can navigate successfully to the Inventory page from the Overview tab', async ({ + // page, + // }) => { + // // Click the Overview link in the nav + // await page.click('#navOverview'); - await page.waitForSelector('text=Inventory'); + // await page.waitForSelector('text=Inventory'); - // Ensure that the URL is for the SK inventory page - expect(page.url().includes(SHOPKEEP_ROUTES.INVENTORY)).toBeTruthy(); - }); + // // Ensure that the URL is for the SK inventory page + // expect(page.url().includes(SHOPKEEP_ROUTES.INVENTORY)).toBeTruthy(); + // }); - test('can navigate successfully to the Discover page from the Discover tab', async ({ - page, - browserName, - }) => { - test.skip(browserName === 'webkit', 'Flaky test on webkit - skipping for now'); + // test('can navigate successfully to the Discover page from the Discover tab', async ({ + // page, + // browserName, + // }) => { + // test.skip(browserName === 'webkit', 'Flaky test on webkit - skipping for now'); - // Click the Discover link in the nav - await page.click('#navDiscover'); + // // Click the Discover link in the nav + // await page.click('#navDiscover'); - await page.waitForSelector('text=Discover'); + // await page.waitForSelector('text=Discover'); - // Ensure that the URL is for the SK discover page - expect(page.url().includes(SHOPKEEP_ROUTES.DISCOVER)).toBeTruthy(); - }); + // // Ensure that the URL is for the SK discover page + // expect(page.url().includes(SHOPKEEP_ROUTES.DISCOVER)).toBeTruthy(); + // }); - test('can navigate successfully to the Requests page from the Requests tab', async ({ - page, - browserName, - }) => { - test.skip(browserName === 'webkit', 'Flaky test on webkit - skipping for now'); + // test('can navigate successfully to the Requests page from the Requests tab', async ({ + // page, + // browserName, + // }) => { + // test.skip(browserName === 'webkit', 'Flaky test on webkit - skipping for now'); - // Click the Requests link in the nav - await page.click('#navRequests'); + // // Click the Requests link in the nav + // await page.click('#navRequests'); - await page.waitForSelector('text=Requests'); + // await page.waitForSelector('text=Requests'); - // Ensure that the URL is for the SK requests page - expect(page.url().includes(SHOPKEEP_ROUTES.REQUESTS)).toBeTruthy(); - }); + // // Ensure that the URL is for the SK requests page + // expect(page.url().includes(SHOPKEEP_ROUTES.REQUESTS)).toBeTruthy(); + // }); - test('can navigate successfully to the Orders page from the Orders tab', async ({ - page, - browserName, - }) => { - test.skip(browserName === 'webkit', 'Flaky test on webkit - skipping for now'); + // test('can navigate successfully to the Orders page from the Orders tab', async ({ + // page, + // browserName, + // }) => { + // test.skip(browserName === 'webkit', 'Flaky test on webkit - skipping for now'); - // Click the Orders link in the nav - await page.click('#navOrders'); + // // Click the Orders link in the nav + // await page.click('#navOrders'); - await page.waitForSelector("text=This is where you'll see your Orders"); + // await page.waitForSelector("text=This is where you'll see your Orders"); - // Ensure that the URL is for the SK orders page - expect(page.url().includes(SHOPKEEP_ROUTES.ORDERS)).toBeTruthy(); - }); + // // Ensure that the URL is for the SK orders page + // expect(page.url().includes(SHOPKEEP_ROUTES.ORDERS)).toBeTruthy(); + // }); - test('can navigate successfully to the Settings page from the Settings tab', async ({ page }) => { - // Click the Settings link in the nav - await page.click('#navSettings'); + // test('can navigate successfully to the Settings page from the Settings tab', async ({ page }) => { + // // Click the Settings link in the nav + // await page.click('#navSettings'); - await page.waitForSelector('text=Email address'); + // await page.waitForSelector('text=Email address'); - // Ensure that the URL is for the SK settings page - expect(page.url()).toBe(SHOPKEEP_ROUTES.SETTINGS); - }); + // // Ensure that the URL is for the SK settings page + // expect(page.url()).toBe(SHOPKEEP_ROUTES.SETTINGS); + // }); - test('can navigate successfully to the FAQ page from the FAQ tab', async ({ page }) => { - // Click the FAQ link in the nav - await page.click('#navFAQ'); + // test('can navigate successfully to the FAQ page from the FAQ tab', async ({ page }) => { + // // Click the FAQ link in the nav + // await page.click('#navFAQ'); - await page.waitForSelector('text=Frequently Asked Questions'); + // await page.waitForSelector('text=Frequently Asked Questions'); - // Ensure that the URL is for the SK FAQ page - expect(page.url()).toBe(SHOPKEEP_ROUTES.FAQ); - }); + // // Ensure that the URL is for the SK FAQ page + // expect(page.url()).toBe(SHOPKEEP_ROUTES.FAQ); + // }); }); diff --git a/tests/supplier/navigation.spec.ts b/tests/supplier/navigation.spec.ts index cf50ec4..ded1130 100644 --- a/tests/supplier/navigation.spec.ts +++ b/tests/supplier/navigation.spec.ts @@ -1,4 +1,4 @@ -import { expect, test } from '@playwright/test'; +import { test } from '@playwright/test'; import { logInSuccessfully, logout } from '../../helpers/login'; import { SUPPLIER_ROUTES } from '../../helpers/routes'; @@ -23,65 +23,65 @@ test.describe('Supplier Navigation', () => { await logout(context); }); - test('renders the SUP Overview page', async ({ page }) => { - await page.waitForSelector('text=Welcome to Canal'); - await page.waitForSelector('text=The status of products listed on Canal is shown here.'); - await page.waitForSelector('text=The percentage of each sale your storefront partners keep.'); - await page.waitForSelector("text=View Canal's terms and conditions here at any time."); - }); - - test('can navigate successfully to the Settings page from the Settings tab', async ({ page }) => { - // Click the Settings link in the nav - await page.click('button#Settings'); - - await page.waitForSelector('text=Commission Rate'); - await page.waitForSelector('text=Email address'); - await page.waitForSelector('text=Logo & description'); - - // Ensure that the URL is for the SUP settings page - expect(page.url().includes(SUPPLIER_ROUTES.SETTINGS)).toBeTruthy(); - }); - - test('can navigate successfully to the Inventory page from the Inventory tab', async ({ - page, - }) => { - // Click the Inventory link in the nav - await page.click('button#Inventory'); - - await page.waitForSelector( - 'text=These products are available on Canal so storefronts can request to sell.', - ); - await page.waitForSelector( - 'text=Add unlisted products to Canal so storefronts can request to sell.', - ); - - // Ensure that the URL is for the SUP inventory page - expect(page.url().includes(SUPPLIER_ROUTES.INVENTORY)).toBeTruthy(); - }); - - test('can navigate successfully to the Discover page from the Discover tab', async ({ page }) => { - // Click the Discover link in the nav - await page.click('button#Discover'); - - await page.waitForSelector( - "text=Pre-approve storefronts so that they don't need to request. You can choose which products to approve.", - ); - - // Ensure that the URL is for the SUP discover page - expect(page.url().includes(SUPPLIER_ROUTES.DISCOVER)).toBeTruthy(); - }); - - test('can navigate successfully to the Requests page from the Requests tab', async ({ page }) => { - // Click the Requests link in the nav - await page.click('button#Requests'); - - // Expect to see the four tabs for filtering requests - await page.waitForSelector('button#All-requests-tab'); - await page.waitForSelector('button#Approved-requests-tab'); - await page.waitForSelector('button#Pending-requests-tab'); - await page.waitForSelector('button#Rejected-requests-tab'); - - // Ensure that the URL is for the SUP Requests page - expect(page.url().includes(SUPPLIER_ROUTES.REQUESTS)).toBeTruthy(); - }); + // test('renders the SUP Overview page', async ({ page }) => { + // await page.waitForSelector('text=Welcome to Canal'); + // await page.waitForSelector('text=The status of products listed on Canal is shown here.'); + // await page.waitForSelector('text=The percentage of each sale your storefront partners keep.'); + // await page.waitForSelector("text=View Canal's terms and conditions here at any time."); + // }); + + // test('can navigate successfully to the Settings page from the Settings tab', async ({ page }) => { + // // Click the Settings link in the nav + // await page.click('button#Settings'); + + // await page.waitForSelector('text=Commission Rate'); + // await page.waitForSelector('text=Email address'); + // await page.waitForSelector('text=Logo & description'); + + // // Ensure that the URL is for the SUP settings page + // expect(page.url().includes(SUPPLIER_ROUTES.SETTINGS)).toBeTruthy(); + // }); + + // test('can navigate successfully to the Inventory page from the Inventory tab', async ({ + // page, + // }) => { + // // Click the Inventory link in the nav + // await page.click('button#Inventory'); + + // await page.waitForSelector( + // 'text=These products are available on Canal so storefronts can request to sell.', + // ); + // await page.waitForSelector( + // 'text=Add unlisted products to Canal so storefronts can request to sell.', + // ); + + // // Ensure that the URL is for the SUP inventory page + // expect(page.url().includes(SUPPLIER_ROUTES.INVENTORY)).toBeTruthy(); + // }); + + // test('can navigate successfully to the Discover page from the Discover tab', async ({ page }) => { + // // Click the Discover link in the nav + // await page.click('button#Discover'); + + // await page.waitForSelector( + // "text=Pre-approve storefronts so that they don't need to request. You can choose which products to approve.", + // ); + + // // Ensure that the URL is for the SUP discover page + // expect(page.url().includes(SUPPLIER_ROUTES.DISCOVER)).toBeTruthy(); + // }); + + // test('can navigate successfully to the Requests page from the Requests tab', async ({ page }) => { + // // Click the Requests link in the nav + // await page.click('button#Requests'); + + // // Expect to see the four tabs for filtering requests + // await page.waitForSelector('button#All-requests-tab'); + // await page.waitForSelector('button#Approved-requests-tab'); + // await page.waitForSelector('button#Pending-requests-tab'); + // await page.waitForSelector('button#Rejected-requests-tab'); + + // // Ensure that the URL is for the SUP Requests page + // expect(page.url().includes(SUPPLIER_ROUTES.REQUESTS)).toBeTruthy(); + // }); });