Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build: Skip docs pages e2e tests for ssv6 examples #22141

Merged
merged 1 commit into from
Apr 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 22 additions & 12 deletions code/e2e-tests/addon-backgrounds.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ 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-backgrounds', () => {
test.beforeEach(async ({ page }) => {
Expand Down Expand Up @@ -38,21 +39,30 @@ test.describe('addon-backgrounds', () => {
await expect(sbPage.page.locator(backgroundToolbarSelector)).toBeVisible();
});

test('button should appear for attached docs pages', async ({ page }) => {
const sbPage = new SbPage(page);
test.describe('docs pages', () => {
// eslint-disable-next-line jest/no-disabled-tests
test.skip(
// eslint-disable-next-line jest/valid-title
templateName.includes('ssv6'),
'Only run this test for Sandboxes with StoryStoreV7 enabled'
);

await sbPage.navigateToStory('example/button', 'docs');
await expect(sbPage.page.locator(backgroundToolbarSelector)).toBeVisible();
});
test('button should appear for attached docs pages', async ({ page }) => {
const sbPage = new SbPage(page);

test('button should appear for unattached docs pages', async ({ page }) => {
const sbPage = new SbPage(page);
await sbPage.navigateToStory('example/button', 'docs');
await expect(sbPage.page.locator(backgroundToolbarSelector)).toBeVisible();
});

// We start on the introduction page by default.
await sbPage.page.waitForURL((url) =>
url.search.includes(`path=/docs/example-introduction--docs`)
);
test('button should appear for unattached docs pages', async ({ page }) => {
const sbPage = new SbPage(page);

await expect(sbPage.page.locator(backgroundToolbarSelector)).toBeVisible();
// We start on the introduction page by default.
await sbPage.page.waitForURL((url) =>
url.search.includes(`path=/docs/example-introduction--docs`)
);

await expect(sbPage.page.locator(backgroundToolbarSelector)).toBeVisible();
});
});
});