forked from microsoft/fluentui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(web-components): Add playwright testing for v3 web components (m…
…icrosoft#28142) * setup playwright testing * fix deps and update readme * add playwright to ensure browsers and deps are installed * test npx command playwright * add pretest hook to test * add dev specific testing command so we can run ci pretest * point to the right directory chris...
- Loading branch information
1 parent
e9957e8
commit 8085773
Showing
12 changed files
with
414 additions
and
890 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
7 changes: 7 additions & 0 deletions
7
change/@fluentui-web-components-320e7f04-b281-4749-8342-2bc7d1d65e95.json
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,7 @@ | ||
{ | ||
"type": "none", | ||
"comment": "add playwright testing to the web component package", | ||
"packageName": "@fluentui/web-components", | ||
"email": "chhol@microsoft.com", | ||
"dependentChangeType": "none" | ||
} |
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 was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import type { PlaywrightTestConfig } from '@playwright/test'; | ||
|
||
const config: PlaywrightTestConfig = { | ||
projects: [{ name: 'chromium' }, { name: 'firefox' }, { name: 'webkit' }], | ||
reporter: 'list', | ||
testMatch: /.*\.spec\.ts$/, | ||
retries: 3, | ||
fullyParallel: process.env.CI ? false : true, | ||
timeout: process.env.CI ? 10000 : 30000, | ||
use: { | ||
baseURL: 'http://localhost:6006/iframe.html', | ||
viewport: { | ||
height: 1280, | ||
width: 720, | ||
}, | ||
}, | ||
webServer: { | ||
// double-quotes are required for Windows | ||
command: `node -e "import('express').then(({ default: e }) => e().use(e.static('./dist/storybook')).listen(6006))"`, | ||
port: 6006, | ||
reuseExistingServer: process.env.CI ? false : true, | ||
}, | ||
}; | ||
|
||
export default config; |
This file was deleted.
Oops, something went wrong.
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,31 @@ | ||
import qs from 'qs'; | ||
|
||
/** | ||
* Returns a formatted URL for a given Storybook fixture. | ||
* | ||
* @param id - the Storybook fixture ID | ||
* @param args - Story args | ||
* @returns - the local URL for the Storybook fixture iframe | ||
*/ | ||
export function fixtureURL(id: string = 'debug--blank', args?: Record<string, any>): string { | ||
const params: Record<string, any> = { id }; | ||
if (args) { | ||
params.args = qs | ||
.stringify(args, { | ||
allowDots: true, | ||
delimiter: ';', | ||
format: 'RFC1738', | ||
encode: false, | ||
}) | ||
.replace(/=/g, ':') | ||
.replace(/\//g, '--'); | ||
} | ||
|
||
const url = qs.stringify(params, { | ||
addQueryPrefix: true, | ||
format: 'RFC1738', | ||
encode: false, | ||
}); | ||
|
||
return url; | ||
} |
Oops, something went wrong.