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

[Cypress] Fix failed tests in v1.4.0-rc5 and v1.4.0 #1691

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

TachunLin
Copy link
Contributor

@TachunLin TachunLin commented Dec 3, 2024

Which issue(s) this PR fixes:

Issue #1535

What this PR does / why we need it:

Continue from the previous PR: #1588.
After fixed the cypress script for v1.4.0 string changes, we still have 22 failed tests.

This pull request is based on the fix already works on v1.4.0-rc5.
According to the following result:

And verified the entire cypress test suite on official v1.4.0 release to improve some flaky and unstable issue.

Test Result - fixed the following test cases:

Verified on v1.4.0 to confirm can PASS the following cypress tests

  1. Fix all tests in the vmBackup.spec.ts

    image

  2. Fix all tests in the vmSnapshot.spec.ts

    image

  3. Fix all tests in the volumeSnapshot.spec.ts

    image

  4. Fix one test in the hosts.spec.ts

    • Check edit hosts

    image

  5. Fix one test in the image.spec.ts

    • Image filtering by labels

    image

  6. Fix two tests in the virtual-machine.spec.ts

    • VM RunStategy Validation (Halted)
    • All Namespace filtering in VM list

    image

  7. Fix two tests in the volumes.spec.ts

    • Support Volume Hot Unplug
    • Edit volume increase size via form

    image

Setup Test Environment (Similar to the Jenkins pipeline jobs)

We can use the ipxe-example to build the cypress test environment similar with the Jenkins pipeline job.

  1. Clone the ipxe-example
  2. Edit the settings, harvester_cluster_nodes: 3 and rancher_config.enabled: true
  3. Set the version number and adjust the disk size
  4. Provision the three nodes Harvester with Rancher v2.8.5
  5. Access the pxe_server vm in the ipxe-example
vagrant ssh pxe_server
  1. Follow the steps to setup docker and minio container service
    https://confluence.suse.com/display/HARV/Setup+Harvester+Related+Endpoints#SetupHarvesterRelatedEndpoints-S3

  2. Clone the pr of harvester/tests

  3. Replace the cypress.env.json with the following one (Used for the Jenkins pipeline, reduce the time find configuration)

  4. Run npm install to install depdencies

  5. Run npm ci to install cypress

  6. Then we can trigger the test from our local environment using npm run or npm open

Special notes for your reviewer:

If you plan to test specific test spec file instead of the entire e2e test run.
Ensure to run the 0_FirstTimeLogin.spec.ts and 1_login.spec.ts before testing any specific test suite file

Copy link
Contributor

@a110605 a110605 left a comment

Choose a reason for hiding this comment

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

Thanks @TachunLin make cypress tests compatible to v1.4.0.

but cypress/.package-lock.json.swp is not required in this PR, right ?

@@ -153,20 +153,20 @@ export class VmsPage extends CruResourcePo {

clickVMSnapshotAction(name: string, snapshotName: string) {
this.clickAction(name, 'Take Virtual Machine Snapshot');
cy.get('.v--modal-box .card-title').find('h4').contains('Take Virtual Machine Snapshot');
cy.get('.modal-container .card-title').find('h4').contains('Take Virtual Machine Snapshot');
Copy link
Contributor

Choose a reason for hiding this comment

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

@TachunLin
Copy link
Contributor Author

Thanks @a110605 for the review and check.
Yes, the cypress/.package-lock.json.swp is not required, they were created from the dependency installation.
I have removed them too.

Copy link
Contributor

@torchiaf torchiaf left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/frontend-automation Implement with cypress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants