Skip to content
Snippets Groups Projects
Commit 89a03406 authored by rhenck's avatar rhenck
Browse files

[e2e] Fix dropdown selection to use exact name

Cypress' contains "can contain more than the desired text and still 
match". This creates issues when having similar names in 
dropdown-entries and unwanted elements get selected.
parent 57d424a2
No related branches found
No related tags found
No related merge requests found
Pipeline #68856 failed
...@@ -62,7 +62,7 @@ export function setCheckbox(labelText: string): void { ...@@ -62,7 +62,7 @@ export function setCheckbox(labelText: string): void {
export function selectFromDropdown(dropdownName: string, optionName: string, closeOverlay: boolean = false) { export function selectFromDropdown(dropdownName: string, optionName: string, closeOverlay: boolean = false) {
cy.get('aspect-element-model-properties-component') cy.get('aspect-element-model-properties-component')
.contains('mat-form-field', dropdownName).find('mat-select').click(); .contains('mat-form-field', dropdownName).find('mat-select').click();
cy.get('.cdk-overlay-container').contains(optionName).click({ force: true }); cy.get('.cdk-overlay-container').contains('span', new RegExp(`^ ${optionName} $`)).click({ force: true });
if (closeOverlay) cy.get('body').click(); if (closeOverlay) cy.get('body').click();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment