https://cypress.io logo
Here is a quick sample of how we're doing it: `cla...
# best-practices
m
Here is a quick sample of how we're doing it:
Copy code
class NewUserRegistration {
    elements = {
        firstNameInput: () => cy.get('[data-cy=add-ins-first-name]'),
        lastNameInput: () => cy.get('[data-cy=add-ins-last-name]'),
        emailInput: () => cy.get('[data-cy=add-ins-email]'),
        nextButton: () => cy.get('[data-cy=submit]')
    };

    fillNewUserInfo(firstName, lastName, email) {
        this.elements.firstNameInput().type(firstName);
        this.elements.lastNameInput().type(lastName);
        this.elements.emailInput().type(email);
    }

    submitForm() {
        this.elements.nextButton().click();
    }
    export default new NewUserRegistration();