accounts-frontend/tests-e2e/cypress/integration/profile/utils.ts

17 lines
526 B
TypeScript
Raw Normal View History

2019-12-29 17:57:44 +05:30
export function getSectionByName(name: string) {
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) {
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);
cy.getByTestId('password-request-form').find('[type=submit]').click();
2019-12-29 17:57:44 +05:30
}