-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding e2e to test Svelte documentation
- Loading branch information
Showing
5 changed files
with
105 additions
and
23 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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* eslint-disable jest/no-disabled-tests */ | ||
import type { Locator } from '@playwright/test'; | ||
import { test, expect } from '@playwright/test'; | ||
import process from 'process'; | ||
import { SbPage } from './util'; | ||
|
||
const storybookUrl = process.env.STORYBOOK_URL || 'http://localhost:6006'; | ||
const templateName = process.env.STORYBOOK_TEMPLATE_NAME; | ||
|
||
test.describe('Svelte', () => { | ||
test.skip( | ||
// eslint-disable-next-line jest/valid-title | ||
!templateName?.includes('svelte'), | ||
'Only run this test on Svelte' | ||
); | ||
|
||
test.beforeEach(async ({ page }) => { | ||
await page.goto(storybookUrl); | ||
await new SbPage(page).waitUntilLoaded(); | ||
}); | ||
|
||
test('Story have a documentation', async ({ page }) => { | ||
const sbPage = new SbPage(page); | ||
|
||
sbPage.navigateToStory('example/button', 'docs'); | ||
const root = sbPage.previewRoot(); | ||
const argsTable = root.locator('.docblock-argstable'); | ||
await expect(argsTable).toContainText('Is this the principal call to action on the page'); | ||
}); | ||
}); |
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
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
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
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