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

Add E2E tests for WooCommerce #2923

Merged
merged 17 commits into from
Sep 15, 2022
Merged

Conversation

burhandodhy
Copy link
Contributor

@burhandodhy burhandodhy commented Aug 4, 2022

Description of the Change

This PR adds new test cases for the WooCommerce feature.

Credits

Props @burhandodhy

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@burhandodhy burhandodhy marked this pull request as ready for review August 4, 2022 08:48
@burhandodhy burhandodhy added this to the 4.3.0 milestone Aug 4, 2022
@felipeelia felipeelia assigned burhandodhy and unassigned felipeelia Aug 8, 2022
@burhandodhy burhandodhy linked an issue Aug 23, 2022 that may be closed by this pull request
46 tasks
@burhandodhy burhandodhy removed a link to an issue Aug 23, 2022
46 tasks
tests/cypress/integration/features/woocommerce.spec.js Outdated Show resolved Hide resolved

cy.visitAdminPage('edit.php?post_type=shop_order');

cy.get('#post-search-input').type(`${userData.firstName} ${userData.lastName}{enter}`);
Copy link
Member

Choose a reason for hiding this comment

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

We could expand this test a bit. Instead of simply searching for the user name, let's also search for order IDs, billing and shipping info, and items: https://github.com/10up/ElasticPress/blob/develop/includes/classes/Feature/WooCommerce/WooCommerce.php#L411

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@felipeelia felipeelia assigned burhandodhy and unassigned felipeelia Aug 24, 2022
@felipeelia felipeelia removed this from the 4.3.0 milestone Aug 29, 2022
@felipeelia felipeelia added this to the 4.4.0 milestone Aug 29, 2022
Comment on lines 151 to 154
cy.get('#debug-menu-target-EP_Debug_Bar_ElasticPress .ep-query-debug').should(
'contain.text',
"'orderby' => 'date'",
);
Copy link
Member

Choose a reason for hiding this comment

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

Just to be sure we are not capturing an autosuggest template query or similar, can we check for shop_order in this query?

Comment on lines 168 to 171
cy.get('#debug-menu-target-EP_Debug_Bar_ElasticPress .ep-query-debug').should(
'contain.text',
'Query Response Code: HTTP 200',
);
Copy link
Member

Choose a reason for hiding this comment

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

same, can we check for shop_order on this one as well?

'contain.text',
`${userData.firstName} ${userData.lastName}`,
);
});
});
Copy link
Member

Choose a reason for hiding this comment

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

@burhandodhy can we bring to this file the test we have for Product variations skus?

@felipeelia felipeelia merged commit a668250 into develop Sep 15, 2022
@felipeelia felipeelia deleted the burhan/add-woocommerce-e2e-tests branch September 15, 2022 16:58
@felipeelia felipeelia modified the milestones: 4.4.0, 4.3.1 Sep 15, 2022
@burhandodhy burhandodhy mentioned this pull request Sep 23, 2022
46 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants