Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

done #526

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

done #526

wants to merge 1 commit into from

Conversation

vladisssi
Copy link

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job on implementing the student registration form automation! 🎉 While there are a few minor improvements suggested, such as using cy.get directly instead of a custom findById command and ensuring valid mobile numbers with faker.phone.phoneNumber(), these don't impact the core functionality. Keep up the good work and consider these enhancements for future projects! 😊

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

Comment on lines +14 to +15
cy.findById('firstName').type(userName)
cy.findById('lastName').type(userName)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cypress does not have a built-in command findById. You should use cy.get('#firstName') and cy.get('#lastName') instead.

Comment on lines +16 to +20
cy.findById('userEmail').type(email)
cy.findById('userNumber').type(mobile)
cy.findById('currentAddress').type(currentAddress)
cy.findById('state').type(state)
cy.findById('city').type(city)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace cy.findById with cy.get for these lines as well. For example, use cy.get('#userEmail') for the email field.


});
});
cy.get(`button[id='submit']`).click()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding an assertion to verify that the form submission was successful, such as checking for a confirmation message or modal.

Comment on lines +28 to +30
Cypress.Commands.add('findById', (id) => {
return cy.get(`#${id}`)
})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The findById command is redundant because it simply wraps cy.get with an ID selector. Consider using cy.get('#id') directly in your tests for simplicity and to avoid unnecessary abstraction.

function generateUser() {
const userName = faker.internet.userName()
const email = faker.internet.email()
const mobile = Math.random().toString().slice(2, 12)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mobile number is generated using Math.random(), which may lead to invalid or inconsistent numbers. Consider using faker.phone.phoneNumber() to generate more realistic and valid phone numbers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants