-
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
Project #283
base: main
Are you sure you want to change the base?
Project #283
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 core functionalities and meeting the task requirements! 🎉 While there are some minor issues like method naming and a typo in the logout
method, they don't critically impact the functionality. Keep up the good work and consider addressing these minor improvements in future updates. Your use of the Page Object Model and Faker library is commendable! 🚀
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
const { | ||
addMatchImageSnapshotPlugin | ||
} = require('cypress-image-snapshot/plugin'); | ||
|
||
module.exports = defineConfig({ | ||
e2e: { | ||
baseUrl: 'http://localhost:1667/', | ||
baseUrl: 'https://conduit.mate.academy/', | ||
setupNodeEvents(on, config) { | ||
on('task', { | ||
generateUser() { | ||
const randomNumber = Math.ceil(Math.random(1000) * 1000); |
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 random number generation logic is incorrect. The Math.random(1000)
function does not take an argument. You should use Math.random()
and multiply the result by 1000 to get a number between 0 and 999. Consider using Math.floor(Math.random() * 1000)
to ensure you get an integer.
}); | ||
|
||
it.skip('should be able to follow the another user', () => { | ||
it('should be able to follow the another user', () => { | ||
UserPage.followArticle(article.title); |
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 method followArticle
might not be the correct method name if you intend to follow a user. Ensure that the UserPageObject
class has a method specifically for following users, not articles.
|
||
it.only('should be able to unfollow the another user', () => { | ||
UserPage.unfollowArticle(article.title); |
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 the previous comment, ensure that the unfollowArticle
method is correctly named and implemented for unfollowing users, not articles.
} | ||
|
||
get articleAboutField() { | ||
return cy.get(`[placeholder="What's this article about?"`); |
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 closing bracket in the selector string. Ensure that the selector is properly closed with a ]
.
} | ||
|
||
get articleBodyField() { | ||
return cy.get('[placeholder="Write your article (in markdown)"'); |
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 closing bracket in the selector string. Ensure that the selector is properly closed with a ]
.
} | ||
|
||
get articleTagsField() { | ||
return cy.get('[placeholder="Enter tags"'); |
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 closing bracket in the selector string. Ensure that the selector is properly closed with a ]
.
} | ||
|
||
logout() { | ||
this.logoutBtn.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.
There is a typo in the logout
method. The method is trying to use this.logoutBtn
, but the getter is named logoutButton
. Ensure the correct property name is used.
import PageObject from '../PageObject'; | ||
|
||
class SignUpPageObject extends PageObject { | ||
url = 'user/register'; |
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 URL path for the sign-up page seems to be missing a leading slash. It should be '/user/register' to ensure proper navigation.
get followArticleButton() { | ||
return cy.get('.btn.btn-sm.btn-outline-primary') | ||
.contains('Favorite Article'); | ||
} | ||
|
||
get unfollowArticleButton() { | ||
return cy.get('.btn.btn-sm.btn-primary') | ||
.contains('Unfavorite Article'); |
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 method names followArticleButton
and unfollowArticleButton
suggest actions related to articles, but the button text indicates they are for favoriting/unfavoriting articles. Ensure the method names accurately reflect their purpose.
followArticle(articleName) { | ||
this.visitArticle(articleName); | ||
this.followArticleButton.click(); | ||
this.unfollowArticleButton.should('exist'); | ||
} | ||
|
||
unfollowArticle(articleName) { | ||
this.followArticle(articleName); | ||
this.unfollowArticleButton.click(); | ||
this.followArticleButton.should('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 methods followArticle
and unfollowArticle
seem to be handling favoriting/unfavoriting articles rather than following/unfollowing users. Ensure the method names and logic align with the intended functionality.
No description provided.