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

Replace custom commands with @10up/cypress-wp-utils #162

Merged
merged 5 commits into from
Apr 13, 2022
Merged

Conversation

dinhtungdu
Copy link
Contributor

@dinhtungdu dinhtungdu commented Apr 5, 2022

Description of the Change

This PR updates the Cypress test suite to use @10up/cypress-wp-utils instead of custom commands. This is currently blocked by 10up/cypress-wp-utils#51.

Closes #161

Verification Process

See tests pass on both local and GH Actions.

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests passed.

Changelog Entry

Changed - Replaced custom commands with @10up/cypress-wp-utils in end-to-end tests

Credits

Props @dinhtungdu

@dinhtungdu dinhtungdu changed the title replace custom commands by cypress-wp-utils Replace custom commands by @10up/cypress-wp-utils Apr 6, 2022
@dinhtungdu dinhtungdu changed the title Replace custom commands by @10up/cypress-wp-utils Replace custom commands with @10up/cypress-wp-utils Apr 6, 2022
@dinhtungdu dinhtungdu marked this pull request as ready for review April 11, 2022 10:35
Copy link
Contributor

@cadic cadic left a comment

Choose a reason for hiding this comment

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

@dinhtungdu thank you for this great update!

I left couple questions about other commands we can potentially replace.

});

it('Can activate plugin if it is deactivated', () => {
cy.visit('/wp-admin/plugins.php');
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we use cy.activatePlugin() and cy.deactivatePlugin() here?

cy.visitAdminPage(
'edit-tags.php?taxonomy=podcasting_podcasts&podcasts=true'
it('Can delete all taxonomies', () => {
cy.visit(
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we shortcut this with cy.deleteAllTerms('podcasting_podcasts')?

@jeffpaul jeffpaul added this to the 1.3.0 milestone Apr 12, 2022
@dinhtungdu dinhtungdu requested a review from cadic April 13, 2022 02:40
@dinhtungdu
Copy link
Contributor Author

@cadic Thanks for the review. I updated the PR per your suggestion. Please take another look!

Copy link
Contributor

@cadic cadic left a comment

Choose a reason for hiding this comment

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

LGTM, thank you @dinhtungdu!

@jeffpaul jeffpaul merged commit d5c04a8 into develop Apr 13, 2022
@jeffpaul jeffpaul deleted the fix/161 branch April 13, 2022 15:34
@cadic cadic modified the milestones: 1.3.0, 1.2.3 Apr 26, 2022
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.

Replace custom commands with @10up/cypress-wp-utils
3 participants