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: Resolve OBJ create and delete E2E test flake #10245

Merged
merged 7 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-10245-tests-1709311899662.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Tests
---

Resolve OBJ Bucket create/delete E2E test flake ([#10245](https://github.com/linode/manager/pull/10245))
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'cypress-file-upload';
import { createBucket } from '@linode/api-v4/lib/object-storage';
import { objectStorageBucketFactory } from 'src/factories';
import { authenticate } from 'support/api/authentication';
import { interceptGetNetworkUtilization } from 'support/intercepts/account';
import {
interceptCreateBucket,
interceptDeleteBucket,
Expand Down Expand Up @@ -120,16 +121,25 @@ describe('object storage end-to-end tests', () => {
interceptGetBuckets().as('getBuckets');
interceptCreateBucket().as('createBucket');
interceptDeleteBucket(bucketLabel, bucketCluster).as('deleteBucket');
interceptGetNetworkUtilization().as('getNetworkUtilization');

mockAppendFeatureFlags({
objMultiCluster: makeFeatureFlagData(false),
}).as('getFeatureFlags');
mockGetFeatureFlagClientstream().as('getClientStream');

cy.visitWithLogin('/object-storage');
cy.wait(['@getFeatureFlags', '@getBuckets']);
cy.wait(['@getFeatureFlags', '@getBuckets', '@getNetworkUtilization']);

ui.button.findByTitle('Create Bucket').should('be.visible').click();
// Wait for loader to disappear, indicating that all buckets have been loaded.
// Mitigates test failures stemming from M3-7833.
cy.findByLabelText('Buckets').within(() => {
cy.findByLabelText('Content is loading').should('not.exist');
});

ui.entityHeader.find().within(() => {
ui.button.findByTitle('Create Bucket').should('be.visible').click();
});

ui.drawer
.findByTitle('Create Bucket')
Expand All @@ -145,6 +155,7 @@ describe('object storage end-to-end tests', () => {
});

cy.wait(['@createBucket', '@getBuckets']);
ui.drawer.find().should('not.exist');

// Confirm that bucket is created, initiate deletion.
cy.findByText(bucketLabel)
Expand Down
9 changes: 9 additions & 0 deletions packages/manager/cypress/support/intercepts/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -610,3 +610,12 @@ export const mockGetAccountLogins = (
paginateResponse(accountLogins)
);
};

/**
* Intercepts GET request to fetch the account network utilization data.
*
* @returns Cypress chainable.
*/
export const interceptGetNetworkUtilization = (): Cypress.Chainable<null> => {
return cy.intercept('GET', apiMatcher('account/transfer'));
};
Loading