2019-12-29 17:57:44 +05:30
|
|
|
export function getSectionByName(name: string) {
|
2019-12-29 19:50:08 +05:30
|
|
|
return cy
|
2020-05-22 00:07:35 +05:30
|
|
|
.findAllByTestId('profile-item')
|
2019-12-29 19:50:08 +05:30
|
|
|
.contains(name)
|
|
|
|
.closest('[data-testid="profile-item"]');
|
2019-12-29 17:57:44 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
export function openSectionByName(name: string) {
|
2020-05-22 00:07:35 +05:30
|
|
|
return getSectionByName(name).findByTestId('profile-action').click();
|
2019-12-29 17:57:44 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
export function confirmWithPassword(password: string) {
|
2020-05-22 00:07:35 +05:30
|
|
|
cy.findByTestId('password-request-form').should('be.visible');
|
2019-12-29 17:57:44 +05:30
|
|
|
cy.get('[name=password]').type(password);
|
2020-05-22 00:07:35 +05:30
|
|
|
cy.findByTestId('password-request-form').find('[type=submit]').click();
|
2019-12-29 17:57:44 +05:30
|
|
|
}
|