Skip to content

Commit

Permalink
chip visual test to use storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Siggery committed Nov 26, 2024
1 parent 9f209be commit f013255
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
6 changes: 3 additions & 3 deletions packages/components/pie-chip/test/visual/pie-chip.spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { test } from '@playwright/test';
import percySnapshot from '@percy/playwright';
import { percyWidths } from '@justeattakeaway/pie-webc-testing/src/percy/breakpoints.ts';
import { variants } from '../../src/defs.ts';
import { BasePage } from '@justeattakeaway/pie-webc-testing/src/helpers/page-object/base-page.ts';
import { variants } from '../../src/defs.ts';

variants.forEach((variant) => test(`should render all prop variations for Variant: ${variant}`, async ({ page }) => {
let basePage = new BasePage(page, `chip--${variant}-prop-variations`);
const basePage = new BasePage(page, `chip--${variant}-prop-variations`);

basePage.load();
basePage.load();

// Follow up to remove in Jan
await page.waitForTimeout(5000);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
export const buildUrl = (componentName: string, path: string, args: string) => {
const prNumber = process.env.PR_NUMBER;
const branch = process.env.GITHUB_REF;

const baseURL = process.env.CI
? branch === 'refs/heads/main'
? 'https://webc-testing.pie.design'
: `https://pr${prNumber}-storybook-testing.pie.design`
: 'http://localhost:6006';

let url = `${baseURL}/iframe.html?id=${componentName}${path ? path : ''}`;
let baseURL = 'http://localhost:6006';

if (process.env.CI) {
if (branch === 'refs/heads/main') {
baseURL = 'https://webc-testing.pie.design';
} else {
baseURL = `https://pr${prNumber}-storybook-testing.pie.design`;
}
}

let url = `${baseURL}/iframe.html?id=${componentName}${path || ''}`;

if (args) {
url += `&args=${args}`;
Expand Down

0 comments on commit f013255

Please sign in to comment.