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

Project #283

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

Conversation

AnastasiaCherednik
Copy link

No description provided.

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

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

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

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?"`);

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

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

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

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

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.

Comment on lines +4 to +11
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');

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.

Comment on lines +18 to +28
followArticle(articleName) {
this.visitArticle(articleName);
this.followArticleButton.click();
this.unfollowArticleButton.should('exist');
}

unfollowArticle(articleName) {
this.followArticle(articleName);
this.unfollowArticleButton.click();
this.followArticleButton.should('exist');
}

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.

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