Skip to content

Commit

Permalink
Test(demo): Introduce E2E test for homepage refs #DS-869
Browse files Browse the repository at this point in the history
  • Loading branch information
literat committed Sep 25, 2023
1 parent a80db09 commit 65a6be6
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 0 deletions.
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
"storybook": "storybook dev -p 6006",
"storybook:build": "storybook build -o ./.storybook/build",
"test": "yarn packages:test",
"test:e2e": "yarn playwright test",
"test:e2e:update": "yarn playwright test --update-snapshots",
"test:e2e:report": "yarn playwright show-report",
"test:e2e:ui": "yarn playwright test --ui",
"types": "yarn packages:types",
"lint": "npm-run-all --parallel es:lint packages:lint",
"packages:lint": "lerna run lint --parallel --no-sort",
Expand Down
21 changes: 21 additions & 0 deletions tests/e2e/demo-homepages.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { test, expect } from '@playwright/test';

test.describe('Demo Homepages', () => {
const demos = [
{
url: 'https://spirit-design-system-demo.netlify.app/',
package: 'web',
},
{
url: 'https://spirit-design-system-react.netlify.app/',
package: 'web-react',
},
];

for (const demo of demos) {
test(`test demo homepage ${demo.package}`, async ({ page }) => {
await page.goto(demo.url);
await expect(page).toHaveScreenshot(`${demo.package}.png`, { fullPage: true });
});
}
});
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.
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.

0 comments on commit 65a6be6

Please sign in to comment.