-
Notifications
You must be signed in to change notification settings - Fork 357
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
Solution #296
base: main
Are you sure you want to change the base?
Solution #296
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.
Your code is well-structured and meets the task requirements effectively! 🎉 While there are some areas for improvement, such as ensuring the correct implementation of assertions and verifying the necessity of database clearing before each test, these are minor and do not critically impact the functionality. Keep up the great work, and consider the feedback for future enhancements! 🚀
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
}); | ||
|
||
beforeEach(() => { | ||
cy.task("db:clear"); |
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 cy.task('db:clear')
command is used to clear the database before each test. Ensure that this task is correctly defined in your Cypress support files and that it performs the intended database clearing operation. If not all tests require a fresh database state, consider moving this to specific tests that need it.
beforeEach(() => { | ||
cy.task("db:clear"); | ||
cy.visit("/"); | ||
cy.registerAndLogin(user.email, user.username, user.password); |
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 cy.registerAndLogin
function is called before each test. Ensure that this function is correctly defined and that it performs the registration and login operations as expected. If not all tests require a user to be registered and logged in, consider moving this to specific tests that need it.
cy.createArticle( | ||
article.title, | ||
article.description, | ||
article.body, | ||
article.tag | ||
); |
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 cy.createArticle
function is used to create an article before editing and deleting tests. Ensure that this function is correctly defined and that it performs the article creation operation as expected. This setup is necessary for the edit and delete tests, so it should be verified for correctness.
}); | ||
|
||
beforeEach(() => { | ||
cy.task("db:clear"); |
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 cy.task('db:clear')
command is used to clear the database before each test. Ensure that this task is correctly defined in your Cypress support files and that it performs the intended database clearing operation. If not all tests require a fresh database state, consider moving this to specific tests that need it.
beforeEach(() => { | ||
cy.task("db:clear"); | ||
cy.visit("/#/register"); | ||
cy.registerAndLogin(user.email, user.username, user.password); |
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 cy.registerAndLogin
function is called before each test. Ensure that this function is correctly defined and that it performs the registration and login operations as expected. If not all tests require a user to be registered and logged in, consider moving this to specific tests that need it.
} | ||
|
||
typeTag(tag) { | ||
this.tagField.first().type(tag); |
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 typeTag
method uses .first()
to select the first tag field. Ensure that this is the intended behavior and that the application supports multiple tag fields if necessary.
} | ||
|
||
clickEditArticleBtn() { | ||
this.editArticleBtn.first().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.
The clickEditArticleBtn
method uses .first()
to select the first edit button. Ensure that this is the intended behavior and that the application supports multiple edit buttons if necessary.
} | ||
|
||
clickDeleteArticleBtn() { | ||
this.deleteArticleBtn.first().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.
The clickDeleteArticleBtn
method uses .first()
to select the first delete button. Ensure that this is the intended behavior and that the application supports multiple delete buttons if necessary.
} | ||
|
||
typeBio(bio) { | ||
this.bioField.type(bio); |
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 typeBio
method does not clear the bio field before typing. If the intention is to replace the existing bio, consider using clear().type(bio)
to ensure the field is cleared before typing.
} | ||
|
||
get followBtn() { | ||
return cy.getByDataCy('follow-unfollow-btn'); |
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 followBtn
and unfollowBtn
getters both use the same data-cy
attribute ('follow-unfollow-btn'). Ensure that the application logic correctly distinguishes between the follow and unfollow states, possibly by checking the button text or another attribute.
No description provided.