bluehost-wordpress-plugin
bluehost-wordpress-plugin copied to clipboard
Update/cypress test isolation
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.
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 to modules one at a time until they are all in place and 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)