From 0f84e447a7e8a8f8ce61632472cbc708b3403587 Mon Sep 17 00:00:00 2001 From: Jannik Pulfer Date: Mon, 4 Nov 2024 13:54:20 +0100 Subject: [PATCH] Add delay 0 to all type exections in commands.ts --- frontend/cypress/support/commands.ts | 40 +++++++++++++++------------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/frontend/cypress/support/commands.ts b/frontend/cypress/support/commands.ts index 1fa1df2314..8a75492aba 100644 --- a/frontend/cypress/support/commands.ts +++ b/frontend/cypress/support/commands.ts @@ -41,11 +41,11 @@ Cypress.Commands.add( description?: string, createKeyResults: boolean = false, ) => { - cy.getByTestId('title').first().clear().type(objectiveTitle); + cy.getByTestId('title').first().clear().type(objectiveTitle, { delay: 0 }); cy.getByTestId('description') .first() .clear() - .type(description || 'This is the description of the new Objective'); + .type(description || 'This is the description of the new Objective', { delay: 0 }); if (quarter) { cy.get('select#quarter').select(quarter); } @@ -59,13 +59,13 @@ Cypress.Commands.add( Cypress.Commands.add( 'fillOutCheckInMetric', (currentValue: number, shouldChangeConfidence: number, changeInfo: string | null, initiatives: string | null) => { - cy.getByTestId('check-in-metric-value').clear().type(currentValue.toString()); + cy.getByTestId('check-in-metric-value').clear().type(currentValue.toString(), { delay: 0 }); setConfidence(shouldChangeConfidence); if (changeInfo) { - cy.getByTestId('changeInfo').clear().type(changeInfo!); + cy.getByTestId('changeInfo').clear().type(changeInfo!, { delay: 0 }); } if (initiatives) { - cy.getByTestId('initiatives').clear().type(initiatives!); + cy.getByTestId('initiatives').clear().type(initiatives!, { delay: 0 }); } cy.getByTestId('submit-check-in').click(); }, @@ -90,10 +90,10 @@ Cypress.Commands.add( } setConfidence(confidence); if (changeInfo) { - cy.getByTestId('changeInfo').clear().type(changeInfo!); + cy.getByTestId('changeInfo').clear().type(changeInfo!, { delay: 0 }); } if (initiatives) { - cy.getByTestId('initiatives').clear().type(initiatives!); + cy.getByTestId('initiatives').clear().type(initiatives!, { delay: 0 }); } cy.getByTestId('submit-check-in').click(); }, @@ -121,7 +121,7 @@ Cypress.Commands.add('createOrdinalKeyresult', (title: string | null = null, own cy.contains('Key Result erfassen'); cy.contains('Jaya Norris'); cy.contains('Titel'); - cy.getByTestId('titleInput').type('Title'); + cy.getByTestId('titleInput').type('Title', { delay: 0 }); cy.getByTestId('ordinalTab').click(); cy.contains('Metrisch'); cy.contains('Ordinal'); @@ -204,20 +204,24 @@ Cypress.Commands.add( owner: string | null, description: string, ) => { - cy.getByTestId('titleInput').clear().type(title); + cy.getByTestId('titleInput').clear().type(title, { delay: 0 }); if (commitZone == null) { cy.getByTestId('unit').select(unit!); - cy.getByTestId('baseline').clear().type(baseline!); - cy.getByTestId('stretchGoal').clear().type(stretchGoal!); + cy.getByTestId('baseline').clear().type(baseline!, { delay: 0 }); + cy.getByTestId('stretchGoal').clear().type(stretchGoal!, { delay: 0 }); } else { - cy.getByTestId('commitZone').clear().type(commitZone!); - cy.getByTestId('targetZone').clear().type(targetZone!); - cy.getByTestId('stretchZone').clear().type(stretchZone!); + cy.getByTestId('commitZone').clear().type(commitZone!, { delay: 0 }); + cy.getByTestId('targetZone').clear().type(targetZone!, { delay: 0 }); + cy.getByTestId('stretchZone').clear().type(stretchZone!, { delay: 0 }); } if (owner != null) { - cy.getByTestId('ownerInput').clear().type(owner).type('{downarrow}').type('{enter}'); + cy.getByTestId('ownerInput') + .clear() + .type(owner, { delay: 0 }) + .type('{downarrow}', { delay: 0 }) + .type('{enter}', { delay: 0 }); } - cy.getByTestId('descriptionInput').clear().type(description); + cy.getByTestId('descriptionInput').clear().type(description, { delay: 0 }); }, ); @@ -247,8 +251,8 @@ function loginWithCredentials(username: string, password: string) { cy.visit('/'); cy.intercept('GET', '**/users/current').as('getCurrentUser'); cy.origin(Cypress.env('login_url'), { args: { username, password } }, ({ username, password }) => { - cy.get('input[name="username"]').type(username); - cy.get('input[name="password"]').type(password); + cy.get('input[name="username"]').type(username, { delay: 0 }); + cy.get('input[name="password"]').type(password, { delay: 0 }); cy.get('button[type="submit"]').click(); cy.wait('@getCurrentUser', { responseTimeout: 10000 }); });