d3c2475041
Closes #21345 Closes #21344 Signed-off-by: Jon Koops <jonkoops@gmail.com> Co-authored-by: Erik Jan de Wit <erikjan.dewit@gmail.com> Co-authored-by: Mark Franceschelli <mfrances@redhat.com> Co-authored-by: Hynek Mlnařík <hmlnarik@redhat.com> Co-authored-by: Agnieszka Gancarczyk <agancarc@redhat.com>
20 lines
511 B
TypeScript
20 lines
511 B
TypeScript
export default class Select {
|
|
static assertSelectedItem(
|
|
chain: Cypress.Chainable<JQuery<HTMLElement>>,
|
|
itemName: string,
|
|
) {
|
|
chain.parent().should("have.text", itemName);
|
|
}
|
|
|
|
static selectItem(
|
|
chain: Cypress.Chainable<JQuery<HTMLElement>>,
|
|
itemName: string,
|
|
) {
|
|
chain.click();
|
|
this.#getSelectMenu(chain).contains(itemName).click();
|
|
}
|
|
|
|
static #getSelectMenu(chain: Cypress.Chainable<JQuery<HTMLElement>>) {
|
|
return chain.parent().get(".pf-v5-c-select__menu");
|
|
}
|
|
}
|