-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
skip runnung storybook tests in ci on windows
- Loading branch information
1 parent
88bf2ec
commit fc72e9a
Showing
1 changed file
with
19 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
); |