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

Update/cypress test isolation #1116

Merged
merged 6 commits into from
Nov 13, 2024
Merged

Conversation

circlecube
Copy link
Member

@circlecube circlecube commented Jun 10, 2024

Proposed changes

This updates the test files in the plugin to run in testIsolation mode.

Also updates the login before in support/index to a beforeEach so that each isolated test will login. Also adds a login command to each test in the beforeEach section.

I also updated a few tests to minimize the time it takes to run, and added a mobile nav test since we hadn't done that since the redesign.

Once these are all passing and merged, we can then add the testIsolation flag to modules one at a time until they are all in place, at which point we can remove them all and remove the global config that disables testIsolation: testIsolation: false, at https://github.com/bluehost/bluehost-wordpress-plugin/blob/main/cypress.config.js#L73. There's probably a better process to migrate to this config change, but that's the first that comes to mind. If we get to a tipping point we can remove the global config and require any test that doesn't work in isolation mode to specify in the describe.

To make a test run in testIsolation mode, add it to the options in the describe.

describe( 'My test title', { testIsolation: true }, function () { ...

Type of Change

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc
  • Linting and tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

@circlecube circlecube self-assigned this Jun 10, 2024
@circlecube circlecube marked this pull request as draft June 19, 2024 18:40
* develop: (45 commits)
  Rollback ecommerce nodule npm package
  Bump plugin version
  Modify composer deps
  linting fixes
  fixes in store page
  linting fixes
  linting issues
  calling comingSoonAdminbarToggle on update of comingsoon
  update tests to reflect change
  remove 'FREE Monthly Webinar: ' line from webinar component
  update migration module to 1.0.7
  update features module to 1.4.2
  update plugin version to 3.12.1
  Replace references to old values in `NewfoldRuntime`
  require migration update 1.0.6 in plugin
  Bump coming soon module to 1.2.5
  Bump version
  Bump module version
  Bump module version
  Fix merge conflict
  ...
* develop: (331 commits)
  update solutions module to 1.0.6
  try tests with updated data and solutions modules
  update data module to 2.6.6
  update ecommerce module to 1.4.3 - fixes migration tests
  update solutions module to 1.0.5 - fixes tests and flaky api call
  NPM(deps): Bump react-router-dom from 6.27.0 to 6.28.0
  update notifications module to 1.6.4 - fixes test issues
  update ecommerce module to 1.4.2 - fixes migration test
  update to minor newfold modules to fix tests
  also try updating help center module to version 2.2.0
  update i18n
  update notifications module to 1.6.2
  try updating wp/scripts to latest
  update plugin version to 3.15.3
  NPM(deps): Bump @wordpress/compose from 7.10.0 to 7.11.0
  NPM(deps): Bump @wordpress/i18n from 5.10.0 to 5.11.0
  NPM(deps): Bump @wordpress/element from 6.10.0 to 6.11.0
  NPM(deps): Bump @wordpress/html-entities from 4.9.0 to 4.11.0
  Composer(deps): Bump newfold-labs/wp-module-solutions
  NPM(deps): Bump @wordpress/dom-ready from 4.10.0 to 4.11.0
  ...

# Conflicts:
#	tests/cypress/integration/pages-and-posts.cy.js
#	tests/cypress/integration/settings.cy.js
Copy link

cypress bot commented Nov 8, 2024

Bluehost Brand Plugin    Run #11508

Run Properties:  status check passed Passed #11508  •  git commit ebefd99c7a: add wpLogin and add to each tests beforeEach
Project Bluehost Brand Plugin
Branch Review update/cypress-test-isolation
Run status status check passed Passed #11508
Run duration 30m 15s
Commit git commit ebefd99c7a: add wpLogin and add to each tests beforeEach
Committer Evan Mullins
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 1
Tests that did not run due to a developer annotating a test with .skip  Pending 33
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 410
View all changes introduced in this branch ↗︎

@circlecube circlecube marked this pull request as ready for review November 8, 2024 22:07
@circlecube circlecube added this to the November 13, 2024 Release milestone Nov 8, 2024
Copy link

cypress bot commented Nov 8, 2024

Bluehost Brand Plugin    Run #11513

Run Properties:  status check passed Passed #11513  •  git commit e1204f8728 ℹ️: Merge ebefd99c7a446a093997c17152b67ac8aa92c94c into 9f99da13246bd827e9151c1b5754...
Project Bluehost Brand Plugin
Branch Review update/cypress-test-isolation
Run status status check passed Passed #11513
Run duration 31m 41s
Commit git commit e1204f8728 ℹ️: Merge ebefd99c7a446a093997c17152b67ac8aa92c94c into 9f99da13246bd827e9151c1b5754...
Committer Evan Mullins
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 1
Tests that did not run due to a developer annotating a test with .skip  Pending 33
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 410
View all changes introduced in this branch ↗︎

@circlecube circlecube merged commit b58a711 into develop Nov 13, 2024
9 of 10 checks passed
@circlecube circlecube deleted the update/cypress-test-isolation branch November 13, 2024 14:53
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.

2 participants