add Supplier Pricing test

This commit is contained in:
Matthias Mair 2024-04-18 00:38:49 +02:00
parent f08e0898e3
commit 2be83e14cc
No known key found for this signature in database
GPG Key ID: A593429DDA23B66A

View File

@ -3,7 +3,7 @@ import { test } from '@playwright/test';
import { baseUrl } from '../defaults';
import { doQuickLogin } from '../login';
test('PUI - Pages - Part - Pricing', async ({ page }) => {
test('PUI - Pages - Part - Pricing (Nothing, BOM)', async ({ page }) => {
await doQuickLogin(page);
// Part with no history
@ -12,7 +12,6 @@ test('PUI - Pages - Part - Pricing', async ({ page }) => {
await page.getByRole('tab', { name: 'Part Pricing' }).click();
await page.getByLabel('Part Pricing').getByText('Part Pricing').waitFor();
await page.getByRole('button', { name: 'Pricing Overview' }).waitFor();
await page.getByRole('button', { name: 'Pricing Overview' }).waitFor();
await page.getByText('Last Updated').waitFor();
await page.getByRole('button', { name: 'Purchase History' }).isDisabled();
await page.getByRole('button', { name: 'Internal Pricing' }).isDisabled();
@ -24,7 +23,6 @@ test('PUI - Pages - Part - Pricing', async ({ page }) => {
await page.getByRole('tab', { name: 'Part Pricing' }).click();
await page.getByLabel('Part Pricing').getByText('Part Pricing').waitFor();
await page.getByRole('button', { name: 'Pricing Overview' }).waitFor();
await page.getByRole('button', { name: 'Pricing Overview' }).waitFor();
await page.getByText('Last Updated').waitFor();
await page.getByRole('button', { name: 'Internal Pricing' }).isDisabled();
await page.getByRole('button', { name: 'Sale History' }).isDisabled();
@ -53,3 +51,29 @@ test('PUI - Pages - Part - Pricing', async ({ page }) => {
await page.getByText('Wood Screw').click();
await page.waitForURL('**/part/98/pricing');
});
test('PUI - Pages - Part - Pricing (Supplier)', async ({ page }) => {
await doQuickLogin(page);
// Part
await page.goto(`${baseUrl}/part/55/pricing`);
await page.getByText('Part: C_100nF_0603').waitFor();
await page.getByRole('tab', { name: 'Part Pricing' }).click();
await page.getByLabel('Part Pricing').getByText('Part Pricing').waitFor();
await page.getByRole('button', { name: 'Pricing Overview' }).waitFor();
await page.getByText('Last Updated').waitFor();
await page.getByRole('button', { name: 'Purchase History' }).isEnabled();
await page.getByRole('button', { name: 'Internal Pricing' }).isDisabled();
await page.getByRole('button', { name: 'Supplier Pricing' }).isEnabled();
// Supplier Pricing
await page.getByRole('button', { name: 'Supplier Pricing' }).click();
await page.waitForTimeout(500);
await page.getByRole('button', { name: 'SKU Not sorted' }).waitFor();
// Supplier Pricing - linkjumping
let target = page.getByText('ARR-26041-LPC').first();
await target.waitFor();
await target.click();
await page.waitForURL('**/purchasing/supplier-part/697/');
});