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
[LYS] Add Homescreen and Settings e2e tests #47341
base: trunk
Are you sure you want to change the base?
Conversation
511f5f9
to
7b2bdd9
Compare
85d965a
to
bbf743f
Compare
Test using WordPress PlaygroundThe changes in this pull request can be previewed and tested using a WordPress Playground instance. Test this pull request with WordPress Playground. Note that this URL is valid for 30 days from when this comment was last updated. You can update it by closing/reopening the PR or pushing a new commit. |
Hi @ilyasfoo, @rjchow, @woocommerce/ghidorah Apart from reviewing the code changes, please make sure to review the testing instructions as well. You can follow this guide to find out what good testing instructions should look like: |
1 similar comment
Hi @ilyasfoo, @rjchow, @woocommerce/ghidorah Apart from reviewing the code changes, please make sure to review the testing instructions as well. You can follow this guide to find out what good testing instructions should look like: |
2678737
to
eb5871a
Compare
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.
Tests look sound and they pass, thanks!
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.
Thanks for the improvements, @psealock! This is good to go but I have a feedback on making the test more resistant to changes in core profiler
await page.goto( '/wp-admin/admin.php?page=wc-admin' ); | ||
// if the core profiler is already complete, skip this | ||
try { | ||
await page |
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.
Optional: Since we're not really looking to test core profiler here, might it be better for us to skip it programatically? For example, here's how we reset it directly with an API, perhaps we can create a similar helper to "skip" or "complete" it.
woocommerce/packages/js/e2e-utils/src/flows/with-rest-api.js
Lines 70 to 90 in 34f8c65
resetOnboarding: async () => { | |
const onboardingReset = { | |
completed: false, | |
industry: [], | |
business_extensions: [], | |
skipped: false, | |
product_types: [], | |
product_count: '0', | |
selling_venues: 'no', | |
revenue: 'none', | |
theme: '', | |
setup_client: false, | |
wccom_connected: false, | |
}; | |
const response = await client.put( | |
onboardingProfileEndpoint, | |
onboardingReset | |
); | |
expect( response.statusCode ).toEqual( 200 ); | |
}, |
If we need to initialize coming soon options, we can directly call this API:
woocommerce/plugins/woocommerce/src/Admin/API/LaunchYourStore.php
Lines 39 to 49 in 34f8c65
register_rest_route( | |
$this->namespace, | |
'/' . $this->rest_base . '/initialize-coming-soon', | |
array( | |
array( | |
'methods' => 'POST', | |
'callback' => array( $this, 'initialize_coming_soon' ), | |
'permission_callback' => array( $this, 'must_be_shop_manager_or_admin' ), | |
), | |
) | |
); |
Submission Review Guidelines:
Changes proposed in this Pull Request:
Closes #47298
How to test the changes in this Pull Request:
Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:
Changelog entry
Significance
Type
Message
Comment
add e2e tests to previously unreleased feature