diff --git a/packages/manager/.changeset/pr-10245-tests-1709311899662.md b/packages/manager/.changeset/pr-10245-tests-1709311899662.md new file mode 100644 index 00000000000..424d1453a52 --- /dev/null +++ b/packages/manager/.changeset/pr-10245-tests-1709311899662.md @@ -0,0 +1,5 @@ +--- +"@linode/manager": Tests +--- + +Resolve OBJ Bucket create/delete E2E test flake ([#10245](https://github.com/linode/manager/pull/10245)) diff --git a/packages/manager/cypress/e2e/core/objectStorage/object-storage.e2e.spec.ts b/packages/manager/cypress/e2e/core/objectStorage/object-storage.e2e.spec.ts index 88d2b0c1e16..91dbbdbfaec 100644 --- a/packages/manager/cypress/e2e/core/objectStorage/object-storage.e2e.spec.ts +++ b/packages/manager/cypress/e2e/core/objectStorage/object-storage.e2e.spec.ts @@ -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, @@ -120,6 +121,7 @@ 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), @@ -127,9 +129,17 @@ describe('object storage end-to-end tests', () => { 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') @@ -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) diff --git a/packages/manager/cypress/support/intercepts/account.ts b/packages/manager/cypress/support/intercepts/account.ts index 27838a71068..5d4fb4d5cd7 100644 --- a/packages/manager/cypress/support/intercepts/account.ts +++ b/packages/manager/cypress/support/intercepts/account.ts @@ -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 => { + return cy.intercept('GET', apiMatcher('account/transfer')); +};