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

test: Added tests for filling in all fields in the form #530

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

Conversation

Galers
Copy link

@Galers Galers commented Jan 9, 2025

Have a nice day!

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 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];

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}`;

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}.

Comment on lines +65 to +67
cy.findByDate('month', USER.birth.month);
cy.findByDate('year', USER.birth.year);
cy.findByDate('day', USER.birth.day);

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);

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);

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);

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));.

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