From 34d992d1f79550da11b3e55c1e555c9ca0da7712 Mon Sep 17 00:00:00 2001 From: Jannik Pulfer Date: Mon, 4 Nov 2024 13:47:36 +0100 Subject: [PATCH] Add delay 0 to all cypress inputs --- frontend/cypress/e2e/checkIn.cy.ts | 10 ++-- frontend/cypress/e2e/crud.cy.ts | 2 +- frontend/cypress/e2e/duplicated-scoring.cy.ts | 4 +- frontend/cypress/e2e/keyresult.cy.ts | 36 +++++++-------- frontend/cypress/e2e/objective-backlog.cy.ts | 6 +-- frontend/cypress/e2e/objective.cy.ts | 8 ++-- frontend/cypress/e2e/scoring.cy.ts | 10 ++-- frontend/cypress/e2e/tab.cy.ts | 46 +++++++++---------- frontend/cypress/e2e/teammanagement.cy.ts | 12 ++--- 9 files changed, 67 insertions(+), 67 deletions(-) diff --git a/frontend/cypress/e2e/checkIn.cy.ts b/frontend/cypress/e2e/checkIn.cy.ts index 45728dedc0..9f92ded83f 100644 --- a/frontend/cypress/e2e/checkIn.cy.ts +++ b/frontend/cypress/e2e/checkIn.cy.ts @@ -104,7 +104,7 @@ describe('OKR Check-in e2e tests', () => { cy.getByTestId('objective').first().getByTestId('add-keyResult').first().click(); cy.getByTestId('submit').should('be.disabled'); - cy.getByTestId('titleInput').type('Title'); + cy.getByTestId('titleInput').type('Title', { delay: 0 }); cy.getByTestId('ordinalTab').click(); cy.fillOutKeyResult( @@ -203,11 +203,11 @@ describe('OKR Check-in e2e tests', () => { cy.contains('CHF 30.-'); cy.contains('Confidence um Target Zone (CHF 213.-) zu erreichen'); cy.contains('5/10'); - cy.getByTestId('check-in-metric-value').click().clear().type('200'); + cy.getByTestId('check-in-metric-value').click().clear().type('200', { delay: 0 }); cy.getByTestId('confidence-slider').realMouseDown(); cy.contains('Here we are'); cy.contains('A cat would be great'); - cy.getByTestId('changeInfo').clear().type('We bought a new sheep'); + cy.getByTestId('changeInfo').clear().type('We bought a new sheep', { delay: 0 }); cy.getByTestId('submit-check-in').click(); cy.wait(200); @@ -219,7 +219,7 @@ describe('OKR Check-in e2e tests', () => { cy.getByTestId('objective').first().getByTestId('add-keyResult').first().click(); cy.getByTestId('submit').should('be.disabled'); - cy.getByTestId('titleInput').type('Title'); + cy.getByTestId('titleInput').type('Title', { delay: 0 }); cy.getByTestId('ordinalTab').click(); cy.fillOutKeyResult( @@ -250,7 +250,7 @@ describe('OKR Check-in e2e tests', () => { cy.getByTestId('confidence-slider').realMouseDown(); cy.contains('There is a new car'); cy.contains('Buy now a new pool'); - cy.getByTestId('changeInfo').clear().type('We bought a new dog'); + cy.getByTestId('changeInfo').clear().type('We bought a new dog', { delay: 0 }); cy.getByTestId('submit-check-in').click(); cy.wait(200); diff --git a/frontend/cypress/e2e/crud.cy.ts b/frontend/cypress/e2e/crud.cy.ts index bbe1dec6cc..11015d21df 100644 --- a/frontend/cypress/e2e/crud.cy.ts +++ b/frontend/cypress/e2e/crud.cy.ts @@ -32,7 +32,7 @@ describe('CRUD operations', () => { it(`Create objective, should display error message`, () => { cy.getByTestId('add-objective').first().click(); - cy.getByTestId('title').first().type('description').clear(); + cy.getByTestId('title').first().type('description', { delay: 0 }).clear(); cy.contains('Titel muss folgende Länge haben: 2-250 Zeichen'); cy.getByTestId('safe').should('be.disabled'); cy.getByTestId('safe-draft').should('be.disabled'); diff --git a/frontend/cypress/e2e/duplicated-scoring.cy.ts b/frontend/cypress/e2e/duplicated-scoring.cy.ts index d1152ced59..a87e7b3e1e 100644 --- a/frontend/cypress/e2e/duplicated-scoring.cy.ts +++ b/frontend/cypress/e2e/duplicated-scoring.cy.ts @@ -15,8 +15,8 @@ describe('e2e test for scoring adjustment on objective duplicate', () => { cy.getByTestId(`stretch-radio`).click(); cy.getByTestId('confidence-slider').click(); cy.realPress('{rightarrow}').realPress('{rightarrow}').realPress('{rightarrow}'); - cy.getByTestId('changeInfo').click().type('Testveränderungen'); - cy.getByTestId('initiatives').click().type('Testmassnahmen'); + cy.getByTestId('changeInfo').click().type('Testveränderungen', { delay: 0 }); + cy.getByTestId('initiatives').click().type('Testmassnahmen', { delay: 0 }); cy.getByTestId('submit-check-in').click(); cy.getByTestId('close-drawer').click({ force: true }); diff --git a/frontend/cypress/e2e/keyresult.cy.ts b/frontend/cypress/e2e/keyresult.cy.ts index f7f9ef7b67..920400db7d 100644 --- a/frontend/cypress/e2e/keyresult.cy.ts +++ b/frontend/cypress/e2e/keyresult.cy.ts @@ -76,7 +76,7 @@ describe('OKR Overview', () => { cy.getByTestId('objective').first().getByTestId('add-keyResult').first().click(); cy.contains('Key Result erfassen'); cy.contains('Jaya Norris'); - cy.getByTestId('titleInput').type('Title'); + cy.getByTestId('titleInput').type('Title', { delay: 0 }); cy.getByTestId('ordinalTab').click(); cy.fillOutKeyResult( @@ -94,10 +94,10 @@ describe('OKR Overview', () => { cy.getByTestId('submit').should('not.be.disabled'); cy.getByTestId('actionInput').should('have.length', 3); - cy.getByTestId('actionInput').first().type('A new car'); - cy.getByTestId('actionInput').last().type('A new house'); + cy.getByTestId('actionInput').first().type('A new car', { delay: 0 }); + cy.getByTestId('actionInput').last().type('A new house', { delay: 0 }); cy.getByTestId('add-action-plan-line').click(); - cy.getByTestId('actionInput').last().type('A new company'); + cy.getByTestId('actionInput').last().type('A new company', { delay: 0 }); cy.getByTestId('actionInput').first().should('have.value', 'A new car'); cy.getByTestId('actionInput').last().should('have.value', 'A new company'); @@ -222,67 +222,67 @@ describe('OKR Overview', () => { cy.getByTestId('submit').should('be.disabled'); cy.contains('Titel muss folgende Länge haben: 2-250 Zeichen'); - cy.getByTestId('titleInput').type('My title'); + cy.getByTestId('titleInput').type('My title', { delay: 0 }); cy.getByTestId('submit').should('not.be.disabled'); cy.getByTestId('baseline').clear(); cy.getByTestId('submit').should('be.disabled'); cy.contains('Baseline muss eine Zahl sein'); - cy.getByTestId('baseline').type('abc'); + cy.getByTestId('baseline').type('abc', { delay: 0 }); cy.getByTestId('submit').should('be.disabled'); cy.contains('Baseline muss eine Zahl sein'); cy.getByTestId('baseline').clear(); - cy.getByTestId('baseline').type('45'); + cy.getByTestId('baseline').type('45', { delay: 0 }); cy.getByTestId('submit').should('not.be.disabled'); cy.getByTestId('stretchGoal').clear(); cy.getByTestId('submit').should('be.disabled'); cy.contains('Stretch Goal muss eine Zahl sein'); - cy.getByTestId('stretchGoal').type('abc'); + cy.getByTestId('stretchGoal').type('abc', { delay: 0 }); cy.getByTestId('submit').should('be.disabled'); cy.contains('Stretch Goal muss eine Zahl sein'); cy.getByTestId('stretchGoal').clear(); - cy.getByTestId('stretchGoal').type('83'); + cy.getByTestId('stretchGoal').type('83', { delay: 0 }); cy.getByTestId('submit').should('not.be.disabled'); cy.getByTestId('ownerInput').clear(); cy.getByTestId('submit').should('be.disabled'); - cy.getByTestId('ownerInput').type('abc'); - cy.getByTestId('titleInput').type('Hello'); + cy.getByTestId('ownerInput').type('abc', { delay: 0 }); + cy.getByTestId('titleInput').type('Hello', { delay: 0 }); cy.getByTestId('submit').should('be.disabled'); cy.contains('Owner muss ausgewählt sein'); cy.getByTestId('ownerInput').clear(); - cy.getByTestId('ownerInput').type('Pac').type('{downarrow}').type('{enter}'); + cy.getByTestId('ownerInput').type('Pac').type('{downarrow}', { delay: 0 }).type('{enter}', { delay: 0 }); cy.getByTestId('submit').should('not.be.disabled'); cy.getByTestId('ordinalTab').click(); cy.getByTestId('submit').should('be.disabled'); - cy.getByTestId('commitZone').clear().type('Commit'); - cy.getByTestId('targetZone').clear().type('Target'); - cy.getByTestId('stretchZone').clear().type('Stretch'); + cy.getByTestId('commitZone').clear().type('Commit', { delay: 0 }); + cy.getByTestId('targetZone').clear().type('Target', { delay: 0 }); + cy.getByTestId('stretchZone').clear().type('Stretch', { delay: 0 }); cy.getByTestId('submit').should('not.be.disabled'); cy.getByTestId('commitZone').clear(); cy.getByTestId('submit').should('be.disabled'); cy.contains('Commit Zone muss folgende Länge haben: 1-400 Zeichen'); - cy.getByTestId('commitZone').type('Commit'); + cy.getByTestId('commitZone').type('Commit', { delay: 0 }); cy.getByTestId('submit').should('not.be.disabled'); cy.getByTestId('targetZone').clear(); cy.getByTestId('submit').should('be.disabled'); cy.contains('Target Zone muss folgende Länge haben: 1-400 Zeichen'); - cy.getByTestId('targetZone').type('Target'); + cy.getByTestId('targetZone').type('Target', { delay: 0 }); cy.getByTestId('submit').should('not.be.disabled'); cy.getByTestId('stretchZone').clear(); cy.getByTestId('submit').should('be.disabled'); cy.contains('Stretch Zone muss folgende Länge haben: 1-400 Zeichen'); - cy.getByTestId('stretchZone').type('Commit'); + cy.getByTestId('stretchZone').type('Commit', { delay: 0 }); cy.getByTestId('submit').should('not.be.disabled'); }); diff --git a/frontend/cypress/e2e/objective-backlog.cy.ts b/frontend/cypress/e2e/objective-backlog.cy.ts index 5706262f4d..71e080c68c 100644 --- a/frontend/cypress/e2e/objective-backlog.cy.ts +++ b/frontend/cypress/e2e/objective-backlog.cy.ts @@ -9,7 +9,7 @@ describe('OKR Objective Backlog e2e tests', () => { it(`Create Objective in backlog quarter should not have save button`, () => { cy.getByTestId('add-objective').first().click(); - cy.getByTestId('title').first().clear().type('Objective in quarter backlog'); + cy.getByTestId('title').first().clear().type('Objective in quarter backlog', { delay: 0 }); cy.get('select#quarter').select('Backlog'); cy.contains('Speichern').should('not.exist'); @@ -67,7 +67,7 @@ describe('OKR Objective Backlog e2e tests', () => { it(`Can release Objective to another quarter from backlog`, () => { cy.visit('/?quarter=999'); cy.getByTestId('add-objective').first().click(); - cy.getByTestId('title').first().clear().type('We can not release this'); + cy.getByTestId('title').first().clear().type('We can not release this', { delay: 0 }); cy.getByTestId('safe').should('not.exist'); cy.getByTestId('safe-draft').click(); @@ -86,7 +86,7 @@ describe('OKR Objective Backlog e2e tests', () => { cy.contains('Objective veröffentlichen'); - cy.getByTestId('title').first().clear().type('This is our first released objective'); + cy.getByTestId('title').first().clear().type('This is our first released objective', { delay: 0 }); cy.get('select#quarter').should('not.contain', 'Backlog'); cy.get('select#quarter').select('GJ ForTests'); diff --git a/frontend/cypress/e2e/objective.cy.ts b/frontend/cypress/e2e/objective.cy.ts index 758d7687a3..9a98c1e049 100644 --- a/frontend/cypress/e2e/objective.cy.ts +++ b/frontend/cypress/e2e/objective.cy.ts @@ -177,22 +177,22 @@ describe('OKR Objective e2e tests', () => { cy.wait(500); cy.getByTestId('objectiveSearch').first().click(); - cy.getByTestId('objectiveSearch').first().type('Search after').wait(350); + cy.getByTestId('objectiveSearch').first().type('Search after', { delay: 0 }).wait(350); cy.contains('Search after this objective'); cy.get('We dont want to search for this').should('not.exist'); - cy.getByTestId('objectiveSearch').first().clear().type('this').wait(350); + cy.getByTestId('objectiveSearch').first().clear().type('this', { delay: 0 }).wait(350); cy.contains('Search after this objective'); cy.contains('We dont want to search for this'); - cy.getByTestId('objectiveSearch').first().clear().type('dont want to').wait(350); + cy.getByTestId('objectiveSearch').first().clear().type('dont want to', { delay: 0 }).wait(350); cy.contains('We dont want to search for this'); cy.get('Search after this objective').should('not.exist'); - cy.getByTestId('objectiveSearch').first().clear().type('there is no objective').wait(350); + cy.getByTestId('objectiveSearch').first().clear().type('there is no objective', { delay: 0 }).wait(350); cy.get('We dont want to search for this').should('not.exist'); cy.get('Search after this objective').should('not.exist'); diff --git a/frontend/cypress/e2e/scoring.cy.ts b/frontend/cypress/e2e/scoring.cy.ts index 1a22f91596..1a84722697 100644 --- a/frontend/cypress/e2e/scoring.cy.ts +++ b/frontend/cypress/e2e/scoring.cy.ts @@ -65,8 +65,8 @@ describe('Scoring component e2e tests', () => { cy.getByTestId(`${zoneName}-radio`).click(); cy.getByTestId('confidence-slider').click(); cy.realPress('{rightarrow}').realPress('{rightarrow}').realPress('{rightarrow}'); - cy.getByTestId('changeInfo').click().type('Testveränderungen'); - cy.getByTestId('initiatives').click().type('Testmassnahmen'); + cy.getByTestId('changeInfo').click().type('Testveränderungen', { delay: 0 }); + cy.getByTestId('initiatives').click().type('Testmassnahmen', { delay: 0 }); cy.getByTestId('submit-check-in').click(); const percentage = getPercentageOrdinal(zoneName); cy.validateScoring(false, percentage); @@ -80,10 +80,10 @@ function setupMetricKR(baseline: number, stretchgoal: number, value: number) { cy.createMetricKeyresult('Metric scoring keyresult', String(baseline), String(stretchgoal)); cy.getByTestId('keyresult').get(':contains("Metric scoring keyresult")').last().click(); cy.getByTestId('add-check-in').click(); - cy.getByTestId('check-in-metric-value').clear().type(String(value)); + cy.getByTestId('check-in-metric-value').clear().type(String(value), { delay: 0 }); cy.getByTestId('confidence-slider').click(); cy.realPress('{rightarrow}').realPress('{rightarrow}').realPress('{rightarrow}'); - cy.getByTestId('changeInfo').click().type('Testveränderungen'); - cy.getByTestId('initiatives').click().type('Testmassnahmen'); + cy.getByTestId('changeInfo').click().type('Testveränderungen', { delay: 0 }); + cy.getByTestId('initiatives').click().type('Testmassnahmen', { delay: 0 }); cy.getByTestId('submit-check-in').click(); } diff --git a/frontend/cypress/e2e/tab.cy.ts b/frontend/cypress/e2e/tab.cy.ts index 4d1cdd714b..49b04dda1a 100644 --- a/frontend/cypress/e2e/tab.cy.ts +++ b/frontend/cypress/e2e/tab.cy.ts @@ -41,8 +41,8 @@ describe('Tab workflow tests', () => { } function editInputFields(message: string) { - cy.focused().type('{selectall}{backspace}'); - cy.focused().type(message); + cy.focused().type('{selectall}{backspace}', { delay: 0 }); + cy.focused().type(message, { delay: 0 }); } function fillInNewKeyResult() { @@ -52,7 +52,7 @@ describe('Tab workflow tests', () => { cy.realPress('ArrowDown'); // -> Entspricht Bob Baumeister (Stand 13.11.2023) cy.realPress('Enter'); cy.tabForward(); - cy.focused().type('Description!'); + cy.focused().type('Description!', { delay: 0 }); cy.tabForward(); cy.realType('Action point one'); cy.tabForward(); @@ -110,9 +110,9 @@ describe('Tab workflow tests', () => { cy.wait(500); cy.contains('erfassen'); cy.tabForward(); - cy.focused().type('Objective by Cypress'); + cy.focused().type('Objective by Cypress', { delay: 0 }); cy.tabForward(); - cy.focused().type('Description of Objective...'); + cy.focused().type('Description of Objective...', { delay: 0 }); cy.tabForward(); cy.tabForward(); cy.tabForward(); @@ -150,7 +150,7 @@ describe('Tab workflow tests', () => { cy.tabForward(); cy.focused().contains('GJ'); cy.tabForward(); - cy.focused().type('Objective').wait(350); // Decided to try writing since this changes the url. Sadly you can't use contains on placeholders otherwise I would have done that + cy.focused().type('Objective', { delay: 0 }).wait(350); // Decided to try writing since this changes the url. Sadly you can't use contains on placeholders otherwise I would have done that cy.url().should('include', 'objectiveQuery=objective'); cy.tabForward(); cy.tabForward(); @@ -252,7 +252,7 @@ describe('Tab workflow tests', () => { cy.realPress('Enter'); cy.tabForward(); cy.tabForward(); - cy.focused().type('The optional comment'); + cy.focused().type('The optional comment', { delay: 0 }); cy.tabForward(); cy.realPress('Enter'); @@ -342,16 +342,16 @@ describe('Tab workflow tests', () => { openCreateKeyResult(); cy.wait(500); cy.tabForward(); - cy.focused().type('KeyResult metric by Cypress'); + cy.focused().type('KeyResult metric by Cypress', { delay: 0 }); cy.contains('Einheit'); cy.tabForward(); cy.tabForward(); cy.tabForward(); // -> unit cy.realPress('ArrowDown'); // -> Entspricht "CHF" cy.tabForward(); // -> baseline - cy.focused().type('0'); + cy.focused().type('0', { delay: 0 }); cy.tabForward(); // -> stretchgoal - cy.focused().type('10'); + cy.focused().type('10', { delay: 0 }); fillInNewKeyResult(); cy.contains('KeyResult metric by Cypress'); @@ -360,29 +360,29 @@ describe('Tab workflow tests', () => { openCreateKeyResult(); cy.wait(500); cy.tabForward(); - cy.focused().type('KeyResult'); + cy.focused().type('KeyResult', { delay: 0 }); cy.tabForward(); cy.tabForward(); cy.tabForward(); cy.realPress('ArrowDown'); // -> Entspricht "CHF" cy.tabForward(); - cy.focused().type('0'); + cy.focused().type('0', { delay: 0 }); cy.tabForward(); - cy.focused().type('10'); + cy.focused().type('10', { delay: 0 }); cy.tabForward(); cy.tabForward(); cy.tabForward(); - cy.focused().type('Action 1'); + cy.focused().type('Action 1', { delay: 0 }); cy.tabForward(); cy.tabForward(); - cy.focused().type('Action 2'); + cy.focused().type('Action 2', { delay: 0 }); cy.tabForward(); cy.tabForward(); - cy.focused().type('Action 3'); + cy.focused().type('Action 3', { delay: 0 }); cy.tabForward(); cy.tabForward(); cy.realPress('Enter'); - cy.focused().type('Action 4'); + cy.focused().type('Action 4', { delay: 0 }); cy.tabForward(); cy.tabForward(); cy.tabForward(); @@ -397,11 +397,11 @@ describe('Tab workflow tests', () => { cy.realPress('Enter'); cy.tabForwardUntil('[data-testId="add-action-plan-line"]'); cy.realPress('Enter'); - cy.focused().type('Action 2'); + cy.focused().type('Action 2', { delay: 0 }); cy.tabForward(); cy.tabForward(); cy.realPress('Enter'); - cy.focused().type('Action 1'); + cy.focused().type('Action 1', { delay: 0 }); cy.realPress('ArrowUp'); cy.tabForwardUntil('[data-testId="submit"]'); cy.realPress('Enter'); @@ -472,17 +472,17 @@ describe('Tab workflow tests', () => { openCreateKeyResult(); cy.wait(500); cy.tabForward(); // -> title - cy.focused().type('KeyResult ordinal by Cypress'); + cy.focused().type('KeyResult ordinal by Cypress', { delay: 0 }); cy.tabForward(); cy.tabForward(); cy.realPress('Enter'); // -> switch to ordinal type cy.contains('Commit Zone'); cy.tabForward(); - cy.focused().type('Commit Zone'); + cy.focused().type('Commit Zone', { delay: 0 }); cy.tabForward(); - cy.focused().type('Target Zone'); + cy.focused().type('Target Zone', { delay: 0 }); cy.tabForward(); - cy.focused().type('Stretch Goal'); + cy.focused().type('Stretch Goal', { delay: 0 }); fillInNewKeyResult(); cy.wait(500); cy.contains('KeyResult ordinal by Cypress'); diff --git a/frontend/cypress/e2e/teammanagement.cy.ts b/frontend/cypress/e2e/teammanagement.cy.ts index d89d8b06e1..99480326dd 100644 --- a/frontend/cypress/e2e/teammanagement.cy.ts +++ b/frontend/cypress/e2e/teammanagement.cy.ts @@ -30,7 +30,7 @@ describe('Team management tests', () => { cy.contains('Teamverwaltung'); cy.getByTestId('add-team').click(); - cy.getByTestId('add-team-name').click().clear().type(teamName, { delay: 1 }); + cy.getByTestId('add-team-name').click().clear().type(teamName, { delay: 0 }); cy.getByTestId('add-team-save').click(); cy.wait('@addTeam'); cy.contains(teamName); @@ -112,7 +112,7 @@ describe('Team management tests', () => { describe('Search', () => { it('Search user', () => { - cy.get('app-team-management-banner').getByTestId('teamManagementSearch').click().type('pa', { delay: 1 }); + cy.get('app-team-management-banner').getByTestId('teamManagementSearch').click().type('pa', { delay: 0 }); cy.contains('.mat-mdc-autocomplete-panel mat-option', 'Paco Eggimann (peggimann@puzzle.ch)'); cy.contains('.mat-mdc-autocomplete-panel mat-option', 'Paco Egiman (egiman@puzzle.ch)'); @@ -122,7 +122,7 @@ describe('Team management tests', () => { }); it('Search team', () => { - cy.get('app-team-management-banner').getByTestId('teamManagementSearch').click().type('we are', { delay: 1 }); + cy.get('app-team-management-banner').getByTestId('teamManagementSearch').click().type('we are', { delay: 0 }); cy.contains('.mat-mdc-autocomplete-panel mat-option', 'we are cube.³').click(); @@ -130,7 +130,7 @@ describe('Team management tests', () => { }); it('Search mixed', () => { - cy.get('app-team-management-banner').getByTestId('teamManagementSearch').click().type('puz', { delay: 1 }); + cy.get('app-team-management-banner').getByTestId('teamManagementSearch').click().type('puz', { delay: 0 }); cy.contains('.mat-mdc-autocomplete-panel .mat-mdc-optgroup-label', 'Members'); cy.contains('.mat-mdc-autocomplete-panel .mat-mdc-optgroup-label', 'Teams'); @@ -304,7 +304,7 @@ describe('Team management tests', () => { cy.get(matOption).contains(nameEsha).should('not.exist'); // add findus peterson - cy.getByTestId('search-member-to-add').click().type('Find', { delay: 1 }); + cy.getByTestId('search-member-to-add').click().type('Find', { delay: 0 }); cy.get(matOption).contains('Findus Peterson').click(); // add robin papierer @@ -394,7 +394,7 @@ function checkRolesForEsha() { function editTeamNameAndTest(teamName: string) { cy.intercept('PUT', '**/teams/*').as('saveTeam'); cy.getByTestId('editTeamButton').click(); - cy.getByTestId('add-team-name').click().clear().type(teamName, { delay: 1 }); + cy.getByTestId('add-team-name').click().clear().type(teamName, { delay: 0 }); cy.getByTestId('add-team-save').click(); cy.wait('@saveTeam'); cy.contains(teamName);