Skip to content

Conversation

@rjchow
Copy link
Contributor

@rjchow rjchow commented Jun 2, 2023

Submission Review Guidelines:

Changes proposed in this Pull Request:

image

This is a pure refactor of the core profiler's install plugins page, and no user-facing differences should occur.
The original PR's test instructions can be found here: #38405

Follow up issue to supplement test coverage:
235-gh-woocommerce/team-ghidorah

How to test the changes in this Pull Request:

Before each test case:

  1. Make sure to remove plugins. You can run rm -rf woocommerce-payments woocommerce-services jetpack pinterest-for-woocommerce mailpoet tiktok-for-business google-listings-and-ads in the plugins directory. You might have to visit /wp-admin/plugins.php to refresh the plugins cache.
  2. Make sure to set woocommerce_show_marketplace_suggestions option to no to use core-profiler. We need to make changes in WCCOM later.

Installation completes in 30 seconds

  1. Start the core profiler and continue to the plugins page.
  2. Confirm the plugins are checked by default.
  3. Click Continue button.
  4. Wait for the installation process to finish.
  5. Confirm storeprofiler_store_extensions_installed_and_activated tracks
  6. Confirm storeprofiler_step_view track.

If you have fast internet, installation should finish in 30 seconds, and you should be redirected to WooCommerce Home.

Installation exceeds 30 seconds.

If you have fast internet, this is hard to test since it won't take 30 seconds to install the plugins. We can adjust the timer time in this case.

  1. Change the timer in this line to 5000. (in milliseconds)
  2. Go to the plugins page and click Continue
  3. After 5 seconds, you should see a request to {site}/wp-json/wc-admin/onboarding/plugins/install-and-activate-async and redirected to Woo Home.
  4. Confirm storeprofiler_store_extensions_installed_and_activated tracks

Installation completed with errors

  1. Go to your WP plugins directory and make mailpoet directory.
  2. Create an empty test.txt file in the mailpoet directory. This will make the installation fail.
  3. Go to the plugins page and click Continue
  4. You should see the plugins page with an error.
  5. Click Please try again
  6. It should fail again.
  7. Remove mailpoet directory from your plugins directory.
  8. Click Please try again again.

Screen Shot 2023-05-22 at 4 32 02 PM

User clicks on skip this page

  1. Go to the plugins page.
  2. Click Skip this step
  3. You should be redirected to Woo Home
  4. woocommerce_onboarding_profile option should have plugins_page_skipped set to true

@github-actions github-actions bot added focus: react admin [team:Ghidorah] plugin: woocommerce Issues related to the WooCommerce Core plugin. labels Jun 2, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jun 2, 2023

Test Results Summary

Commit SHA: 97a250b

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests25900202610m 51s
E2E Tests1950010020515m 17s

To view the full API test report, click here.
To view the full E2E test report, click here.
To view all test reports, visit the WooCommerce Test Reports Dashboard.

@rjchow rjchow force-pushed the dev/core-profiler-refactor-install-plugins-xstate branch from a276f2b to 2d4f848 Compare June 2, 2023 12:01
@moon0326
Copy link
Contributor

moon0326 commented Jun 3, 2023

This looks great! I had no idea you could use a machine as an invoke source! 👍

@rjchow rjchow force-pushed the dev/core-profiler-refactor-install-plugins-xstate branch from 37b9a0a to 2a31944 Compare June 6, 2023 11:27
@rjchow rjchow marked this pull request as ready for review June 6, 2023 11:48
@rjchow rjchow changed the base branch from trunk to dev/refactor-core-profiler-pages June 6, 2023 23:24
Base automatically changed from dev/refactor-core-profiler-pages to trunk June 7, 2023 03:39
@rjchow rjchow force-pushed the dev/core-profiler-refactor-install-plugins-xstate branch from 8186795 to c5d192f Compare June 7, 2023 04:08
@rjchow rjchow requested review from a team, adrianduffell and ilyasfoo June 7, 2023 04:40
@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2023

Hi @ilyasfoo, @adrianduffell, @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:
https://github.com/woocommerce/woocommerce/wiki/Writing-high-quality-testing-instructions

Copy link
Contributor

@moon0326 moon0326 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for working on the changes 👍 It's straightforward and easy to understand!!

Code LGTM and tested well 👍

Copy link
Contributor

@ilyasfoo ilyasfoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After 5 seconds, you should see a request to wp-json/wc-admin/plugins/install with async=true and redirected to Woo Home.

Wanted to confirm, I had wp-json/wc-admin/plugins/installed fired. Is that correct?

woocommerce_onboarding_profile option should have plugins_page_skipped set to true

This test failed for me. Not sure what went wrong, I had no errors after skipping. My option values after the onboarding:

{
  "business_choice": "im_just_starting_my_business",
  "selling_online_answer": null,
  "selling_platforms": null,
  "is_store_country_set": true,
  "industry": [
    null
  ],
  "completed": true
}

@rjchow
Copy link
Contributor Author

rjchow commented Jun 9, 2023

After 5 seconds, you should see a request to wp-json/wc-admin/plugins/install with async=true and redirected to Woo Home.

Wanted to confirm, I had wp-json/wc-admin/plugins/installed fired. Is that correct?

woocommerce_onboarding_profile option should have plugins_page_skipped set to true

This test failed for me. Not sure what went wrong, I had no errors after skipping. My option values after the onboarding:

{
  "business_choice": "im_just_starting_my_business",
  "selling_online_answer": null,
  "selling_platforms": null,
  "is_store_country_set": true,
  "industry": [
    null
  ],
  "completed": true
}
image

@ilyasfoo I'm seeing this, so it seems to be working correctly. But granted I was using the production value of 30000 (30 secs) instead of 5000.

For the profile item update I can reproduce that, it seems like the API is being called as it was before the refactor, but it doesn't seem to be being persisted correctly.

image

I'm mindful of keeping this PR as much of a pure refactor as possible since Moon already has a PR in progress to make changes that are rebased on top of this one, so big changes here could result in a lot of work to untangle that one. I'll make a note in the issue to review the options regarding this.

I did catch something else but it's also not within the scope of this PR, @moon0326 the free-extensions API seems to be returning different sets of plugins the first time I run it, and the second time I ran it. I'll make an issue to investigate it.

First time:
image

Second time after installing all of the selected above:

image

Copy link
Contributor

@ilyasfoo ilyasfoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rjchow Gotcha. Makes sense to address that issue outside of this PR. 🚢

@rjchow rjchow force-pushed the dev/core-profiler-refactor-install-plugins-xstate branch from c5d192f to 97a250b Compare June 9, 2023 06:31
@rjchow rjchow merged commit 622711c into trunk Jun 9, 2023
@rjchow rjchow deleted the dev/core-profiler-refactor-install-plugins-xstate branch June 9, 2023 07:08
@github-actions github-actions bot added this to the 7.9.0 milestone Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plugin: woocommerce Issues related to the WooCommerce Core plugin.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants