-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve e2e testing docs and add cli args. #14717
Changes from 2 commits
00e5cc6
72be60e
3155ed2
3264678
6784492
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,4 +50,16 @@ if ( hasCliArg( '--puppeteer-interactive' ) ) { | |
process.env.PUPPETEER_SLOWMO = getCliArg( '--puppeteer-slowmo' ) || 80; | ||
} | ||
|
||
const configsMapping = { | ||
WP_BASE_URL: '--wordpress-host', | ||
WP_USERNAME: '--wordpress-username', | ||
WP_PASSWORD: '--wordpress-password', | ||
}; | ||
|
||
Object.entries( configsMapping ).forEach( ( [ key, value ] ) => { | ||
if ( hasCliArg( value ) ) { | ||
process.env[ key ] = getCliArg( value ); | ||
} | ||
} ); | ||
|
||
jest.run( [ ...config, ...runInBand, ...getCliArgs( cleanUpPrefixes ) ] ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. const cleanUpPrefixes = [ '--puppeteer-' ]; At the moment That's why @draganescu added logic which allows to filter out CLI args starting with a given pattern. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Didn't knew that, had adjusted, thx. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we should align with the env variable name?
--wordpress-base-url
maybe. I forgot that WordPress can be also installed in subfolder and seeing the actual implementation made me think :)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's better, since there is no need to think twice why the argument name is describing a different thing than expected from env key.