diff --git a/packages/manager/.changeset/pr-11756-tests-1741019349059.md b/packages/manager/.changeset/pr-11756-tests-1741019349059.md new file mode 100644 index 00000000000..d15aad5eb88 --- /dev/null +++ b/packages/manager/.changeset/pr-11756-tests-1741019349059.md @@ -0,0 +1,5 @@ +--- +"@linode/manager": Tests +--- + +Fix linting errors in additional directories in packages/manager/cypress/e2e ([#11756](https://github.com/linode/manager/pull/11756)) diff --git a/packages/manager/.eslintrc.cjs b/packages/manager/.eslintrc.cjs index 858b0250581..454bac78a4e 100644 --- a/packages/manager/.eslintrc.cjs +++ b/packages/manager/.eslintrc.cjs @@ -23,15 +23,6 @@ module.exports = { 'build', 'storybook-static', '.storybook', - 'e2e/core/longview', - 'e2e/core/managed', - 'e2e/core/nodebalancers', - 'e2e/core/notificationsAndEvents', - 'e2e/core/objectStorage', - 'e2e/core/objectStorageGen2', - 'e2e/core/objectStorageMulticluster', - 'e2e/core/oneClickApps', - 'e2e/core/parentChild', 'e2e/core/placementGroups', 'e2e/core/stackscripts', 'e2e/core/volumes', diff --git a/packages/manager/cypress/e2e/core/longview/longview.spec.ts b/packages/manager/cypress/e2e/core/longview/longview.spec.ts index ccd872b7aa7..78db13b4ed6 100644 --- a/packages/manager/cypress/e2e/core/longview/longview.spec.ts +++ b/packages/manager/cypress/e2e/core/longview/longview.spec.ts @@ -321,7 +321,8 @@ describe('longview', () => { .click(); cy.get(`[data-qa-longview-client="${client.id}"]`).within(() => { - cy.get(`[data-testid="textfield-input"]`).clear().type(newClient.label); + cy.get(`[data-testid="textfield-input"]`).clear(); + cy.focused().type(newClient.label); cy.get(`[aria-label="Save new label"]`).should('be.visible').click(); }); diff --git a/packages/manager/cypress/e2e/core/managed/managed-contacts.spec.ts b/packages/manager/cypress/e2e/core/managed/managed-contacts.spec.ts index 51c0f37871f..63d853cf8a8 100644 --- a/packages/manager/cypress/e2e/core/managed/managed-contacts.spec.ts +++ b/packages/manager/cypress/e2e/core/managed/managed-contacts.spec.ts @@ -86,18 +86,16 @@ describe('Managed Contacts tab', () => { .within(() => { cy.findByLabelText('Name', { exact: false }) .should('be.visible') - .click() - .type(contactName); + .click(); + cy.focused().type(contactName); cy.findByLabelText('E-mail', { exact: false }) .should('be.visible') - .click() - .type(contactEmail); + .click(); + cy.focused().type(contactEmail); - cy.findByLabelText('Primary Phone') - .should('be.visible') - .click() - .type(contactPrimaryPhone); + cy.findByLabelText('Primary Phone').should('be.visible').click(); + cy.focused().type(contactPrimaryPhone); ui.buttonGroup .findButtonByTitle('Add Contact') @@ -173,21 +171,19 @@ describe('Managed Contacts tab', () => { .within(() => { cy.findByLabelText('Name', { exact: false }) .should('be.visible') - .click() - .clear() - .type(contactNewName); + .click(); + cy.focused().clear(); + cy.focused().type(contactNewName); cy.findByLabelText('E-mail', { exact: false }) .should('be.visible') - .click() - .clear() - .type(contactNewEmail); + .click(); + cy.focused().clear(); + cy.focused().type(contactNewEmail); - cy.findByLabelText('Primary Phone') - .should('be.visible') - .click() - .clear() - .type(contactNewPrimaryPhone); + cy.findByLabelText('Primary Phone').should('be.visible').click(); + cy.focused().clear(); + cy.focused().type(contactNewPrimaryPhone); ui.buttonGroup .findButtonByTitle('Save Changes') @@ -241,10 +237,8 @@ describe('Managed Contacts tab', () => { .findByTitle(`Delete Contact ${contactName}?`) .should('be.visible') .within(() => { - cy.findByLabelText('Contact Name:') - .should('be.visible') - .click() - .type(contactName); + cy.findByLabelText('Contact Name:').should('be.visible').click(); + cy.focused().type(contactName); ui.buttonGroup .findButtonByTitle('Delete Contact') diff --git a/packages/manager/cypress/e2e/core/managed/managed-credentials.spec.ts b/packages/manager/cypress/e2e/core/managed/managed-credentials.spec.ts index 9ce26179ad9..9db0fe50925 100644 --- a/packages/manager/cypress/e2e/core/managed/managed-credentials.spec.ts +++ b/packages/manager/cypress/e2e/core/managed/managed-credentials.spec.ts @@ -76,20 +76,16 @@ describe('Managed Credentials tab', () => { .findByTitle('Add Credential') .should('be.visible') .within(() => { - cy.findByLabelText('Label') - .should('be.visible') - .click() - .type(credentialLabel); + cy.findByLabelText('Label').should('be.visible').click(); + cy.focused().type(credentialLabel); cy.findByLabelText('Username', { exact: false }) .should('be.visible') - .click() - .type(credentialUsername); + .click(); + cy.focused().type(credentialUsername); - cy.findByLabelText('Password') - .should('be.visible') - .click() - .type(credentialPassword); + cy.findByLabelText('Password').should('be.visible').click(); + cy.focused().type(credentialPassword); ui.buttonGroup .findButtonByTitle('Add Credential') @@ -150,11 +146,9 @@ describe('Managed Credentials tab', () => { .should('be.visible') .within(() => { // Update label. - cy.findByLabelText('Label') - .should('be.visible') - .click() - .clear() - .type(credentialNewLabel); + cy.findByLabelText('Label').should('be.visible').click(); + cy.focused().clear(); + cy.focused().type(credentialNewLabel); ui.button .findByTitle('Update label') @@ -168,13 +162,11 @@ describe('Managed Credentials tab', () => { // Update credentials. cy.findByLabelText('Username', { exact: false }) .should('be.visible') - .click() - .type(randomString()); + .click(); + cy.focused().type(randomString()); - cy.findByLabelText('Password') - .should('be.visible') - .click() - .type(randomString()); + cy.findByLabelText('Password').should('be.visible').click(); + cy.focused().type(randomString()); ui.button .findByTitle('Update credentials') @@ -232,10 +224,8 @@ describe('Managed Credentials tab', () => { .findByTitle(`Delete Credential ${credentialLabel}?`) .should('be.visible') .within(() => { - cy.findByLabelText('Credential Name:') - .should('be.visible') - .click() - .type(credentialLabel); + cy.findByLabelText('Credential Name:').should('be.visible').click(); + cy.focused().type(credentialLabel); ui.buttonGroup .findButtonByTitle('Delete Credential') diff --git a/packages/manager/cypress/e2e/core/managed/managed-monitors.spec.ts b/packages/manager/cypress/e2e/core/managed/managed-monitors.spec.ts index 115042854d3..33227ae887a 100644 --- a/packages/manager/cypress/e2e/core/managed/managed-monitors.spec.ts +++ b/packages/manager/cypress/e2e/core/managed/managed-monitors.spec.ts @@ -94,11 +94,9 @@ describe('Managed Monitors tab', () => { .findByTitle('Edit Monitor') .should('be.visible') .within(() => { - cy.findByLabelText('Monitor Label') - .should('be.visible') - .click() - .clear() - .type(newLabel); + cy.findByLabelText('Monitor Label').should('be.visible').click(); + cy.focused().clear(); + cy.focused().type(newLabel); mockUpdateServiceMonitor(1, newMonitor).as('updateMonitor'); mockGetServiceMonitors([newMonitor]).as('getMonitors'); @@ -183,14 +181,12 @@ describe('Managed Monitors tab', () => { .within(() => { cy.findByLabelText('Monitor Label', { exact: false }) .should('be.visible') - .click() - .type(monitorLabel); + .click(); + cy.focused().type(monitorLabel); // Can't `findByLabelText` because multiple elements with "URL" label exist. - cy.get('input[name="address"]') - .should('be.visible') - .click() - .type(monitorUrl); + cy.get('input[name="address"]').should('be.visible').click(); + cy.focused().type(monitorUrl); ui.buttonGroup .findButtonByTitle('Add Monitor') @@ -249,10 +245,8 @@ describe('Managed Monitors tab', () => { .findByTitle(`Delete Monitor ${monitorLabel}?`) .should('be.visible') .within(() => { - cy.findByLabelText('Monitor Name:') - .should('be.visible') - .click() - .type(monitorLabel); + cy.findByLabelText('Monitor Name:').should('be.visible').click(); + cy.focused().type(monitorLabel); ui.buttonGroup .findButtonByTitle('Delete Monitor') diff --git a/packages/manager/cypress/e2e/core/managed/managed-ssh.spec.ts b/packages/manager/cypress/e2e/core/managed/managed-ssh.spec.ts index 1dd368a3702..dab96aaae79 100644 --- a/packages/manager/cypress/e2e/core/managed/managed-ssh.spec.ts +++ b/packages/manager/cypress/e2e/core/managed/managed-ssh.spec.ts @@ -135,23 +135,17 @@ describe('Managed SSH Access tab', () => { .findByTitle(`Edit SSH Access for ${linodeLabel}`) .should('be.visible') .within(() => { - cy.findByLabelText('User Account') - .should('be.visible') - .click() - .clear() - .type(newUser); + cy.findByLabelText('User Account').should('be.visible').click(); + cy.focused().clear(); + cy.focused().type(newUser); // Set IP address to 'Any'. - cy.findByLabelText('IP Address') - .should('be.visible') - .click() - .type('Any{enter}'); + cy.findByLabelText('IP Address').should('be.visible').click(); + cy.focused().type('Any{enter}'); - cy.findByLabelText('Port') - .should('be.visible') - .click() - .clear() - .type(`${newPort}`); + cy.findByLabelText('Port').should('be.visible').click(); + cy.focused().clear(); + cy.focused().type(`${newPort}`); ui.button .findByTitle('Save Changes') diff --git a/packages/manager/cypress/e2e/core/nodebalancers/nodebalancers-create-in-complex-form.spec.ts b/packages/manager/cypress/e2e/core/nodebalancers/nodebalancers-create-in-complex-form.spec.ts index 1856008d777..f5e22d67fe4 100644 --- a/packages/manager/cypress/e2e/core/nodebalancers/nodebalancers-create-in-complex-form.spec.ts +++ b/packages/manager/cypress/e2e/core/nodebalancers/nodebalancers-create-in-complex-form.spec.ts @@ -55,42 +55,34 @@ describe('create NodeBalancer to test the submission of multiple nodes and multi interceptCreateNodeBalancer().as('createNodeBalancer'); cy.visitWithLogin('/nodebalancers/create'); - cy.get('[id="nodebalancer-label"]') - .should('be.visible') - .click() - .clear() - .type(nodeBal.label); - cy.findByPlaceholderText(/create a tag/i) - .click() - .type(entityTag); + cy.get('[id="nodebalancer-label"]').should('be.visible').click(); + cy.focused().clear(); + cy.focused().type(nodeBal.label); + cy.findByPlaceholderText(/create a tag/i).click(); + cy.focused().type(entityTag); // this will create the NB in newark, where the default Linode was created ui.regionSelect.find().click().clear().type(`${region.label}{enter}`); // node backend config - cy.findByText('Label').click().type(randomLabel()); - cy.findByLabelText('IP Address') - .should('be.visible') - .click() - .type(nodeBal.ipv4); + cy.findByText('Label').click(); + cy.focused().type(randomLabel()); + cy.findByLabelText('IP Address').should('be.visible').click(); + cy.focused().type(nodeBal.ipv4); ui.autocompletePopper .findByTitle(nodeBal.ipv4) .should('be.visible') .click(); - cy.findByLabelText('Weight') - .should('be.visible') - .click() - .clear() - .type('50'); + cy.findByLabelText('Weight').should('be.visible').click(); + cy.focused().clear(); + cy.focused().type('50'); // Add a backend node cy.get('[data-testid="button"]').contains('Add a Node').click(); - cy.findAllByText('Label').last().click().type(randomLabel()); - cy.findAllByText('IP Address') - .last() - .should('be.visible') - .click() - .type(nodeBal_2.ipv4); + cy.findAllByText('Label').last().click(); + cy.focused().type(randomLabel()); + cy.findAllByText('IP Address').last().should('be.visible').click(); + cy.focused().type(nodeBal_2.ipv4); ui.autocompletePopper .findByTitle(nodeBal_2.ipv4) .should('be.visible') @@ -98,9 +90,9 @@ describe('create NodeBalancer to test the submission of multiple nodes and multi cy.get('[data-testid="textfield-input"]') .last() .should('be.visible') - .click() - .clear() - .type('50'); + .click(); + cy.focused().clear(); + cy.focused().type('50'); // Confirm Summary info cy.get('[data-qa-summary="true"]').within(() => { @@ -155,24 +147,20 @@ describe('create NodeBalancer to test the submission of multiple nodes and multi interceptCreateNodeBalancer().as('createNodeBalancer'); cy.visitWithLogin('/nodebalancers/create'); - cy.get('[id="nodebalancer-label"]') - .should('be.visible') - .click() - .clear() - .type(nodeBal.label); - cy.findByPlaceholderText(/create a tag/i) - .click() - .type(entityTag); + cy.get('[id="nodebalancer-label"]').should('be.visible').click(); + cy.focused().clear(); + cy.focused().type(nodeBal.label); + cy.findByPlaceholderText(/create a tag/i).click(); + cy.focused().type(entityTag); // This will create the NB in newark, where the default Linode was created ui.regionSelect.find().click().clear().type(`${region.label}{enter}`); // Node backend config - cy.findByText('Label').click().type(randomLabel()); - cy.findByLabelText('IP Address') - .should('be.visible') - .click() - .type(nodeBal.ipv4); + cy.findByText('Label').click(); + cy.focused().type(randomLabel()); + cy.findByLabelText('IP Address').should('be.visible').click(); + cy.focused().type(nodeBal.ipv4); ui.autocompletePopper .findByTitle(nodeBal.ipv4) .should('be.visible') @@ -183,17 +171,13 @@ describe('create NodeBalancer to test the submission of multiple nodes and multi .contains('Add another Configuration') .click(); cy.get('[data-qa-panel="Configuration - Port "]').within(() => { - cy.get('[data-testid="textfield-input"]') - .first() - .click() - .type('8080'); + cy.get('[data-testid="textfield-input"]').first().click(); + cy.focused().type('8080'); }); - cy.findAllByText('Label').last().click().type(randomLabel()); - cy.findAllByText('IP Address') - .last() - .should('be.visible') - .click() - .type(nodeBal_2.ipv4); + cy.findAllByText('Label').last().click(); + cy.focused().type(randomLabel()); + cy.findAllByText('IP Address').last().should('be.visible').click(); + cy.focused().type(nodeBal_2.ipv4); ui.autocompletePopper .findByTitle(nodeBal_2.ipv4) .should('be.visible') @@ -236,24 +220,20 @@ describe('create NodeBalancer to test the submission of multiple nodes and multi }); cy.visitWithLogin('/nodebalancers/create'); - cy.get('[id="nodebalancer-label"]') - .should('be.visible') - .click() - .clear() - .type(nodeBal.label); - cy.findByPlaceholderText(/create a tag/i) - .click() - .type(entityTag); + cy.get('[id="nodebalancer-label"]').should('be.visible').click(); + cy.focused().clear(); + cy.focused().type(nodeBal.label); + cy.findByPlaceholderText(/create a tag/i).click(); + cy.focused().type(entityTag); // This will create the NB in newark, where the default Linode was created ui.regionSelect.find().click().clear().type(`${region.label}{enter}`); // Node backend config - cy.findByText('Label').click().type(randomLabel()); - cy.findByLabelText('IP Address') - .should('be.visible') - .click() - .type(nodeBal.ipv4); + cy.findByText('Label').click(); + cy.focused().type(randomLabel()); + cy.findByLabelText('IP Address').should('be.visible').click(); + cy.focused().type(nodeBal.ipv4); ui.autocompletePopper .findByTitle(nodeBal.ipv4) .should('be.visible') @@ -264,16 +244,20 @@ describe('create NodeBalancer to test the submission of multiple nodes and multi .contains('Add another Configuration') .click(); cy.get('[data-qa-panel="Configuration - Port "]').within(() => { - cy.get('[data-testid="textfield-input"]').first().click().type('80'); + cy.get('[data-testid="textfield-input"]').first().click(); + cy.focused().type('80'); }); cy.get('[data-qa-deploy-nodebalancer]').click(); // Confirm error displays - cy.contains('Port must be unique').scrollIntoView().should('be.visible'); - cy.contains('Label is required').scrollIntoView().should('be.visible'); + cy.contains('Port must be unique').as('qaPort').scrollIntoView(); + cy.get('@qaPort').should('be.visible'); + cy.contains('Label is required').as('qaLabelIs').scrollIntoView(); + cy.get('@qaLabelIs').should('be.visible'); cy.contains('Must be a valid private IPv4 address.') - .scrollIntoView() - .should('be.visible'); + .as('qaMustbe') + .scrollIntoView(); + cy.get('@qaMustbe').should('be.visible'); }); }); }); diff --git a/packages/manager/cypress/e2e/core/nodebalancers/smoke-create-nodebal.spec.ts b/packages/manager/cypress/e2e/core/nodebalancers/smoke-create-nodebal.spec.ts index 002eb96f629..9022ab6b9f7 100644 --- a/packages/manager/cypress/e2e/core/nodebalancers/smoke-create-nodebal.spec.ts +++ b/packages/manager/cypress/e2e/core/nodebalancers/smoke-create-nodebal.spec.ts @@ -33,14 +33,11 @@ const createNodeBalancerWithUI = ( const regionName = getRegionById(nodeBal.region).label; cy.visitWithLogin('/nodebalancers/create'); - cy.get('[id="nodebalancer-label"]') - .should('be.visible') - .click() - .clear() - .type(nodeBal.label); - cy.findByPlaceholderText(/create a tag/i) - .click() - .type(entityTag); + cy.get('[id="nodebalancer-label"]').should('be.visible').click(); + cy.focused().clear(); + cy.focused().type(nodeBal.label); + cy.findByPlaceholderText(/create a tag/i).click(); + cy.focused().type(entityTag); if (isDcPricingTest) { const newRegion = getRegionById('br-gru'); @@ -71,12 +68,11 @@ const createNodeBalancerWithUI = ( ui.regionSelect.find().click().clear().type(`${regionName}{enter}`); // node backend config - cy.findByText('Label').click().type(randomLabel()); + cy.findByText('Label').click(); + cy.focused().type(randomLabel()); - cy.findByLabelText('IP Address') - .should('be.visible') - .click() - .type(nodeBal.ipv4); + cy.findByLabelText('IP Address').should('be.visible').click(); + cy.focused().type(nodeBal.ipv4); ui.autocompletePopper.findByTitle(nodeBal.ipv4).should('be.visible').click(); @@ -144,7 +140,8 @@ describe('create NodeBalancer', () => { cy.findByLabelText('Label').type('my-node-1'); - cy.findByLabelText('IP Address').click().type(linode.ipv4[0]); + cy.findByLabelText('IP Address').click(); + cy.focused().type(linode.ipv4[0]); ui.autocompletePopper.findByTitle(linode.label).click(); diff --git a/packages/manager/cypress/e2e/core/notificationsAndEvents/events-menu.spec.ts b/packages/manager/cypress/e2e/core/notificationsAndEvents/events-menu.spec.ts index 79c1638848f..909218b1afd 100644 --- a/packages/manager/cypress/e2e/core/notificationsAndEvents/events-menu.spec.ts +++ b/packages/manager/cypress/e2e/core/notificationsAndEvents/events-menu.spec.ts @@ -51,8 +51,9 @@ describe('Notifications Menu', () => { // Confirm that all mocked events are shown in the notification menu. mockEvents.forEach((event) => { cy.get(`[data-qa-event="${event.id}"]`) - .scrollIntoView() - .should('be.visible'); + .as('qaEventId') + .scrollIntoView(); + cy.get('@qaEventId').should('be.visible'); }); }); }); @@ -102,8 +103,9 @@ describe('Notifications Menu', () => { // Confirm that first 20 events in response are displayed. shownEvents.forEach((event) => { cy.get(`[data-qa-event="${event.id}"]`) - .scrollIntoView() - .should('be.visible'); + .as('qaEventId') + .scrollIntoView(); + cy.get('@qaEventId').should('be.visible'); }); // Confirm that last 5 events in response are not displayed. diff --git a/packages/manager/cypress/e2e/core/objectStorage/access-key.e2e.spec.ts b/packages/manager/cypress/e2e/core/objectStorage/access-key.e2e.spec.ts index 07ca420e56d..5f851b1f7cc 100644 --- a/packages/manager/cypress/e2e/core/objectStorage/access-key.e2e.spec.ts +++ b/packages/manager/cypress/e2e/core/objectStorage/access-key.e2e.spec.ts @@ -57,7 +57,8 @@ describe('object storage access key end-to-end tests', () => { .findByTitle('Create Access Key') .should('be.visible') .within(() => { - cy.findByText('Label').click().type(keyLabel); + cy.findByText('Label').click(); + cy.focused().type(keyLabel); ui.buttonGroup .findButtonByTitle('Create Access Key') .should('be.visible') @@ -157,7 +158,8 @@ describe('object storage access key end-to-end tests', () => { .findByTitle('Create Access Key') .should('be.visible') .within(() => { - cy.findByText('Label').click().type(keyLabel); + cy.findByText('Label').click(); + cy.focused().type(keyLabel); cy.findByLabelText('Limited Access').click(); cy.findByLabelText('Select read-only for all').click(); diff --git a/packages/manager/cypress/e2e/core/objectStorage/access-keys.smoke.spec.ts b/packages/manager/cypress/e2e/core/objectStorage/access-keys.smoke.spec.ts index 05eb396a5d3..6f0710a2aa3 100644 --- a/packages/manager/cypress/e2e/core/objectStorage/access-keys.smoke.spec.ts +++ b/packages/manager/cypress/e2e/core/objectStorage/access-keys.smoke.spec.ts @@ -51,10 +51,13 @@ describe('object storage access keys smoke tests', () => { .findByTitle('Create Access Key') .should('be.visible') .within(() => { - cy.findByLabelText('Label').click().type(mockAccessKey.label); + cy.findByLabelText('Label').click(); + cy.focused().type(mockAccessKey.label); ui.buttonGroup .findButtonByTitle('Create Access Key') - .scrollIntoView() + .as('qaCreateAccessKey') + .scrollIntoView(); + cy.get('@qaCreateAccessKey') .should('be.visible') .should('be.enabled') .click(); 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 1fa96cb91c1..3792b228802 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 @@ -107,8 +107,10 @@ describe('object storage end-to-end tests', () => { .findByTitle('Create Bucket') .should('be.visible') .within(() => { - cy.findByText('Label').click().type(bucketLabel); - ui.regionSelect.find().click().type(`${bucketRegion}{enter}`); + cy.findByText('Label').click(); + cy.focused().type(bucketLabel); + ui.regionSelect.find().click(); + cy.focused().type(`${bucketRegion}{enter}`); ui.buttonGroup .findButtonByTitle('Create Bucket') @@ -133,7 +135,8 @@ describe('object storage end-to-end tests', () => { .findByTitle(`Delete Bucket ${bucketLabel}`) .should('be.visible') .within(() => { - cy.findByLabelText('Bucket Name').click().type(bucketLabel); + cy.findByLabelText('Bucket Name').click(); + cy.focused().type(bucketLabel); ui.buttonGroup .findButtonByTitle('Delete') .should('be.visible') @@ -178,8 +181,8 @@ describe('object storage end-to-end tests', () => { .should('be.visible') .should('not.have.value', 'Loading access...') .should('have.value', 'Private') - .click() - .type('Public Read'); + .click(); + cy.focused().type('Public Read'); ui.autocompletePopper .findByTitle('Public Read') diff --git a/packages/manager/cypress/e2e/core/objectStorage/object-storage.smoke.spec.ts b/packages/manager/cypress/e2e/core/objectStorage/object-storage.smoke.spec.ts index 479bd129fbb..21edeaed94c 100644 --- a/packages/manager/cypress/e2e/core/objectStorage/object-storage.smoke.spec.ts +++ b/packages/manager/cypress/e2e/core/objectStorage/object-storage.smoke.spec.ts @@ -62,8 +62,10 @@ describe('object storage smoke tests', () => { .findByTitle('Create Bucket') .should('be.visible') .within(() => { - cy.findByText('Label').click().type(bucketLabel); - ui.regionSelect.find().click().type(`${bucketRegion}{enter}`); + cy.findByText('Label').click(); + cy.focused().type(bucketLabel); + ui.regionSelect.find().click(); + cy.focused().type(`${bucketRegion}{enter}`); ui.buttonGroup .findButtonByTitle('Create Bucket') .should('be.visible') @@ -199,7 +201,8 @@ describe('object storage smoke tests', () => { .findByTitle(`Delete Bucket ${bucketLabel}`) .should('be.visible') .within(() => { - cy.findByLabelText('Bucket Name').click().type(bucketLabel); + cy.findByLabelText('Bucket Name').click(); + cy.focused().type(bucketLabel); ui.buttonGroup .findButtonByTitle('Delete') .should('be.enabled') diff --git a/packages/manager/cypress/e2e/core/objectStorageGen2/bucket-create-gen2.spec.ts b/packages/manager/cypress/e2e/core/objectStorageGen2/bucket-create-gen2.spec.ts index 5be1defc9f2..dfec433327e 100644 --- a/packages/manager/cypress/e2e/core/objectStorageGen2/bucket-create-gen2.spec.ts +++ b/packages/manager/cypress/e2e/core/objectStorageGen2/bucket-create-gen2.spec.ts @@ -186,8 +186,10 @@ describe('Object Storage Gen2 create bucket tests', () => { .findByTitle('Create Bucket') .should('be.visible') .within(() => { - cy.findByText('Label').click().type(bucketLabel); - ui.regionSelect.find().click().type(`${mockRegion.label}{enter}`); + cy.findByText('Label').click(); + cy.focused().type(bucketLabel); + ui.regionSelect.find().click(); + cy.focused().type(`${mockRegion.label}{enter}`); cy.findByLabelText('Object Storage Endpoint Type') .should('be.visible') .click(); @@ -264,7 +266,8 @@ describe('Object Storage Gen2 create bucket tests', () => { .findByTitle(`Delete Bucket ${bucketLabel}`) .should('be.visible') .within(() => { - cy.findByLabelText('Bucket Name').click().type(bucketLabel); + cy.findByLabelText('Bucket Name').click(); + cy.focused().type(bucketLabel); ui.buttonGroup .findButtonByTitle('Delete') .should('be.visible') @@ -324,8 +327,10 @@ describe('Object Storage Gen2 create bucket tests', () => { .findByTitle('Create Bucket') .should('be.visible') .within(() => { - cy.findByText('Label').click().type(bucketLabel); - ui.regionSelect.find().click().type(`${mockRegion.label}{enter}`); + cy.findByText('Label').click(); + cy.focused().type(bucketLabel); + ui.regionSelect.find().click(); + cy.focused().type(`${mockRegion.label}{enter}`); cy.findByLabelText('Object Storage Endpoint Type') .should('be.visible') .click(); @@ -387,7 +392,8 @@ describe('Object Storage Gen2 create bucket tests', () => { .findByTitle(`Delete Bucket ${bucketLabel}`) .should('be.visible') .within(() => { - cy.findByLabelText('Bucket Name').click().type(bucketLabel); + cy.findByLabelText('Bucket Name').click(); + cy.focused().type(bucketLabel); ui.buttonGroup .findButtonByTitle('Delete') .should('be.visible') @@ -447,8 +453,10 @@ describe('Object Storage Gen2 create bucket tests', () => { .findByTitle('Create Bucket') .should('be.visible') .within(() => { - cy.findByText('Label').click().type(bucketLabel); - ui.regionSelect.find().click().type(`${mockRegion.label}{enter}`); + cy.findByText('Label').click(); + cy.focused().type(bucketLabel); + ui.regionSelect.find().click(); + cy.focused().type(`${mockRegion.label}{enter}`); cy.findByLabelText('Object Storage Endpoint Type') .should('be.visible') .click(); @@ -508,7 +516,8 @@ describe('Object Storage Gen2 create bucket tests', () => { .findByTitle(`Delete Bucket ${bucketLabel}`) .should('be.visible') .within(() => { - cy.findByLabelText('Bucket Name').click().type(bucketLabel); + cy.findByLabelText('Bucket Name').click(); + cy.focused().type(bucketLabel); ui.buttonGroup .findButtonByTitle('Delete') .should('be.visible') @@ -568,8 +577,10 @@ describe('Object Storage Gen2 create bucket tests', () => { .findByTitle('Create Bucket') .should('be.visible') .within(() => { - cy.findByText('Label').click().type(bucketLabel); - ui.regionSelect.find().click().type(`${mockRegion.label}{enter}`); + cy.findByText('Label').click(); + cy.focused().type(bucketLabel); + ui.regionSelect.find().click(); + cy.focused().type(`${mockRegion.label}{enter}`); cy.findByLabelText('Object Storage Endpoint Type') .should('be.visible') .click(); @@ -629,7 +640,8 @@ describe('Object Storage Gen2 create bucket tests', () => { .findByTitle(`Delete Bucket ${bucketLabel}`) .should('be.visible') .within(() => { - cy.findByLabelText('Bucket Name').click().type(bucketLabel); + cy.findByLabelText('Bucket Name').click(); + cy.focused().type(bucketLabel); ui.buttonGroup .findButtonByTitle('Delete') .should('be.visible') @@ -703,7 +715,8 @@ describe('Object Storage Gen2 create bucket tests', () => { .click(); cy.contains('Label is required.').should('be.visible'); - cy.findByText('Label').click().type(bucketLabel); + cy.findByText('Label').click(); + cy.focused().type(bucketLabel); cy.contains('Label is required.').should('not.exist'); // confirms (mock) API error appears diff --git a/packages/manager/cypress/e2e/core/objectStorageMulticluster/access-keys-multicluster.spec.ts b/packages/manager/cypress/e2e/core/objectStorageMulticluster/access-keys-multicluster.spec.ts index 56e1e24d44f..790f12ff31e 100644 --- a/packages/manager/cypress/e2e/core/objectStorageMulticluster/access-keys-multicluster.spec.ts +++ b/packages/manager/cypress/e2e/core/objectStorageMulticluster/access-keys-multicluster.spec.ts @@ -87,10 +87,8 @@ describe('Object Storage Multicluster access keys', () => { .findByTitle('Create Access Key') .should('be.visible') .within(() => { - cy.contains('Label (required)') - .should('be.visible') - .click() - .type(mockAccessKey.label); + cy.contains('Label (required)').should('be.visible').click(); + cy.focused().type(mockAccessKey.label); cy.contains('Regions (required)').should('be.visible').click(); @@ -104,10 +102,8 @@ describe('Object Storage Multicluster access keys', () => { }); // Close the regions drop-down. - cy.contains('Regions (required)') - .should('be.visible') - .click() - .type('{esc}'); + cy.contains('Regions (required)').should('be.visible').click(); + cy.focused().type('{esc}'); // TODO Confirm expected regions are shown. ui.buttonGroup @@ -205,25 +201,19 @@ describe('Object Storage Multicluster access keys', () => { .findByTitle('Create Access Key') .should('be.visible') .within(() => { - cy.contains('Label (required)') - .should('be.visible') - .click() - .type(mockAccessKey.label); + cy.contains('Label (required)').should('be.visible').click(); + cy.focused().type(mockAccessKey.label); - cy.contains('Regions (required)') - .should('be.visible') - .click() - .type(`${mockRegion.label}{enter}`); + cy.contains('Regions (required)').should('be.visible').click(); + cy.focused().type(`${mockRegion.label}{enter}`); ui.autocompletePopper .findByTitle(`${mockRegion.label} (${mockRegion.id})`) .should('be.visible'); // Dismiss region drop-down. - cy.contains('Regions (required)') - .should('be.visible') - .click() - .type('{esc}'); + cy.contains('Regions (required)').should('be.visible').click(); + cy.focused().type('{esc}'); // Enable "Limited Access" toggle for access key and confirm Create button is disabled. cy.findByText('Limited Access').should('be.visible').click(); @@ -364,16 +354,12 @@ describe('Object Storage Multicluster access keys', () => { .findByTitle('Edit Access Key') .should('be.visible') .within(() => { - cy.contains('Label (required)') - .should('be.visible') - .click() - .type('{selectall}{backspace}') - .type(mockUpdatedAccessKey.label); + cy.contains('Label (required)').should('be.visible').click(); + cy.focused().type('{selectall}{backspace}'); + cy.focused().type(mockUpdatedAccessKey.label); - cy.contains('Regions (required)') - .should('be.visible') - .click() - .type(`${mockUpdatedRegion.label}{enter}{esc}`); + cy.contains('Regions (required)').should('be.visible').click(); + cy.focused().type(`${mockUpdatedRegion.label}{enter}{esc}`); cy.contains(mockUpdatedRegion.label).should('be.visible').and('exist'); diff --git a/packages/manager/cypress/e2e/core/objectStorageMulticluster/bucket-create-multicluster.spec.ts b/packages/manager/cypress/e2e/core/objectStorageMulticluster/bucket-create-multicluster.spec.ts index cccbd8542cd..a3ad4d53145 100644 --- a/packages/manager/cypress/e2e/core/objectStorageMulticluster/bucket-create-multicluster.spec.ts +++ b/packages/manager/cypress/e2e/core/objectStorageMulticluster/bucket-create-multicluster.spec.ts @@ -76,9 +76,11 @@ describe('Object Storage Multicluster Bucket create', () => { .should('be.visible') .within(() => { // Enter label. - cy.contains('Label').click().type(mockBucket.label); + cy.contains('Label').click(); + cy.focused().type(mockBucket.label); cy.log(`${mockRegionWithObj.label}`); - cy.contains('Region').click().type(mockRegionWithObj.label); + cy.contains('Region').click(); + cy.focused().type(mockRegionWithObj.label); ui.autocompletePopper .find() diff --git a/packages/manager/cypress/e2e/core/objectStorageMulticluster/bucket-delete-multicluster.spec.ts b/packages/manager/cypress/e2e/core/objectStorageMulticluster/bucket-delete-multicluster.spec.ts index d810cab82ab..669aea293c3 100644 --- a/packages/manager/cypress/e2e/core/objectStorageMulticluster/bucket-delete-multicluster.spec.ts +++ b/packages/manager/cypress/e2e/core/objectStorageMulticluster/bucket-delete-multicluster.spec.ts @@ -51,7 +51,8 @@ describe('Object Storage Multicluster Bucket delete', () => { .findByTitle(`Delete Bucket ${bucketLabel}`) .should('be.visible') .within(() => { - cy.findByLabelText('Bucket Name').click().type(bucketLabel); + cy.findByLabelText('Bucket Name').click(); + cy.focused().type(bucketLabel); ui.buttonGroup .findButtonByTitle('Delete') .should('be.enabled') diff --git a/packages/manager/cypress/e2e/core/objectStorageMulticluster/object-storage-objects-multicluster.spec.ts b/packages/manager/cypress/e2e/core/objectStorageMulticluster/object-storage-objects-multicluster.spec.ts index 1138f4f99dc..0281cfa2d35 100644 --- a/packages/manager/cypress/e2e/core/objectStorageMulticluster/object-storage-objects-multicluster.spec.ts +++ b/packages/manager/cypress/e2e/core/objectStorageMulticluster/object-storage-objects-multicluster.spec.ts @@ -185,10 +185,8 @@ describe('Object Storage Multicluster objects', () => { .findByTitle('Create Folder') .should('be.visible') .within(() => { - cy.findByLabelText('Folder Name') - .should('be.visible') - .click() - .type(bucketFolderName); + cy.findByLabelText('Folder Name').should('be.visible').click(); + cy.focused().type(bucketFolderName); ui.buttonGroup .findButtonByTitle('Create') @@ -228,7 +226,8 @@ describe('Object Storage Multicluster objects', () => { .findByTitle(`Delete Bucket ${bucketLabel}`) .should('be.visible') .within(() => { - cy.findByText('Bucket Name').click().type(bucketLabel); + cy.findByText('Bucket Name').click(); + cy.focused().type(bucketLabel); ui.buttonGroup .findButtonByTitle('Delete') @@ -279,8 +278,8 @@ describe('Object Storage Multicluster objects', () => { .should('be.visible') .should('not.have.value', 'Loading access...') .should('have.value', 'Private') - .click() - .type('Public Read'); + .click(); + cy.focused().type('Public Read'); ui.autocompletePopper .findByTitle('Public Read') diff --git a/packages/manager/cypress/e2e/core/oneClickApps/one-click-apps.spec.ts b/packages/manager/cypress/e2e/core/oneClickApps/one-click-apps.spec.ts index e7a748d2979..827533a2bfe 100644 --- a/packages/manager/cypress/e2e/core/oneClickApps/one-click-apps.spec.ts +++ b/packages/manager/cypress/e2e/core/oneClickApps/one-click-apps.spec.ts @@ -85,11 +85,10 @@ describe('OneClick Apps (OCA)', () => { cy.findAllByLabelText( `Info for "${getMarketplaceAppLabel(candidateStackScript.label)}"` ) + .as('qaInfoFor') .first() - .scrollIntoView() - .should('be.visible') - .should('be.enabled') - .click(); + .scrollIntoView(); + cy.get('@qaInfoFor').should('be.visible').should('be.enabled').click(); }); ui.drawer @@ -187,20 +186,18 @@ describe('OneClick Apps (OCA)', () => { "The username for the Linode's non-root admin/SSH user(must be lowercase) (required)" ) .should('be.visible') - .click() - .type(firstName); + .click(); + cy.focused().type(firstName); cy.findByLabelText( "The password for the Linode's non-root admin/SSH user (required)" ) .should('be.visible') - .click() - .type(password); + .click(); + cy.focused().type(password); - cy.findByLabelText('World Name (required)') - .should('be.visible') - .click() - .type(levelName); + cy.findByLabelText('World Name (required)').should('be.visible').click(); + cy.focused().type(levelName); // Check each field should persist when moving onto another field cy.findByLabelText( @@ -214,12 +211,12 @@ describe('OneClick Apps (OCA)', () => { cy.findByLabelText('World Name (required)').should('have.value', levelName); // Choose an image - cy.findByPlaceholderText('Choose an image') - .click() - .type('{downArrow}{enter}'); + cy.findByPlaceholderText('Choose an image').click(); + cy.focused().type('{downArrow}{enter}'); // Choose a region - ui.regionSelect.find().click().type(`${region.id}{enter}`); + ui.regionSelect.find().click(); + cy.focused().type(`${region.id}{enter}`); // Choose a Linode plan cy.get('[data-qa-plan-row="Dedicated 8 GB"]') @@ -229,10 +226,8 @@ describe('OneClick Apps (OCA)', () => { }); // Enter a label. - cy.findByText('Linode Label') - .should('be.visible') - .click() - .type(linodeLabel); + cy.findByText('Linode Label').should('be.visible').click(); + cy.focused().type(linodeLabel); // Choose a Root Password cy.get('[id="root-password"]').type(rootPassword); @@ -282,8 +277,10 @@ describe('OneClick Apps (OCA)', () => { cy.findAllByLabelText( `Info for "${getMarketplaceAppLabel(candidateStackScript.label)}"` ) + .as('qaInfoFor') .first() - .scrollIntoView() + .scrollIntoView(); + cy.get('@qaInfoFor') .should('be.visible') .should('be.enabled') .click(); diff --git a/packages/manager/cypress/e2e/core/parentChild/account-switching.spec.ts b/packages/manager/cypress/e2e/core/parentChild/account-switching.spec.ts index cfb59e42e07..c14eda35f46 100644 --- a/packages/manager/cypress/e2e/core/parentChild/account-switching.spec.ts +++ b/packages/manager/cypress/e2e/core/parentChild/account-switching.spec.ts @@ -350,7 +350,8 @@ describe('Parent/Child account switching', () => { // Confirm no results message. mockGetChildAccounts([]).as('getEmptySearchResults'); - cy.findByPlaceholderText('Search').click().type('Fake Name'); + cy.findByPlaceholderText('Search').click(); + cy.focused().type('Fake Name'); cy.wait('@getEmptySearchResults'); cy.contains(mockChildAccount.company).should('not.exist'); @@ -360,10 +361,9 @@ describe('Parent/Child account switching', () => { // Confirm filtering by company name displays only one search result. mockGetChildAccounts([mockChildAccount]).as('getSearchResults'); - cy.findByPlaceholderText('Search') - .click() - .clear() - .type(mockChildAccount.company); + cy.findByPlaceholderText('Search').click(); + cy.focused().clear(); + cy.focused().type(mockChildAccount.company); cy.wait('@getSearchResults'); cy.findByText(mockChildAccount.company).should('be.visible'); diff --git a/packages/manager/cypress/e2e/core/parentChild/token-scopes.spec.ts b/packages/manager/cypress/e2e/core/parentChild/token-scopes.spec.ts index ddfbdab9566..845701b9c90 100644 --- a/packages/manager/cypress/e2e/core/parentChild/token-scopes.spec.ts +++ b/packages/manager/cypress/e2e/core/parentChild/token-scopes.spec.ts @@ -91,12 +91,9 @@ describe('Token scopes', () => { ); // Specify a label and re-submit. - cy.findByLabelText('Label') - .scrollIntoView() - .should('be.visible') - .should('be.enabled') - .click() - .type(mockParentAccountToken.label); + cy.findByLabelText('Label').as('qaLabel').scrollIntoView(); + cy.get('@qaLabel').should('be.visible').should('be.enabled').click(); + cy.focused().type(mockParentAccountToken.label); ui.buttonGroup .findButtonByTitle('Create Token') @@ -160,8 +157,9 @@ describe('Token scopes', () => { .within(() => { // Confirm that the “Child account access” grant is not visible in the list of permissions. cy.findAllByText('Child Account Access') - .scrollIntoView() - .should('be.visible'); + .as('qaChildAccount') + .scrollIntoView(); + cy.get('@qaChildAccount').should('be.visible'); // Specify ALL scopes by selecting the "No Access" Select All radio button. cy.get('[data-qa-perm-rw-radio]').click(); @@ -172,12 +170,9 @@ describe('Token scopes', () => { ); // Specify a label and re-submit. - cy.findByLabelText('Label') - .scrollIntoView() - .should('be.visible') - .should('be.enabled') - .click() - .type(mockParentAccountToken.label); + cy.findByLabelText('Label').as('qaLabel').scrollIntoView(); + cy.get('@qaLabel').should('be.visible').should('be.enabled').click(); + cy.focused().type(mockParentAccountToken.label); ui.buttonGroup .findButtonByTitle('Create Token')