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

regression: UI #354

Merged
merged 11 commits into from
Jun 8, 2022
Merged

regression: UI #354

merged 11 commits into from
Jun 8, 2022

Conversation

lanfon72
Copy link
Member

@lanfon72 lanfon72 commented May 26, 2022

This PR will cover all of UI regression test cases.
Changes:

  • exclude all files under cypress/cypress, which automatically generated by cypress.
  • explicitly check the header after cy.login()
  • add new task readYaml for checking yaml content.
  • add new tasks deleteFolder and deleteFile.
  • remove partially implemented generate support bundle and doc comments
  • implement test cases:
    1. Links of Community Section
    2. Download KubeConfig File
    3. Generate Support Bundle (by the limitation, it will only verify form's behavior)

Limitation:

  • Unable to catch the generated support bundle file1, the example2 is not work for our dashboard.
  • context be treated as describe, so there is no scope for sub-tests, every it will trigger before/beforeEach/after/afterEach. (thus, merge sub test cases of links into single test case)

Footnotes

  1. https://github.com/cypress-io/cypress/issues/8619

  2. https://github.com/cypress-io/cypress-example-recipes/blob/master/examples/testing-dom__download/cypress/integration/form-submission-spec.js

@lanfon72 lanfon72 marked this pull request as ready for review May 30, 2022 06:55
Copy link
Contributor

@TachunLin TachunLin left a comment

Choose a reason for hiding this comment

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

LGTM. Verified and tested the new tetscases in support.spec running correctly.
image

@lanfon72
Copy link
Member Author

lanfon72 commented May 30, 2022

I should update the Generate Support Bundle test case to be more clearly, please don't merge it before new commits.

After testing is done, there should not display the message as below:
image

@lanfon72 lanfon72 requested a review from TachunLin May 30, 2022 12:59
Copy link
Contributor

@TachunLin TachunLin left a comment

Choose a reason for hiding this comment

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

Verified the new tasks and test cases running correctly
Also did not show error message after test complete

image

…or checking the support bundle download. Also added in custom commands for cy.verifyDownload and associated yarn and dependency stuff
@noahgildersleeve
Copy link
Contributor

@lanfon72 I added in a test case for downloading the support bundle. I think I got it working without a timeout triggering. I found a solution that involved running an event listener here. I added in comments in the code. Take a look when you get a chance and let me know if you have any questions or concerns. The solution is a little fragile, but I think it should probably work. The issue is that it has three overlapping timeouts that it balances between.

@lanfon72
Copy link
Member Author

lanfon72 commented Jun 6, 2022

@noahgildersleeve, I had tried this solution, but I thought it is not fit our test case.
(we would need verify the Zipfile's content on demend)

After discuss with my frontend friend, I think this commit 335a5b0 should more fit our case.

cypress/testcases/dashboard/support.spec.ts Show resolved Hide resolved
.get("@generateBtn").click()
// Verify that the download has completed
.verifyDownload('supportbundle', {timeout: constants.timeout.downloadTimeout, contains: true})
.intercept('/v1/harvester/supportbundles*/download', (req) => {
Copy link
Member Author

Choose a reason for hiding this comment

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

The API not always be called, so I will not check it.

.intercept("/v1/harvester/*supportbundles/**/bundle*", req =>
req.continue(res => {
cy.log(res.body.status)
filename = res.body.status?.filename || undefined
Copy link
Member Author

Choose a reason for hiding this comment

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

The last response will contains support bundle's filename

@irishgordo
Copy link
Contributor

@lanfon72 - I'm wondering if this is something we can also scaffold on the backend for our tests.
I started to dig into it a bit here:
irishgordo@a6ac4be

I know for: harvester/harvester#2321 - the introduction of "fleet-agent-" and "fleet-controller-" as directories inside of "logs", that could be something we could check for since I believe the feature will be backported.

@lanfon72
Copy link
Member Author

lanfon72 commented Jun 7, 2022

@irishgordo yeah it is good if API's test can cover it too.
We have only few test cases about support bundle, I think the PR is new test case that we need to cover.

@lanfon72 lanfon72 merged commit f8cc43c into harvester:main Jun 8, 2022
@lanfon72 lanfon72 deleted the dashboard branch June 9, 2022 08:52
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