mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-21 05:02:39 +08:00
E2E: Conditionally skip vue3 docs snippet tests
This commit is contained in:
parent
74f5836fa9
commit
8e373f4b54
@ -1,19 +1,24 @@
|
||||
/* eslint-disable jest/no-disabled-tests */
|
||||
/* eslint-disable no-await-in-loop */
|
||||
import { test, expect } from '@playwright/test';
|
||||
import process from 'process';
|
||||
import { SbPage } from './util';
|
||||
|
||||
const storybookUrl = process.env.STORYBOOK_URL || 'http://localhost:8001';
|
||||
const templateName = process.env.STORYBOOK_TEMPLATE_NAME || '';
|
||||
|
||||
test.describe('addon-docs', () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.goto(storybookUrl);
|
||||
});
|
||||
|
||||
// FIXME: skip html/vue3
|
||||
test('should provide source snippet', async ({ page }) => {
|
||||
const sbPage = new SbPage(page);
|
||||
test.skip(
|
||||
/^vue3/.test(templateName),
|
||||
`Skipping ${templateName}, which does not support dynamic source snippets`
|
||||
);
|
||||
|
||||
const sbPage = new SbPage(page);
|
||||
await sbPage.navigateToStory('example-button', 'docs');
|
||||
const root = sbPage.previewRoot();
|
||||
const toggles = root.locator('.docblock-code-toggle');
|
||||
|
@ -8,12 +8,13 @@ export const e2eTests: Task = {
|
||||
async ready() {
|
||||
return false;
|
||||
},
|
||||
async run(_, { builtSandboxDir, junitFilename }) {
|
||||
async run(_, { builtSandboxDir, junitFilename, template }) {
|
||||
const storybookController = await serveSandbox(builtSandboxDir, {});
|
||||
|
||||
await exec('yarn playwright test --reporter=junit', {
|
||||
env: {
|
||||
STORYBOOK_URL: `http://localhost:8001`,
|
||||
STORYBOOK_TEMPLATE_NAME: template.name,
|
||||
...(junitFilename && {
|
||||
PLAYWRIGHT_JUNIT_OUTPUT_NAME: junitFilename,
|
||||
}),
|
||||
|
Loading…
x
Reference in New Issue
Block a user