Skip to content

Commit

Permalink
set type delay gloabl and remove manual set
Browse files Browse the repository at this point in the history
  • Loading branch information
kcinay055679 committed Nov 7, 2024
1 parent 8a5f317 commit f4c81a1
Show file tree
Hide file tree
Showing 11 changed files with 73 additions and 73 deletions.
10 changes: 5 additions & 5 deletions frontend/cypress/e2e/checkIn.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', { delay: 0 });
cy.getByTestId('titleInput').type('Title');
cy.getByTestId('ordinalTab').click();

cy.fillOutKeyResult(
Expand Down Expand Up @@ -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', { delay: 0 });
cy.getByTestId('check-in-metric-value').click().clear().type('200');
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', { delay: 0 });
cy.getByTestId('changeInfo').clear().type('We bought a new sheep');
cy.getByTestId('submit-check-in').click();

cy.wait(200);
Expand All @@ -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', { delay: 0 });
cy.getByTestId('titleInput').type('Title');
cy.getByTestId('ordinalTab').click();

cy.fillOutKeyResult(
Expand Down Expand Up @@ -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', { delay: 0 });
cy.getByTestId('changeInfo').clear().type('We bought a new dog');
cy.getByTestId('submit-check-in').click();

cy.wait(200);
Expand Down
2 changes: 1 addition & 1 deletion frontend/cypress/e2e/crud.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', { delay: 0 }).clear();
cy.getByTestId('title').first().type('description').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');
Expand Down
4 changes: 2 additions & 2 deletions frontend/cypress/e2e/duplicated-scoring.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,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', { delay: 0 });
cy.getByTestId('initiatives').click().type('Testmassnahmen', { delay: 0 });
cy.getByTestId('changeInfo').click().type('Testveränderungen');
cy.getByTestId('initiatives').click().type('Testmassnahmen');
cy.getByTestId('submit-check-in').click();
cy.getByTestId('close-drawer').click({ force: true });

Expand Down
36 changes: 18 additions & 18 deletions frontend/cypress/e2e/keyresult.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', { delay: 0 });
cy.getByTestId('titleInput').type('Title');

cy.getByTestId('ordinalTab').click();
cy.fillOutKeyResult(
Expand All @@ -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', { delay: 0 });
cy.getByTestId('actionInput').last().type('A new house', { delay: 0 });
cy.getByTestId('actionInput').first().type('A new car');
cy.getByTestId('actionInput').last().type('A new house');
cy.getByTestId('add-action-plan-line').click();
cy.getByTestId('actionInput').last().type('A new company', { delay: 0 });
cy.getByTestId('actionInput').last().type('A new company');

cy.getByTestId('actionInput').first().should('have.value', 'A new car');
cy.getByTestId('actionInput').last().should('have.value', 'A new company');
Expand Down Expand Up @@ -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', { delay: 0 });
cy.getByTestId('titleInput').type('My title');
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', { delay: 0 });
cy.getByTestId('baseline').type('abc');
cy.getByTestId('submit').should('be.disabled');
cy.contains('Baseline muss eine Zahl sein');

cy.getByTestId('baseline').clear();
cy.getByTestId('baseline').type('45', { delay: 0 });
cy.getByTestId('baseline').type('45');
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', { delay: 0 });
cy.getByTestId('stretchGoal').type('abc');
cy.getByTestId('submit').should('be.disabled');
cy.contains('Stretch Goal muss eine Zahl sein');

cy.getByTestId('stretchGoal').clear();
cy.getByTestId('stretchGoal').type('83', { delay: 0 });
cy.getByTestId('stretchGoal').type('83');
cy.getByTestId('submit').should('not.be.disabled');
cy.getByTestId('ownerInput').clear();
cy.getByTestId('submit').should('be.disabled');

cy.getByTestId('ownerInput').type('abc', { delay: 0 });
cy.getByTestId('titleInput').type('Hello', { delay: 0 });
cy.getByTestId('ownerInput').type('abc');
cy.getByTestId('titleInput').type('Hello');
cy.getByTestId('submit').should('be.disabled');
cy.contains('Owner muss ausgewählt sein');

cy.getByTestId('ownerInput').clear();
cy.getByTestId('ownerInput').type('Pac').type('{downarrow}', { delay: 0 }).type('{enter}', { delay: 0 });
cy.getByTestId('ownerInput').type('Pac').type('{downarrow}').type('{enter}');
cy.getByTestId('submit').should('not.be.disabled');

cy.getByTestId('ordinalTab').click();
cy.getByTestId('submit').should('be.disabled');

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('commitZone').clear().type('Commit');
cy.getByTestId('targetZone').clear().type('Target');
cy.getByTestId('stretchZone').clear().type('Stretch');
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', { delay: 0 });
cy.getByTestId('commitZone').type('Commit');
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', { delay: 0 });
cy.getByTestId('targetZone').type('Target');
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', { delay: 0 });
cy.getByTestId('stretchZone').type('Commit');
cy.getByTestId('submit').should('not.be.disabled');
});

Expand Down
6 changes: 3 additions & 3 deletions frontend/cypress/e2e/objective-backlog.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', { delay: 0 });
cy.getByTestId('title').first().clear().type('Objective in quarter backlog');
cy.get('select#quarter').select('Backlog');

cy.contains('Speichern').should('not.exist');
Expand Down Expand Up @@ -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', { delay: 0 });
cy.getByTestId('title').first().clear().type('We can not release this');
cy.getByTestId('safe').should('not.exist');
cy.getByTestId('safe-draft').click();

Expand All @@ -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', { delay: 0 });
cy.getByTestId('title').first().clear().type('This is our first released objective');

cy.get('select#quarter').should('not.contain', 'Backlog');
cy.get('select#quarter').select('GJ ForTests');
Expand Down
8 changes: 4 additions & 4 deletions frontend/cypress/e2e/objective.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,22 +177,22 @@ describe('OKR Objective e2e tests', () => {
cy.wait(500);

cy.getByTestId('objectiveSearch').first().click();
cy.getByTestId('objectiveSearch').first().type('Search after', { delay: 0 }).wait(350);
cy.getByTestId('objectiveSearch').first().type('Search after').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', { delay: 0 }).wait(350);
cy.getByTestId('objectiveSearch').first().clear().type('this').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', { delay: 0 }).wait(350);
cy.getByTestId('objectiveSearch').first().clear().type('dont want to').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', { delay: 0 }).wait(350);
cy.getByTestId('objectiveSearch').first().clear().type('there is no objective').wait(350);

cy.get('We dont want to search for this').should('not.exist');
cy.get('Search after this objective').should('not.exist');
Expand Down
10 changes: 5 additions & 5 deletions frontend/cypress/e2e/scoring.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', { delay: 0 });
cy.getByTestId('initiatives').click().type('Testmassnahmen', { delay: 0 });
cy.getByTestId('changeInfo').click().type('Testveränderungen');
cy.getByTestId('initiatives').click().type('Testmassnahmen');
cy.getByTestId('submit-check-in').click();
const percentage = getPercentageOrdinal(zoneName);
cy.validateScoring(false, percentage);
Expand All @@ -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), { delay: 0 });
cy.getByTestId('check-in-metric-value').clear().type(String(value));
cy.getByTestId('confidence-slider').click();
cy.realPress('{rightarrow}').realPress('{rightarrow}').realPress('{rightarrow}');
cy.getByTestId('changeInfo').click().type('Testveränderungen', { delay: 0 });
cy.getByTestId('initiatives').click().type('Testmassnahmen', { delay: 0 });
cy.getByTestId('changeInfo').click().type('Testveränderungen');
cy.getByTestId('initiatives').click().type('Testmassnahmen');
cy.getByTestId('submit-check-in').click();
}
4 changes: 2 additions & 2 deletions frontend/cypress/e2e/tab.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ describe('Tab workflow tests', () => {
cy.realPress('Enter');
cy.contains('Objective für');
tabAndCheck('title');
cy.realType('title', { delay: 0 });
cy.realType('title');
tabAndCheck('description');
cy.realType('description', { delay: 0 });
cy.realType('description');
tabAndCheck('quarterSelect');
tabAndCheck('safe-draft');
tabAndCheck('safe');
Expand Down
22 changes: 11 additions & 11 deletions frontend/cypress/e2e/teammanagement.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe('Team management tests', () => {

cy.contains('Teamverwaltung');
cy.getByTestId('add-team').click();
cy.getByTestId('add-team-name').click().clear().type(teamName, { delay: 0 });
cy.getByTestId('add-team-name').click().clear().type(teamName);
cy.getByTestId('add-team-save').click();
cy.wait('@addTeam');
cy.contains(teamName);
Expand Down Expand Up @@ -150,7 +150,7 @@ describe('Team management tests', () => {

describe('Search', () => {
it('Search user', () => {
cy.get('app-team-management-banner').getByTestId('teamManagementSearch').click().type('pa', { delay: 0 });
cy.get('app-team-management-banner').getByTestId('teamManagementSearch').click().type('pa');

cy.contains('.mat-mdc-autocomplete-panel mat-option', 'Paco Eggimann ([email protected])');
cy.contains('.mat-mdc-autocomplete-panel mat-option', 'Paco Egiman ([email protected])');
Expand All @@ -160,15 +160,15 @@ describe('Team management tests', () => {
});

it('Search team', () => {
cy.get('app-team-management-banner').getByTestId('teamManagementSearch').click().type('we are', { delay: 0 });
cy.get('app-team-management-banner').getByTestId('teamManagementSearch').click().type('we are');

cy.contains('.mat-mdc-autocomplete-panel mat-option', 'we are cube.³').click();

cy.contains('app-member-list h2', 'we are cube.³');
});

it('Search mixed', () => {
cy.get('app-team-management-banner').getByTestId('teamManagementSearch').click().type('puz', { delay: 0 });
cy.get('app-team-management-banner').getByTestId('teamManagementSearch').click().type('puz');

cy.contains('.mat-mdc-autocomplete-panel .mat-mdc-optgroup-label', 'Members');
cy.contains('.mat-mdc-autocomplete-panel .mat-mdc-optgroup-label', 'Teams');
Expand Down Expand Up @@ -206,11 +206,11 @@ describe('Team management tests', () => {
cy.contains('Angabe benötigt');
cy.contains('E-Mail ungültig');
cy.getByTestId('email-col_2').focus();
cy.realType('@puzzle.ch', { delay: 0 });
cy.realType('@puzzle.ch');
cy.contains('E-Mail ungültig').should('not.exist');
cy.contains('E-Mail existiert bereits');
cy.tabBackward();
cy.realType('Papirer', { delay: 0 });
cy.realType('Papirer');
cy.contains('Angabe benötigt').should('not.exist');

// delete last entry
Expand Down Expand Up @@ -346,7 +346,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: 0 });
cy.getByTestId('search-member-to-add').click().type('Find');
cy.contains(matOption, 'Findus Peterson').click();

// add robin papierer
Expand Down Expand Up @@ -437,7 +437,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: 0 });
cy.getByTestId('add-team-name').click().clear().type(teamName);
cy.getByTestId('add-team-save').click();
cy.wait('@saveTeam');
cy.contains(teamName);
Expand All @@ -450,9 +450,9 @@ function navigateToUser(userName: string) {
}

function fillOutNewUser(firstname: string, lastname: string, email: string) {
cy.realType(firstname, { delay: 0 });
cy.realType(firstname);
cy.tabForward();
cy.realType(lastname, { delay: 0 });
cy.realType(lastname);
cy.tabForward();
cy.realType(email, { delay: 0 });
cy.realType(email);
}
Loading

0 comments on commit f4c81a1

Please sign in to comment.