Skip to content

Commit

Permalink
Add delay 0 to all type exections in commands.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
RandomTannenbaum committed Nov 4, 2024
1 parent 34d992d commit 0f84e44
Showing 1 changed file with 22 additions and 18 deletions.
40 changes: 22 additions & 18 deletions frontend/cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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();
},
Expand All @@ -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();
},
Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -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 });
},
);

Expand Down Expand Up @@ -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 });
});
Expand Down

0 comments on commit 0f84e44

Please sign in to comment.