-
Notifications
You must be signed in to change notification settings - Fork 288
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
WebTables #259
base: main
Are you sure you want to change the base?
WebTables #259
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.
It looks like there are a few critical issues that need to be addressed before we can approve this pull request. The assertions are not correctly implemented, which could lead to incorrect test results. Please separate the actions and assertions as suggested, and ensure that each value is checked correctly. Keep up the good work, and you'll have this ready in no time! 😊
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
cypress/e2e/webTables.cy.js
Outdated
cy.get('#salary').click().type('500'); | ||
cy.get('#department').click().type('Legal'); | ||
cy.get('#submit').click(); | ||
cy.get(':nth-child(4) > .rt-tr > :nth-child(1)').should('contain', username, lastname, email); |
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 assertion here is incorrect because cy.get(':nth-child(4) > .rt-tr > :nth-child(1)')
is checking for a single element, and should('contain', username, lastname, email)
is not a valid syntax for checking multiple values. You should check each value separately or use a different approach to validate the entire row content.
cypress/e2e/webTables.cy.js
Outdated
cy.get(':nth-child(4) > .rt-tr > :nth-child(1)').should('contain', username, lastname, email); | ||
}); | ||
it('should provide an ability to delete a worker', () => { | ||
cy.get('#delete-record-1').click().should('not.exist'); |
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 should('not.exist')
assertion is chained incorrectly. The click()
command does not return a chainable subject for should('not.exist')
. You should separate the actions and assertions.
cypress/e2e/webTables.cy.js
Outdated
cy.get('#delete-record-1').click().should('not.exist'); | ||
cy.get('#delete-record-2').click().should('not.exist'); | ||
cy.get('#delete-record-3').click().should('not.exist'); |
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.
Similar to line 49, the should('not.exist')
assertion is chained incorrectly after click()
. Separate the actions and assertions for each delete operation.
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 the pull request! 🎉 While there are a couple of improvements suggested, such as making the test case more dynamic and using assertions for validation, these are minor and don't impact the core functionality. Keep up the good work and consider these suggestions for future enhancements!
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
cy.get(':nth-child(4) > .rt-tr > :nth-child(1)').then(($el) => { | ||
console.log($el.html()); | ||
console.log($el.text()); | ||
}); |
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.
It seems like you are logging the HTML and text of the element to the console. If the intention is to validate the data in the worker row, consider using assertions to check that the text matches the expected values instead of just logging it.
it('should provide an ability to delete all workers', () => { | ||
cy.get('#delete-record-1').click(); | ||
cy.get('#delete-record-1').should('not.exist'); | ||
|
||
cy.get('#delete-record-2').click(); | ||
cy.get('#delete-record-2').should('not.exist'); | ||
|
||
cy.get('#delete-record-3').click(); | ||
cy.get('#delete-record-3').should('not.exist'); | ||
|
||
}); |
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 test case 'should provide an ability to delete all workers' assumes that there are exactly three workers to delete. If the number of workers can vary, consider using a loop or a more dynamic approach to ensure all workers are deleted.
No description provided.