Skip to content
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

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

psealock
Copy link
Contributor

@psealock psealock commented May 10, 2024

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:

  1. See tests make sense
  2. Check CI passes

Changelog entry

  • Automatically create a changelog entry from the details below.

Significance

  • Patch
  • Minor
  • Major

Type

  • Fix - Fixes an existing bug
  • Add - Adds functionality
  • Update - Update existing functionality
  • Dev - Development related task
  • Tweak - A minor adjustment to the codebase
  • Performance - Address performance issues
  • Enhancement - Improvement to existing functionality

Message

Comment

add e2e tests to previously unreleased feature

@github-actions github-actions bot added focus: e2e tests Issues related to e2e tests plugin: woocommerce Issues related to the WooCommerce Core plugin. labels May 10, 2024
@psealock psealock changed the base branch from trunk to add/LYS-e2e-tests May 10, 2024 02:41
Base automatically changed from add/LYS-e2e-tests to trunk May 13, 2024 23:41
@psealock psealock force-pushed the add/LYS-e2e-tests-merchant branch from 511f5f9 to 7b2bdd9 Compare May 14, 2024 00:04
@github-actions github-actions bot added focus: api tests Issues related to API tests. focus: monorepo infrastructure Issues and PRs related to monorepo tooling. package: @woocommerce/components issues related to @woocommerce/components package: @woocommerce/data issues related to @woocommerce/data package: @woocommerce/experimental issues related to @woocommerce/experimental plugin: woocommerce beta tester Issues related to the WooCommerce Beta Tester plugin. labels May 20, 2024
@psealock psealock force-pushed the add/LYS-e2e-tests-merchant branch from 85d965a to bbf743f Compare May 20, 2024 23:32
@github-actions github-actions bot removed package: @woocommerce/components issues related to @woocommerce/components package: @woocommerce/experimental issues related to @woocommerce/experimental plugin: woocommerce beta tester Issues related to the WooCommerce Beta Tester plugin. package: @woocommerce/data issues related to @woocommerce/data focus: monorepo infrastructure Issues and PRs related to monorepo tooling. focus: api tests Issues related to API tests. labels May 20, 2024
Copy link
Contributor

Test using WordPress Playground

The changes in this pull request can be previewed and tested using a WordPress Playground instance.
WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

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.

@psealock psealock closed this May 21, 2024
@psealock psealock reopened this May 21, 2024
@psealock psealock requested review from a team, ilyasfoo and rjchow May 21, 2024 01:31
Copy link
Contributor

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

1 similar comment
Copy link
Contributor

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

@psealock psealock force-pushed the add/LYS-e2e-tests-merchant branch from 2678737 to eb5871a Compare May 21, 2024 22:56
@psealock psealock closed this May 21, 2024
@psealock psealock reopened this May 21, 2024
Copy link
Contributor

@rjchow rjchow left a 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!

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.

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
Copy link
Contributor

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.

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:

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' ),
),
)
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
focus: e2e tests Issues related to e2e tests plugin: woocommerce Issues related to the WooCommerce Core plugin.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Launch Your Store] Add e2e test around Homescreen badge and Settings page
3 participants