docs: Update Playwright config example#2897
Conversation
✅ Deploy Preview for astro-docs-2 ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site settings. |
|
Thanks for this PR! I can see in the Playwright documentation they do have a different example config. I'm going to ping @chuckcarpenter since this was their original content based on their custom setup for a second pair of eyes here! Chuck, any chance you can confirm that you've made these updates to your own setup, too? Or whether this is better/more recent general advice? |
|
|
||
| export default defineConfig({ | ||
| webServer: { | ||
| command: 'yarn preview', |
There was a problem hiding this comment.
@sarah11918, not entirely related to this PR, but do we 'recommend' yarn to run the commands here? Or should we just fall to PNPM or NPM which we use most in docs (imo)
There was a problem hiding this comment.
Great call out, Elian! This advanced user case was submitted by @chuckcarpenter as the setup they used. I know earlier in the page, for basic usage, we do include our normal package manager tabs for options. We do typically use NPM generically, all other things being equal. So I'd certainly be open to that change!
There was a problem hiding this comment.
@ElianCodes Would you be willing to make the suggested change here so I can just commit it and not have to go through the effort of manually adding you as a co-author to this PR? 😅
|
@sarah11918 if it helps, I've verified the suggested changes in my own playwright config on elian.codes. The suggested changes are all valid! This is my config: import { defineConfig } from '@playwright/test';
export default defineConfig({
testDir: './tests',
use: {
baseURL: 'http://localhost:3000',
},
outputDir: 'test-results/',
webServer: {
command: 'pnpm preview',
port: 3000,
},
}); |
|
@sarah11918 sorry for the late response. Yeah, this LGTM based on changes I've also made on projects. |
ElianCodes
left a comment
There was a problem hiding this comment.
Left changes to switch from yarn to npm
Co-authored-by: Elian ☕️ <hello@elian.codes>
Co-authored-by: Elian ☕️ <hello@elian.codes>
Co-authored-by: Elian ☕️ <hello@elian.codes>
|
Looking great, (Looks like the only ones left are in package manager tabs, so that's fine!) Thanks @rstacruz for this helpful update! We appreciate you taking the time to submit this PR! Kind thanks to @chuckcarpenter and @ElianCodes for jumping in and confirming here. Go Team! |
What kind of changes does this PR include?
Description
Updates the example config to use
defineConfigas suggested in https://playwright.dev/docs/test-configuration.Updates the base URL to http://localhost:3000/ instead of http://localhost:3000/app/, which might represent a more typical case.