Skip to content

Commit

Permalink
skip runnung storybook tests in ci on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel3108 committed Nov 11, 2024
1 parent 88bf2ec commit fc72e9a
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions packages/adders/_tests/storybook/test.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
import process from 'node:process';
import { expect } from '@playwright/test';
import { setupTest } from '../_setup/suite.ts';
import storybook from '../../storybook/index.ts';

const { test, variants, prepareServer } = setupTest({ storybook });

let port = 6006;
test.concurrent.for(variants)('storybook loaded - %s', async (variant, { page, ...ctx }) => {
const cwd = await ctx.run(variant, { storybook: {} });

const { close } = await prepareServer({
cwd,
page,
previewCommand: `pnpm storybook -p ${++port} --ci`,
buildCommand: ''
});
// kill server process when we're done
ctx.onTestFinished(async () => await close());
const skip = process.env.CI && process.platform === 'win32';
test.skipIf(skip).concurrent.for(variants)(
'storybook loaded - %s',
async (variant, { page, ...ctx }) => {
const cwd = await ctx.run(variant, { storybook: {} });

expect(await page.$('main .sb-bar')).toBeTruthy();
expect(await page.$('#storybook-preview-wrapper')).toBeTruthy();
});
const { close } = await prepareServer({
cwd,
page,
previewCommand: `pnpm storybook -p ${++port} --ci`,
buildCommand: ''
});
// kill server process when we're done
ctx.onTestFinished(async () => await close());

expect(await page.$('main .sb-bar')).toBeTruthy();
expect(await page.$('#storybook-preview-wrapper')).toBeTruthy();
}
);

0 comments on commit fc72e9a

Please sign in to comment.