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

test: [M3-8444] - Add assertions for bucket details drawer tests #10971

Merged
merged 6 commits into from
Oct 11, 2024

Conversation

AzureLatte
Copy link
Contributor

@AzureLatte AzureLatte commented Sep 19, 2024

Description 📝

Add a Cypress integration test to cover OBJ bucket details drawer changes for OBJ Gen 2.

Changes 🔄

  • Add assertions for bucket details drawer tests
  • Add new util function mockGetBucketAccess

How to test 🧪

yarn cy:run -s "cypress/e2e/core/objectStorageGen2/bucket-create-gen2.spec.ts"

As an Author I have considered 🤔

Check all that apply

  • 👀 Doing a self review
  • ❔ Our contribution guidelines
  • 🤏 Splitting feature into small PRs
  • ➕ Adding a changeset
  • 🧪 Providing/Improving test coverage
  • 🔐 Removing all sensitive information from the code and PR description
  • 🚩 Using a feature flag to protect the release
  • 👣 Providing comprehensive reproduction steps
  • 📑 Providing or updating our documentation
  • 🕛 Scheduling a pair reviewing session
  • 📱 Providing mobile support
  • ♿ Providing accessibility support

@AzureLatte AzureLatte self-assigned this Sep 19, 2024
@AzureLatte AzureLatte requested a review from a team as a code owner September 19, 2024 16:51
@AzureLatte AzureLatte requested review from jdamore-linode and removed request for a team September 19, 2024 16:51
@AzureLatte AzureLatte requested a review from a team as a code owner September 19, 2024 16:51
@AzureLatte AzureLatte requested review from mjac0bs and cpathipa and removed request for a team September 19, 2024 16:51
Copy link

github-actions bot commented Sep 19, 2024

Coverage Report:
Base Coverage: 86.99%
Current Coverage: 86.99%

Copy link
Contributor

@mjac0bs mjac0bs left a comment

Choose a reason for hiding this comment

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

I ran these tests locally on an account that didn't have Object Storage enabled in my Settings, and the tests failed consistently at the point where the 'Enable Object Storage' modal opens after Create Button is clicked. Should this test spec account for that?

Once I enabled OBJ, tests all passed and cover the cases outlined in the internal ticket. ✅

Copy link
Contributor

@cpathipa cpathipa left a comment

Choose a reason for hiding this comment

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

I think we have three variations for OBJ feature legacy, gen1 and gen2 are we planing to cover those scenarios with mock flags ?

@AzureLatte
Copy link
Contributor Author

I think we have three variations for OBJ feature legacy, gen1 and gen2 are we planing to cover those scenarios with mock flags ?

I checked bucket details drawer by checkBucketDetailsDrawer in all scenarios in this PR.

Comment on lines 517 to 528
export const mockGetBucketAccess = (
label: string,
cluster: string
): Cypress.Chainable<null> => {
return cy.intercept(
'GET',
apiMatcher(`object-storage/buckets/${cluster}/${label}/access`),
{
body: {},
statusCode: 200,
}
);
Copy link
Contributor

Choose a reason for hiding this comment

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

Hey @AzureLatte just a heads up that I'd also created a mock intercept for bucket access here. Will keep an eye on this PR, and if this gets merged in first will update my PR accordingly!

@mjac0bs
Copy link
Contributor

mjac0bs commented Oct 9, 2024

@AzureLatte This one's got a couple merge conflicts now to be resolved.

Screenshot 2024-10-09 at 9 40 38 AM

Copy link
Contributor

@coliu-akamai coliu-akamai left a comment

Choose a reason for hiding this comment

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

✅ confirmed tests passed - thanks Azure!

Since this file is named bucket-create, wondering if we should update the name to something like bucket-create-and-details-drawer or something (maybe that's too wordy), or move these assertions to a different file?

/**
* Confirms UI flow for creating a gen2 Object Storage bucket with endpoint E0
* Confirms all endpoints are displayed regardless if there's multiple of the same type
* Confirms S3 endpoint hostname displayed to differentiate between identical options in the dropdown
* Confirms correct information displays in the details drawer for all endpoint types
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this test is only for E0, should we specify that? + Same for the below tests

Suggested change
* Confirms correct information displays in the details drawer for all endpoint types
* Confirms correct information displays in the details drawer for a bucket with endpoint E0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice suggestion, I'll update it, thank you!

@@ -320,10 +403,12 @@ describe('Object Storage Gen2 create bucket tests', () => {

/**
* Confirms UI flow for creating a gen2 Object Storage bucket with endpoint E2
* Confirms correct information displays in the details drawer for all endpoint types
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Confirms correct information displays in the details drawer for all endpoint types
* Confirms correct information displays in the details drawer for a bucket with endpoint E2

@@ -205,10 +279,12 @@ describe('Object Storage Gen2 create bucket tests', () => {

/**
* Confirms UI flow for creating a gen2 Object Storage bucket with endpoint E1
* Confirms correct information displays in the details drawer for all endpoint types
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Confirms correct information displays in the details drawer for all endpoint types
* Confirms correct information displays in the details drawer for a bucket with endpoint E1

@@ -435,10 +525,12 @@ describe('Object Storage Gen2 create bucket tests', () => {

/**
* Confirms UI flow for creating a gen2 Object Storage bucket with endpoint E3
* Confirms correct information displays in the details drawer for all endpoint types
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Confirms correct information displays in the details drawer for all endpoint types
* Confirms correct information displays in the details drawer for a bucket with endpoint E3

@mjac0bs mjac0bs added Approved Multiple approvals and ready to merge! and removed Ready for Review labels Oct 11, 2024
@AzureLatte
Copy link
Contributor Author

e2e failure Linode Create Region Select region select – region select is not related with this change

@AzureLatte AzureLatte merged commit d0927f8 into linode:develop Oct 11, 2024
21 of 23 checks passed
@AzureLatte AzureLatte deleted the M3-8444 branch October 11, 2024 17:10
Copy link

cypress bot commented Oct 11, 2024

Cloud Manager E2E    Run #6663

Run Properties:  status check failed Failed #6663  •  git commit d0927f8c24: test: [M3-8444] - Add assertions for bucket details drawer tests (#10971)
Project Cloud Manager E2E
Run status status check failed Failed #6663
Run duration 29m 15s
Commit git commit d0927f8c24: test: [M3-8444] - Add assertions for bucket details drawer tests (#10971)
Committer Azure-akamai
View all properties for this run ↗︎

Test results
Tests that failed  Failures 1
Tests that were flaky  Flaky 3
Tests that did not run due to a developer annotating a test with .skip  Pending 2
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 434

Tests for review

Failed  cypress/e2e/core/placementGroups/delete-placement-groups.spec.ts • 1 failed test

View Output Video

Test Artifacts
Placement Group deletion > can delete with Linodes assigned when unexpected error show up and retry Screenshots Video
Flakiness  linodes/clone-linode.spec.ts • 1 flaky test

View Output Video

Test Artifacts
clone linode > can clone a Linode from Linode details page Screenshots Video
Flakiness  linodes/rebuild-linode.spec.ts • 1 flaky test

View Output Video

Test Artifacts
rebuild linode > cannot rebuild a provisioning linode Screenshots Video
Flakiness  objectStorageGen2/bucket-create-gen2.spec.ts • 1 flaky test

View Output Video

Test Artifacts
Object Storage Gen2 create bucket tests > can create a bucket with E2 endpoint type Screenshots Video

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved Multiple approvals and ready to merge! Object Storage Gen2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants