-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7426ddd
commit d03a83b
Showing
4 changed files
with
50 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -149,7 +149,7 @@ describe('Team management tests', () => { | |
}); | ||
|
||
describe('Search', () => { | ||
it('Search user', () => { | ||
it.only('Search user', () => { | ||
cy.get('app-team-management-banner').getByTestId('teamManagementSearch').click().type('pa'); | ||
|
||
cy.contains('.mat-mdc-autocomplete-panel mat-option', 'Paco Eggimann ([email protected])'); | ||
|
@@ -159,15 +159,15 @@ describe('Team management tests', () => { | |
cy.contains('app-member-detail h2', 'Robin Papierer'); | ||
}); | ||
|
||
it('Search team', () => { | ||
it.only('Search team', () => { | ||
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', () => { | ||
it.only('Search mixed', () => { | ||
cy.get('app-team-management-banner').getByTestId('teamManagementSearch').click().type('puz'); | ||
|
||
cy.contains('.mat-mdc-autocomplete-panel .mat-mdc-optgroup-label', 'Members'); | ||
|
@@ -280,7 +280,7 @@ describe('Team management tests', () => { | |
}); | ||
}); | ||
|
||
it.only('Navigate to user Esha and set as okr champion', () => { | ||
it('Navigate to user Esha and set as okr champion', () => { | ||
navigateToUser(nameEsha); | ||
cy.getByTestId('edit-okr-champion-readonly').contains('OKR Champion:'); | ||
cy.getByTestId('edit-okr-champion-readonly').contains('Nein'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
export function getObjectiveByNameAndState(objectiveName: string, state: string) { | ||
return getObjectivesByNameAndState(objectiveName, state).first().should('exist'); | ||
} | ||
|
||
export function selectFromThreeDotMenu(optionName: string) { | ||
cy.contains(optionName).should('exist'); | ||
cy.get('.objective-three-dot-menu').contains(optionName).should('have.class', 'objective-menu-option').click(); | ||
} | ||
|
||
function getObjectivesByNameAndState(objectiveName: string, state: string) { | ||
return getObjectiveColumns() | ||
.filter((index, element) => filterByObjectiveName(element, objectiveName)) | ||
.filter((index, element) => filterByState(element, state)); | ||
} | ||
|
||
const filterByState = (element: HTMLElement, icon: string) => { | ||
return Cypress.$(element).find(`[src='assets/icons/${icon}-icon.svg']`).length > 0; | ||
}; | ||
const filterByObjectiveName = (element: HTMLElement, objectiveName: string) => { | ||
return Cypress.$(element).find(`:contains("${objectiveName}")`).length > 0; | ||
}; | ||
|
||
function getObjectiveColumns() { | ||
return cy.get('.objective'); | ||
} |