-
Notifications
You must be signed in to change notification settings - Fork 566
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
base: master
Are you sure you want to change the base?
done #526
Conversation
There was a problem hiding this 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! ✨
cy.findById('firstName').type(userName) | ||
cy.findById('lastName').type(userName) |
There was a problem hiding this comment.
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.
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) |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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.
Cypress.Commands.add('findById', (id) => { | ||
return cy.get(`#${id}`) | ||
}) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
No description provided.