Skip to content

Commit

Permalink
test: add screenshot test for DocPage
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel-Tyan committed Nov 6, 2024
1 parent 4f0c761 commit fad6a4a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/DocPage/DocPage.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import {expect, test} from '@playwright/test';

import {ROOT_ELEMENT_SELECTOR, URL_SEGMENT, VIEW_MODE} from '../utils';

test('Document page test', async ({page}) => {
await page.goto(URL_SEGMENT + 'pages-document--document' + VIEW_MODE);
await page.waitForSelector(ROOT_ELEMENT_SELECTOR);
await expect(page).toHaveScreenshot('DocPage.png');
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions tests/utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const URL_SEGMENT = 'http://localhost:6006/iframe.html?args=&id=';
export const ROOT_ELEMENT_SELECTOR = '#storybook-root';
export const VIEW_MODE = '&viewMode=story';

0 comments on commit fad6a4a

Please sign in to comment.