LoginPage.ts 538 B

123456789101112131415161718192021222324252627
  1. // import 'cypress';
  2. class LoginPage {
  3. visit() {
  4. cy.visit('/');
  5. }
  6. getUsernameInput() {
  7. return cy.get('[data-testid="login-username-input"]');
  8. }
  9. getPasswordInput() {
  10. return cy.get('[data-testid="login-password-input"]');
  11. }
  12. getSubmitButton() {
  13. return cy.get('[data-testid="login-submit-button"]');
  14. }
  15. login(username: string, password: string) {
  16. this.getUsernameInput().type(username);
  17. this.getPasswordInput().type(password);
  18. this.getSubmitButton().click();
  19. }
  20. }
  21. export default LoginPage;