Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions code/e2e-tests/addon-actions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ import { SbPage } from './util';
const storybookUrl = process.env.STORYBOOK_URL || 'http://localhost:8001';

test.describe('addon-actions', () => {
test.afterEach(async ({ page }) => {
await page.evaluate(() => window.localStorage.clear());
await page.evaluate(() => window.sessionStorage.clear());
});

test.beforeEach(async ({ page }) => {
await page.goto(storybookUrl);
await new SbPage(page).waitUntilLoaded();
Expand Down
5 changes: 5 additions & 0 deletions code/e2e-tests/addon-backgrounds.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ const storybookUrl = process.env.STORYBOOK_URL || 'http://localhost:8001';
const templateName = process.env.STORYBOOK_TEMPLATE_NAME;

test.describe('addon-backgrounds', () => {
test.afterEach(async ({ page }) => {
await page.evaluate(() => window.localStorage.clear());
await page.evaluate(() => window.sessionStorage.clear());
});

test.beforeEach(async ({ page }) => {
await page.goto(storybookUrl);
await new SbPage(page).waitUntilLoaded();
Expand Down
5 changes: 5 additions & 0 deletions code/e2e-tests/addon-controls.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ import { SbPage } from './util';
const storybookUrl = process.env.STORYBOOK_URL || 'http://localhost:8001';

test.describe('addon-controls', () => {
test.afterEach(async ({ page }) => {
await page.evaluate(() => window.localStorage.clear());
await page.evaluate(() => window.sessionStorage.clear());
});

test('should change component when changing controls', async ({ page }) => {
await page.goto(storybookUrl);
const sbPage = new SbPage(page);
Expand Down
4 changes: 4 additions & 0 deletions code/e2e-tests/addon-docs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ test.describe('addon-docs', () => {
await page.goto(storybookUrl);
await new SbPage(page).waitUntilLoaded();
});
test.afterEach(async ({ page }) => {
await page.evaluate(() => window.localStorage.clear());
await page.evaluate(() => window.sessionStorage.clear());
});

test('should show descriptions for stories', async ({ page }) => {
const skipped = [
Expand Down
4 changes: 4 additions & 0 deletions code/e2e-tests/addon-interactions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ test.describe('addon-interactions', () => {
await page.goto(storybookUrl);
await new SbPage(page).waitUntilLoaded();
});
test.afterEach(async ({ page }) => {
await page.evaluate(() => window.localStorage.clear());
await page.evaluate(() => window.sessionStorage.clear());
});

// FIXME: skip xxx
test('should have interactions', async ({ page }) => {
Expand Down
4 changes: 4 additions & 0 deletions code/e2e-tests/addon-viewport.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ test.describe('addon-viewport', () => {
await page.goto(storybookUrl);
await new SbPage(page).waitUntilLoaded();
});
test.afterEach(async ({ page }) => {
await page.evaluate(() => window.localStorage.clear());
await page.evaluate(() => window.sessionStorage.clear());
});

test('should have viewport button in the toolbar', async ({ page }) => {
const sbPage = new SbPage(page);
Expand Down
6 changes: 5 additions & 1 deletion code/e2e-tests/framework-nextjs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,18 @@ test.describe('Next.js', () => {
// and this only tests nextjs/default-js
test.skip(
// eslint-disable-next-line jest/valid-title
!templateName.includes('nextjs/default-js'),
!templateName?.includes('nextjs/default-js'),
'Only run this test for the Frameworks that support next/navigation'
);

test.beforeEach(async ({ page }) => {
await page.goto(storybookUrl);
await new SbPage(page).waitUntilLoaded();
});
test.afterEach(async ({ page }) => {
await page.evaluate(() => window.localStorage.clear());
await page.evaluate(() => window.sessionStorage.clear());
});

test.describe('next/image', () => {
let sbPage: SbPage;
Expand Down
4 changes: 4 additions & 0 deletions code/e2e-tests/json-files.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ test.describe('JSON files', () => {
test.beforeEach(async ({ page }) => {
await page.goto(storybookUrl);
});
test.afterEach(async ({ page }) => {
await page.evaluate(() => window.localStorage.clear());
await page.evaluate(() => window.sessionStorage.clear());
});

test('should have index.json', async ({ page }) => {
test.skip(
Expand Down
7 changes: 4 additions & 3 deletions code/e2e-tests/manager.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ test.describe('manager', () => {
test.beforeEach(async ({ page }) => {
await page.goto(storybookUrl);

await new SbPage(page).waitUntilLoaded();
});
test.afterEach(async ({ page }) => {
await page.evaluate(() => window.localStorage.clear());
await page.evaluate(() => window.sessionStorage.clear());

await new SbPage(page).waitUntilLoaded();
});

test('shortcuts sidebar', async ({ page }) => {
Expand Down Expand Up @@ -92,6 +93,6 @@ test.describe('manager', () => {
await expect(sbPage.page.url()).toContain('/settings/about');

await sbPage.page.locator('[title="Close settings page"]').click();
await expect(sbPage.page.url()).toContain('/docs/configure-your-project--docs');
await expect(sbPage.page.url()).not.toContain('/settings/about');
});
});
5 changes: 5 additions & 0 deletions code/e2e-tests/preview-web.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ const storybookUrl = process.env.STORYBOOK_URL || 'http://localhost:8001';
test.describe('preview-web', () => {
test.beforeEach(async ({ page }) => {
await page.goto(storybookUrl);

await new SbPage(page).waitUntilLoaded();
});
test.afterEach(async ({ page }) => {
await page.evaluate(() => window.localStorage.clear());
await page.evaluate(() => window.sessionStorage.clear());
});

test('should pass over shortcuts, but not from play functions, story', async ({ page }) => {
const sbPage = new SbPage(page);
Expand Down