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