-
Notifications
You must be signed in to change notification settings - Fork 564
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
test: Added tests for filling in all fields in the form #530
base: master
Are you sure you want to change the base?
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 task! 🎉 The code meets the core requirements and is well-structured. While there are a few minor issues, such as the chaining of the shouldHaveValue
function and ensuring custom commands are defined, these do not significantly impact the functionality. Keep up the good work and consider addressing these minor points for even better code quality in the future! 😊
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
'November', | ||
'December' | ||
]; | ||
const monthName = monthNames[month]; |
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 month
parameter should be adjusted to match the zero-based index used in JavaScript arrays. Consider subtracting 1 from the month
parameter when accessing monthNames
.
'December' | ||
]; | ||
const monthName = monthNames[month]; | ||
return `${day} ${monthName},${year}`; |
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.
There is a missing space after the comma in the formatted date string. It should be ${day} ${monthName}, ${year}
.
cy.findByDate('month', USER.birth.month); | ||
cy.findByDate('year', USER.birth.year); | ||
cy.findByDate('day', USER.birth.day); |
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.
Ensure that the custom command cy.findByDate
is defined and correctly implemented to select the date in the date picker.
|
||
USER.hobbies.forEach((hobby) => { | ||
cy.get(`label[for=hobbies-checkbox-${hobby}]`).click(); | ||
cy.checkValueInCheckbox(hobby); |
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.
Ensure that the custom command cy.checkValueInCheckbox
is defined and correctly implemented to verify the checkbox value.
cy.checkValueInCheckbox(hobby); | ||
}); | ||
|
||
cy.uploadFile(USER.picture.path, USER.picture.name); |
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.
Ensure that the custom command cy.uploadFile
is defined and correctly implemented to handle file uploads.
|
||
Cypress.Commands.add('fillInput', (selector, value) => { | ||
cy.get(selector).should('be.visible').type(value); | ||
cy.shouldHaveValue(selector, value); |
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 shouldHaveValue
function should be chained to the Cypress command using .then()
or similar chaining methods. Directly calling it on cy
might not work as intended. Consider using cy.get(selector).then(() => cy.shouldHaveValue(selector, value));
.
Have a nice day!