17 lines
533 B
TypeScript
Raw Normal View History

2019-12-29 14:27:44 +02:00
export function getSectionByName(name: string) {
return cy
2020-05-21 21:37:35 +03:00
.findAllByTestId('profile-item')
.contains(name)
.closest('[data-testid="profile-item"]');
2019-12-29 14:27:44 +02:00
}
export function openSectionByName(name: string) {
2020-05-21 21:37:35 +03:00
return getSectionByName(name).findByTestId('profile-action').click();
2019-12-29 14:27:44 +02:00
}
export function confirmWithPassword(password: string) {
2020-05-21 21:37:35 +03:00
cy.findByTestId('password-request-form').should('be.visible');
2019-12-29 14:27:44 +02:00
cy.get('[name=password]').type(password);
2020-05-21 21:37:35 +03:00
cy.findByTestId('password-request-form').find('[type=submit]').click();
2019-12-29 14:27:44 +02:00
}