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/tests #324

Merged
merged 32 commits into from
Jun 26, 2024
Merged

Update/tests #324

merged 32 commits into from
Jun 26, 2024

Conversation

circlecube
Copy link
Member

Proposed changes

This updates the tests that have been failing. It should speed them up as well.

I've implemented the testIsolation flag so each test is expected to be more independent, and combined tests that were not independent to run in the same it. (We are working through all tests to use this recommended setting so I went ahead and added while I was working on these.)

I combined some cli commands too so they should run faster. These were eating up a lot of time running on and before each test step and many were repeated so I was able to combine test steps and cli commands.

I also started adding some data testid attributes to elements which can be used once they are included in the build, I didn't switch to those yet though they are commented out for selecting the nowoo-store-title and description, they should be a faster and clearer way to select elements on the page.

This also includes some lint fixes my IDE changed, I hope it doesn't make review confusing.

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

combine test sections and cli commands and enable test isolation
lint cleanup
combine tests and implement testIsolation option
lint cleanup
@circlecube circlecube self-assigned this Jun 11, 2024
* trunk:
  Verifying Id instead of text
  remove unused variable
  change in before block
  syntax chnages
  Codes are added to check after continue with store setup click
  Added cy.reload to see if help-center option shows up
  Removed unnecessary codes
  Changes on Help-Center code
  Added Site capabilities code
  timeout increased for 15seconds
  Written separate it blocks for update name server, connect domain and continue with store setup
  Post Migration scripts
* trunk: (51 commits)
  Ecommerce version bump 1.3.32
  load ecomdash only for ecommerce plus
  bug fix press0-1375
  Remove unused thumbnail service code
  fix : screen size view
  fix code reviews
  PRESS0-1430 round 2 fixes
  Added .mo file
  PRESS0-1429, PRESS0-1430
  PRESS0-1429, PRESS0-1430
  PRESS0-1427
  fix PRESS0-1397
  PRESS0-1267
  PRESS0-1267
  PRESS0-1267
  undo incorrect condition check code change for testing
  PRESS0-1396
  auto redirect wondercart on install
  fix ecomdash
  PRESS0-1394
  ...

# Conflicts:
#	src/components/WooCommerceUnavailable.js
* trunk:
  ecommerce version bump 1.3.33
  skip one failing test, bug raised for same
  try with old locators
  linting fix
  deactivate woo in previous steps
  deactivate woo and enabled homewithwoo tests
  skip woo tests and correct migration tests
  remove skip
  skip to check if next specs passes
  remove skip for now
  test skipping test
  PRESS0-1497 | Fix failures in plugin workflow

# Conflicts:
#	tests/cypress/integration/Home/migration.cy.js
#	tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js
#	tests/cypress/integration/Store/storePage.cy.js
for some reason the runner stalls out on the install and the site is stuck, verify the plugin is installed via cli command instead
@circlecube circlecube requested review from a team June 18, 2024 23:14
@circlecube
Copy link
Member Author

These are now finally passing tests. I converted all but one of the tests to use testIsolation - and the remaining one (ecommerce-next-steps) I didn't update it because it does not pass locally for me, I assume I need to start with a fresh install so the next steps display properly.

Friendly reminder that new features should have new tests and PRs shouldn't be merged unless tests pass. We certainly should not release a module with failing tests because that cascades to every other module and plugin displaying failing tests.

wpalani
wpalani previously approved these changes Jun 19, 2024
beforeEach( () => {
cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/home' );
} );
before( () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

HG run has a syntax error, please fix it @circlecube

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch, thanks for pointing it out.


export const wpLogin = () => {
cy.login( Cypress.env( 'wpUsername' ), Cypress.env( 'wpPassword' ) );
};
Copy link
Contributor

Choose a reason for hiding this comment

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

add a line break.

Copy link
Member Author

Choose a reason for hiding this comment

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

Again, thanks for the callout. This is updated.

@sangeetha-nayak sangeetha-nayak self-requested a review June 26, 2024 09:42
@aratidgr8 aratidgr8 merged commit 9fba36e into trunk Jun 26, 2024
3 of 5 checks passed
@aratidgr8 aratidgr8 deleted the update/tests branch June 26, 2024 11:40
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.

4 participants