diff --git a/packages/manager/.changeset/pr-11319-tests-1732544365525.md b/packages/manager/.changeset/pr-11319-tests-1732544365525.md new file mode 100644 index 00000000000..60cfd47fdc1 --- /dev/null +++ b/packages/manager/.changeset/pr-11319-tests-1732544365525.md @@ -0,0 +1,5 @@ +--- +"@linode/manager": Tests +--- + +Fix `machine-image-upload.spec.ts` test failures ([#11319](https://github.com/linode/manager/pull/11319)) diff --git a/packages/manager/cypress/e2e/core/images/machine-image-upload.spec.ts b/packages/manager/cypress/e2e/core/images/machine-image-upload.spec.ts index 49c084aef1b..929ed932684 100644 --- a/packages/manager/cypress/e2e/core/images/machine-image-upload.spec.ts +++ b/packages/manager/cypress/e2e/core/images/machine-image-upload.spec.ts @@ -5,7 +5,6 @@ import 'cypress-file-upload'; import { RecPartial } from 'factory.ts'; import { DateTime } from 'luxon'; import { authenticate } from 'support/api/authentication'; -import { fbtVisible, getClick } from 'support/helpers'; import { mockDeleteImage, mockGetCustomImages, @@ -84,9 +83,9 @@ const assertFailed = (label: string, id: string, message: string) => { ui.toast.assertMessage(`Image ${label} could not be uploaded: ${message}`); cy.get(`[data-qa-image-cell="${id}"]`).within(() => { - fbtVisible(label); - fbtVisible('Upload Failed'); - fbtVisible('N/A'); + cy.findByText(label).should('be.visible'); + cy.findByText('Upload Failed').should('be.visible'); // The status should be "Upload Failed" + cy.findAllByText('N/A').should('be.visible'); // The size should be "N/A" }); }; @@ -98,9 +97,9 @@ const assertFailed = (label: string, id: string, message: string) => { */ const assertProcessing = (label: string, id: string) => { cy.get(`[data-qa-image-cell="${id}"]`).within(() => { - fbtVisible(label); - fbtVisible('Pending Upload'); - fbtVisible('Pending'); + cy.findByText(label).should('be.visible'); + cy.findByText('Pending Upload').should('be.visible'); // The status should be "Pending Upload" + cy.findAllByText('Pending').should('be.visible'); // The size should be "Pending" }); }; @@ -115,8 +114,12 @@ const uploadImage = (label: string) => { const region = chooseRegion({ capabilities: ['Object Storage'] }); const upload = 'machine-images/test-image.gz'; cy.visitWithLogin('/images/create/upload'); - getClick('[id="label"][data-testid="textfield-input"]').type(label); - getClick('[id="description"]').type('This is a machine image upload test'); + + cy.findByLabelText('Label').click().type(label); + + cy.findByLabelText('Description') + .click() + .type('This is a machine image upload test'); ui.regionSelect.find().click(); ui.regionSelect.findItemByRegionId(region.id).click(); @@ -261,8 +264,8 @@ describe('machine image', () => { cy.wait('@getImages'); ui.toast.assertMessage(availableMessage); cy.get(`[data-qa-image-cell="${imageId}"]`).within(() => { - fbtVisible(label); - fbtVisible('Available'); + cy.findByText(label).should('be.visible'); + cy.findByText('Available').should('be.visible'); }); }); });