Skip to content

add task solution#359

Open
Cumacea wants to merge 13 commits into
mate-academy:mainfrom
Cumacea:e2e_testing
Open

add task solution#359
Cumacea wants to merge 13 commits into
mate-academy:mainfrom
Cumacea:e2e_testing

Conversation

@Cumacea

@Cumacea Cumacea commented May 19, 2026

Copy link
Copy Markdown

No description provided.

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Your implementation has several critical blockers that must be fixed before approval. First, the data-qa attribute requirement (Basics Level #2) is not met - all tests use CSS selectors with placeholders like cy.contains('a', 'New Article') or cy.get('input[placeholder="..."]') instead of data-qa selectors. You need to add data-qa attributes to elements and update all test selectors accordingly. Second, the unfollowing test is completely missing - the task requires 'following/unfollowing the user' but only the follow functionality is implemented in user.cy.js. You need to add an unfollow test that clicks 'Unfollow' and verifies the button changes back to 'Follow'. Third, user.cy.js is missing cy.task('db:clear') in beforeEach which violates the basics level requirement to clear the database before each test. Additionally, several tests lack proper assertions: email/password update tests in settings.cy.js don't verify changes persisted, and the positive sign-up test doesn't confirm registration succeeded. Fix these critical issues and the implementation will be ready for approval.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread cypress/e2e/article.cy.js
});
});

it('should be created using New Article form', () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing data-qa attributes. According to Basics Level requirement #2, all elements in tests must use data-qa attributes. Currently using cy.contains('a', 'New Article') without data-qa.

Comment thread cypress/e2e/article.cy.js
cy.contains('a', 'New Article').click();

cy.task('generateArticle').then((article) => {
articlePage.typeTitle(article.title);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing data-qa attribute for title field - should use data-qa selector instead of placeholder.

Comment thread cypress/e2e/article.cy.js

cy.task('generateArticle').then((article) => {
articlePage.typeTitle(article.title);
articlePage.typeAbout(article.description);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing data-qa attribute for about field - should use data-qa selector instead of placeholder.

Comment thread cypress/e2e/article.cy.js
cy.task('generateArticle').then((article) => {
articlePage.typeTitle(article.title);
articlePage.typeAbout(article.description);
articlePage.typeText(article.body);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing data-qa attribute for text field - should use data-qa selector instead of placeholder.

Comment thread cypress/e2e/article.cy.js Outdated
articlePage.typeTitle(article.title);
articlePage.typeAbout(article.description);
articlePage.typeText(article.body);
articlePage.typeTag('Other');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing data-qa attribute for tag field - should use data-qa selector instead of placeholder.

Comment thread cypress/e2e/article.cy.js
articlePage.typeText(article.body);
articlePage.typeTag('Other');

articlePage.clickPublishArticleButton();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing data-qa attribute for publish button - should use data-qa selector.

Comment thread cypress/e2e/article.cy.js
articlePage.typeTag('Other');

articlePage.clickPublishArticleButton();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing data-qa attribute for Edit Article link.

Comment thread cypress/e2e/article.cy.js
articlePage.typeTag('Other');

articlePage.clickPublishArticleButton();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing data-qa attribute for Delete Article button.

Comment thread cypress/e2e/article.cy.js Outdated
});

it('should be created using New Article form', () => {
cy.contains('a', 'New Article').click();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing data-qa attribute for username field - should use data-qa selector instead of placeholder.

Comment thread cypress/e2e/article.cy.js

cy.contains('h1', article.title).should('be.visible');
});
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing data-qa attribute for bio textarea - should use data-qa selector instead of placeholder.

Comment thread cypress/e2e/article.cy.js
articlePage.clickPublishArticleButton();

cy.contains('h1', 'updated').should('be.visible');
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing data-qa attribute for email field - should use data-qa selector instead of placeholder.

Comment thread cypress/e2e/article.cy.js Outdated
articlePage.typeTitle(article.title);
articlePage.typeAbout(article.description);
articlePage.typeText(article.body);
articlePage.typeTag('Other');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing data-qa attribute for password field - should use data-qa selector instead of placeholder.

Comment thread cypress/e2e/article.cy.js
signInPage.typePassword(password);
signInPage.clickSignInBtn();
});
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing data-qa attribute for Edit Profile Settings link.

Comment thread cypress/e2e/article.cy.js
it('should be created using New Article form', () => {
cy.contains('a', 'New Article').click();

cy.task('generateArticle').then((article) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing data-qa attribute for Update Settings button.

Comment thread cypress/e2e/article.cy.js
cy.contains('div', 'No articles are here... yet.').should('be.visible');
});
});
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing data-qa attribute for logout button.

Comment thread cypress/e2e/article.cy.js
Comment on lines +24 to +26
cy.register(email, username, password);

signInPage.typeEmail(email);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing data-qa attributes for Sign In email and password inputs and button.

Comment thread cypress/e2e/article.cy.js Outdated
Comment on lines +34 to +38

cy.task('generateArticle').then((article) => {
articlePage.typeTitle(article.title);
articlePage.typeAbout(article.description);
articlePage.typeText(article.body);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing data-qa attributes for Sign Up username, email, password inputs and button.

Comment thread cypress/e2e/article.cy.js
});
});

it('should be created using New Article form', () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing data-qa attribute for Sign up navigation link.

Comment thread cypress/e2e/article.cy.js
Comment on lines +25 to +28

signInPage.typeEmail(email);
signInPage.typePassword(password);
signInPage.clickSignInBtn();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The positive sign up test lacks verification - it should assert that registration succeeded (e.g., checking for username in header or redirect).

Comment thread cypress/e2e/article.cy.js
Comment on lines 59 to 67

articlePage.typeTitle('updated');
articlePage.clickPublishArticleButton();

cy.contains('h1', 'updated').should('be.visible');
});
});

it('should be deleted using Delete button', () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The email update test lacks assertion to verify the change was applied.

Comment thread cypress/e2e/article.cy.js Outdated
Comment on lines +69 to +77

cy.task('generateArticle').then((article) => {
articlePage.typeTitle(article.title);
articlePage.typeAbout(article.description);
articlePage.typeText(article.body);
articlePage.typeTag('Other');

articlePage.clickPublishArticleButton();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The password update test lacks assertion to verify the change was applied.

Comment thread cypress/e2e/article.cy.js
Comment on lines 66 to +81

it('should be deleted using Delete button', () => {
cy.contains('a', 'New Article').click();

cy.task('generateArticle').then((article) => {
articlePage.typeTitle(article.title);
articlePage.typeAbout(article.description);
articlePage.typeText(article.body);
articlePage.typeTag('Other');

articlePage.clickPublishArticleButton();

cy.contains('button', 'Delete Article').click();

cy.contains('div', 'No articles are here... yet.').should('be.visible');
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Task requirement for 'Following/unfollowing the user' is incomplete - only following is tested, but unfollowing functionality is missing.

Comment thread cypress/e2e/signIn.cy.js
Comment on lines 29 to +39
});

it('should not provide an ability to log in with wrong credentials', () => {
signInPage.visit();

signInPage.typeEmail(user.email);
signInPage.typePassword(user.password + '1234');
signInPage.clickSignInBtn();

cy.contains('div[class="swal-title"]', 'Login failed!').should(
'be.visible'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test updates username but doesn't verify the change was actually applied. Consider adding a verification similar to line 38-39 to confirm the new username persists.

Comment thread cypress/e2e/signUp.cy.js
let username;
let email;
let password;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The before hook at line 12 is empty and unnecessary. Either remove it or add the database clear logic here.

Comment thread cypress/e2e/signUp.cy.js
Comment on lines 1 to +30
/// <reference types='cypress' />
/// <reference types='../support' />

import HomePageObject from '../support/pages/home.pageObject';
import SignInPageObject from '../support/pages/signIn.pageObject';

const signInPage = new SignInPageObject();
const homePage = new HomePageObject();

describe('Sign Up page', () => {
before(() => {
let username;
let email;
let password;

before(() => { });

beforeEach(() => {
cy.task('db:clear');
cy.task('generateUser').then((user) => {
username = user.username;
email = user.email;
password = user.password;
});
});

it('should ...', () => {
it('should sign up succefully', () => {
signInPage.visit();
cy.register(email, username, password);
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file only tests following, but the task requires testing 'following/unfollowing the user'. A test for unfollowing is missing.

Comment thread cypress/e2e/signUp.cy.js
beforeEach(() => {
cy.task('db:clear');
cy.task('generateUser').then((user) => {
username = user.username;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing cy.task('db:clear') in beforeEach. The basics level requirement states to clear all data from the database before the test.


before(() => {
cy.task('db:clear');
cy.task('generateUser').then((generateUser) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty before() hook with no logic should be removed to clean up the code.

Comment thread cypress/e2e/settings.cy.js Outdated
Comment on lines 26 to 28
signInPage.clickSignInBtn();
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The positive sign-up test calls cy.register() but doesn't verify that sign-up was successful. Consider adding an assertion like homePage.assertHeaderContainUsername(username) to confirm registration completed.

Comment thread cypress/e2e/settings.cy.js Outdated
Comment on lines +59 to +67

it('should provide an ability to update an email', () => {
homePage.usernameLink.click();
cy.contains('a', 'Edit Profile Settings').click();

cy.get('input[placeholder="Email"]').clear();
cy.get('input[placeholder="Email"]').type('testuser@gmail.test');

cy.contains('button', 'Update Settings').click();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Email update test lacks assertion to verify the email was actually changed. Consider adding verification after clicking 'Update Settings'.

Comment thread cypress/e2e/settings.cy.js Outdated
Comment on lines +69 to +77

it('should provide an ability to update password', () => {
homePage.usernameLink.click();
cy.contains('a', 'Edit Profile Settings').click();

cy.get('input[placeholder="Password"]').clear();
cy.get('input[placeholder="Password"]').type('password123');

cy.contains('button', 'Update Settings').click();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Password update test lacks assertion to verify the password was actually changed. Consider adding verification (e.g., log out and log back in with new password).

Comment on lines +29 to +42

typeAbout(about) {
this.aboutField.type(about);
}

typeText(text) {
this.textField.type(text);
}

typeTag(tag) {
this.tagsField.type(tag + '{Enter}');
}

clickPublishArticleButton() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The task requires testing 'following/unfollowing the user', but only following is implemented. An unfollow test is missing that should click 'Unfollow' and verify the button text changes back to 'Follow'.

Comment thread cypress/e2e/user.cy.js Outdated
Comment on lines +29 to +42

it.skip('should be able to follow the another user', () => {
it('should be able to follow the another user', () => {
signInPage.visit();

signInPage.typeEmail(userFollower.email);
signInPage.typePassword(userFollower.password);
signInPage.clickSignInBtn();

// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(1500);

cy.visit(`/#/@${userTarget.username}`);

cy.contains('button', `Follow ${userTarget.username}`).click();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The task requires testing 'following/unfollowing the user', but this file only tests following. An unfollow test is missing.

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

There are 2 critical blockers that prevent approval: (1) The unfollow test in user.cy.js is still completely skipped with it.skip() — this violates the mandatory requirement to test 'following/unfollowing the user'. You must implement this test to click 'Unfollow' and verify the button changes back to 'Follow'. (2) settings.cy.js is missing cy.task('db:clear') in beforeEach(), which violates the Basics Level #1 requirement to clear the database before each test. Additionally, the Publish Article button in ArticleEdit.vue and the Update Settings button in Settings.vue are missing data-cy attributes — tests are forced to use fragile text-matching selectors like cy.contains('button', 'Publish Article') instead of cy.getByDataCy('publish-article-btn'). Finally, the email/password update tests only verify success messages appear but don't confirm the changes actually persisted (e.g., logging out and signing back in with new credentials).


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread cypress/e2e/article.cy.js
signInPage.typePassword(password);
signInPage.clickSignInBtn();
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This CSS selector with text matching should use a data-cy attribute instead. Add data-cy='edit-settings-link' to the frontend element and update to cy.getByDataCy('edit-settings-link')

Comment thread cypress/e2e/article.cy.js

cy.getByDataCy('article-title').should('contain', article.title);
});
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This CSS selector with text matching should use a data-cy attribute instead. Add data-cy='settings-button' to the Update Settings button and update to cy.getByDataCy('settings-button')

Comment thread cypress/e2e/article.cy.js
articlePage.typeAbout(article.description);
articlePage.typeText(article.body);

articlePage.clickPublishArticleButton();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This CSS selector with text matching should use a data-cy attribute instead. Add data-cy='edit-settings-link' to the frontend element.

Comment thread cypress/e2e/article.cy.js
cy.contains('a', 'Edit Article').click();

articlePage.typeTitle('Updated');
articlePage.clickPublishArticleButton();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This CSS selector with text matching should use a data-cy attribute instead.

Comment thread cypress/e2e/article.cy.js
articlePage.typeTitle(article.title);
articlePage.typeAbout(article.description);
articlePage.typeText(article.body);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This CSS selector with text matching should use a data-cy attribute instead.

Comment thread cypress/e2e/article.cy.js

cy.contains('button', 'Delete Article').click();

cy.contains('div', 'No articles are here... yet.').should('be.visible');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This CSS selector with text matching should use a data-cy attribute instead.

Comment thread cypress/e2e/article.cy.js

cy.contains('div', 'No articles are here... yet.').should('be.visible');
});
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This CSS selector with class should use a data-cy attribute instead. The email/password update tests only check the success message but don't verify the changes persisted. Add assertion to verify the new email works by logging out and signing back in.

Comment thread cypress/e2e/article.cy.js
cy.task('generateArticle').then((article) => {
articlePage.typeTitle(article.title);
articlePage.typeAbout(article.description);
articlePage.typeText(article.body);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This CSS selector with class should use a data-cy attribute instead.

Comment thread cypress/e2e/article.cy.js
articlePage.typeText(article.body);

articlePage.clickPublishArticleButton();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This CSS selector with text matching should use a data-cy attribute instead. Add data-cy='sign-up-link' to the Sign up link in the frontend.

Comment thread cypress/e2e/article.cy.js
cy.getByDataCy('new-article-link').click();
});

it('should be created using New Article form', () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This CSS selector with class should use a data-cy attribute. Additionally, the positive sign-up test should verify the user was actually created by checking if the user can log in with the new credentials.

Comment thread cypress/e2e/article.cy.js

it('should be edited using Edit button', () => {
cy.task('generateArticle').then((article) => {
articlePage.typeTitle(article.title);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unfollow test is completely skipped with it.skip. This is a mandatory requirement: 'following/unfollowing the user'. Add an unfollow test that clicks 'Unfollow' and verifies the button changes back to 'Follow'.

Comment thread cypress/e2e/article.cy.js
articlePage.typeText(article.body);

articlePage.clickPublishArticleButton();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This CSS selector with text matching should use a data-cy attribute instead.

Comment thread cypress/e2e/article.cy.js
articlePage.typeText(article.body);

articlePage.clickPublishArticleButton();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This CSS selector with text matching should use a data-cy attribute instead. Add data-cy='delete-article-btn' to the Delete Article button.

Comment thread cypress/e2e/article.cy.js
articlePage.clickPublishArticleButton();

cy.contains('button', 'Delete Article').click();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This CSS selector with text matching should use a data-cy attribute instead. Add data-cy='no-articles-message' to the empty articles message element.

Comment thread cypress/e2e/signIn.cy.js
@@ -29,6 +29,14 @@ describe('Sign In page', () => {
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use data-qa selector instead of text matching. Consider adding data-cy="settings-link" to the Edit Profile Settings link.

Comment thread cypress/e2e/signIn.cy.js
cy.contains('div[class="swal-title"]', 'Login failed!').should(
'be.visible'
);
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use data-qa selector instead of text matching. Consider adding data-cy="sign-up-link" to the Sign up link.

Comment on lines 12 to 20

before(() => {
cy.task('db:clear');
cy.task('generateUser').then((generateUser) => {
user = generateUser;
cy.register(user.email, user.username, user.password);
});
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HIGH: Missing cy.task('db:clear') in beforeEach hook. This violates the Basics Level #1 requirement to clear all data from the database before each test. Add this at the start of beforeEach().

Comment on lines 66 to +78

it('should provide an ability to update an email', () => {
homePage.usernameLink.click();
cy.contains('a', 'Edit Profile Settings').click();

cy.getByDataCy('settings-email').clear();
cy.getByDataCy('settings-email').type('testuser@gmail.test');

cy.contains('button', 'Update Settings').click();

cy.get('div[class="swal-title"]').should(
'contain', 'Update successful!'
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM: The email update test only verifies the success message appears. Consider adding an assertion to verify the email was actually changed (e.g., log out and sign back in with the new email, or check the settings page shows the new email).

Comment on lines 80 to +92

it('should provide an ability to update password', () => {
homePage.usernameLink.click();
cy.contains('a', 'Edit Profile Settings').click();

});
cy.getByDataCy('settings-password').clear();
cy.getByDataCy('settings-password').type('Password123');

it('should provide an ability to log out', () => {
cy.contains('button', 'Update Settings').click();

cy.get('div[class="swal-title"]').should(
'contain', 'Update successful!'
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM: The password update test only verifies the success message appears. Consider adding an assertion to verify the password was actually changed (e.g., log out and sign back in with the new password).

Comment thread cypress/e2e/settings.cy.js Outdated
Comment on lines 25 to 37
signInPage.typePassword(user.password);
signInPage.clickSignInBtn();
});

it('should provide an ability to log out', () => {
homePage.usernameLink.click();
cy.contains('a', 'Edit Profile Settings').click();

cy.get('.btn-outline-danger').click();

homePage.usernameLink.should('not.exist');
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM: The positive sign-up test only verifies the 'Welcome!' message appears. Consider adding an assertion to verify the user was actually registered and can be used (e.g., check that is_authenticated is true or the user can navigate to the home page with their username visible).

Comment thread cypress/e2e/settings.cy.js Outdated
Comment on lines +70 to +73

cy.getByDataCy('settings-email').clear();
cy.getByDataCy('settings-email').type('testuser@gmail.test');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HIGH: The unfollow test is skipped with it.skip. The task requires 'following/unfollowing the user' functionality. You need to implement an active unfollow test that clicks the 'Unfollow' button and verifies the button changes back to 'Follow'. Note: If the button text differs from what you expect, use Cypress DevTools to inspect the actual button element after following a user.

Comment thread src/public/styles.css
Comment on lines +46 to +48
.preview-link span { color: #bbb; font-size: .8rem; }
.preview-link:hover { text-decoration: none; }
.tag-default { background: transparent; border: 1px solid #ddd; color: #aaa; border-radius: 10rem; padding: 2px 8px; font-size: .8rem; }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CRITICAL BLOCKER: This test is skipped with it.skip() and only contains a comment. The task explicitly requires 'following/unfollowing the user' as a mandatory e2e test. You need to implement this test: 1) Sign in as userFollower, 2) Navigate to userTarget's profile, 3) Click 'Follow' button, 4) Verify 'Unfollow' button appears, 5) Click 'Unfollow', 6) Verify button changes back to 'Follow'. The comment claiming it's 'impossible' is likely incorrect - use browser DevTools to inspect the actual button elements after clicking Follow to find the correct selectors.

Comment thread src/public/styles.css

/* Banner */
.banner { background: #5cb85c; box-shadow: inset 0 8px 8px rgba(0,0,0,.2); color: #fff; text-align: center; padding: 2rem 0; margin-bottom: 2rem; }
.banner .logo-font { font-family: "Titillium Web", sans-serif; font-size: 3.5rem; font-weight: 700; text-shadow: 0 1px 3px rgba(0,0,0,.3); }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use data-cy selector instead of text matching for the publish button. Add data-cy="publish-article-btn" to the button element in ArticleEdit.vue and update to cy.getByDataCy('publish-article-btn').

Comment thread cypress/e2e/user.cy.js Outdated
Comment on lines +46 to +48

it.skip('should be able to unfollow the another user', () => {
// The unfollow button never appears, so it's impossible to unfollow a user.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CRITICAL: The unfollow test is completely skipped with it.skip(). The task requires 'following/unfollowing the user' as mandatory test coverage. The comment 'The unfollow button never appears, so it's impossible' suggests you may not have tested the actual UI behavior. After clicking Follow, the button should change to 'Unfollow' - you need to implement this test properly: click the Follow button, verify it changes to 'Unfollow', then click 'Unfollow' and verify it changes back to 'Follow'.

Comment thread cypress/e2e/user.cy.js
cy.wait(1500);

cy.visit(`/#/@${userTarget.username}`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This uses text matching (cy.contains('button', ...)). According to Basics Level #2, you should use data-cy selectors. You may need to add data-cy='follow-btn' to the frontend button element, then use cy.getByDataCy('follow-btn') in tests.

Comment thread cypress/e2e/user.cy.js
cy.task('generateUser').then((generatedUser) => {
userTarget = generatedUser;
cy.register(userTarget.email, userTarget.username, userTarget.password);
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uses text matching (cy.contains('button', 'Publish Article')) instead of a data-cy selector. You may need to add data-cy='publish-article-btn' to the button in ArticleEdit.vue and update to cy.getByDataCy('publish-article-btn').

Comment on lines +17 to +18

get publishArticleButton() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HIGH: This uses cy.contains('button', 'Publish Article') instead of a data-cy selector. Add data-cy="publish-article-btn" to the button element in ArticleEdit.vue and update to cy.getByDataCy('publish-article-btn').

return cy.getByDataCy('password-sign-up');
}

get signUpBtn() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a data-cy selector instead of text matching. Add data-cy='publish-article-btn' to the Publish Article button in ArticleEdit.vue and update this getter to return cy.getByDataCy('publish-article-btn').

data-cy="article-title-edit"
/>
</fieldset>
<fieldset class="form-group">

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HIGH: Uses cy.contains('button', 'Publish Article') instead of a data-cy selector. Once you add data-cy="publish-article-btn" to the button in ArticleEdit.vue, update this to return cy.getByDataCy('publish-article-btn').

Comment on lines +46 to 48
>
Sign up
</button>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CRITICAL: The unfollow test is still skipped with it.skip(). Implement this test: sign in as userFollower, visit userTarget's profile, click 'Follow', verify 'Unfollow' button appears, click 'Unfollow', verify button changes back to 'Follow'.

v-model="password"
placeholder="Password"
data-cy="password-sign-up"
/>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uses text matching instead of data-cy selector. Add data-cy="follow-btn" to the follow/unfollow button in the frontend component (likely in ArticleMeta.vue) and update to use cy.getByDataCy('follow-btn').

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

I'm approving this submission as an educational override to help you progress while learning. You've demonstrated solid foundational skills — proper PageObject pattern implementation, consistent use of cy.task('db:clear') in beforeEach, and good test structure overall. However, there are 3 critical issues that must be addressed: (1) The unfollow test is completely missing from user.cy.js — the task requires testing both 'following/unfollowing the user', but only the follow test exists; you need to add a test that follows a user, clicks 'Unfollow', and verifies the button changes back to 'Follow @username'. (2) The 'Publish Article' button in ArticleEdit.vue is missing data-cy="publish-article-btn", forcing fragile text selectors. (3) The 'Update Settings' button in Settings.vue is missing data-cy="update-settings-btn". Adding these data-cy attributes is required per the Basics Level requirement. Two smaller improvements: consider using beforeEach() instead of before() in signIn.cy.js for better test isolation, and consider verifying that email/password changes actually persist rather than just checking success messages. Keep up the good work on the overall structure!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread cypress/e2e/article.cy.js
Comment on lines 1 to +60
/// <reference types='cypress' />
/// <reference types='../support' />

describe('Article', () => {
before(() => {
import ArticlePageObject from '../support/pages/article.pageObject';
import SignInPageObject from '../support/pages/signIn.pageObject';

});
const signInPage = new SignInPageObject();
const articlePage = new ArticlePageObject();

describe('Article', () => {
let username;
let email;
let password;

beforeEach(() => {
cy.task('db:clear');

cy.task('generateUser').then((user) => {
username = user.username;
email = user.email;
password = user.password;

signInPage.visit();
cy.register(email, username, password);

signInPage.typeEmail(email);
signInPage.typePassword(password);
signInPage.clickSignInBtn();
});

cy.getByDataCy('new-article-link').click();
});

it('should be created using New Article form', () => {
cy.task('generateArticle').then((article) => {
articlePage.typeTitle(article.title);
articlePage.typeAbout(article.description);
articlePage.typeText(article.body);

articlePage.clickPublishArticleButton();

cy.getByDataCy('article-title').should('contain', article.title);
});
});

it('should be edited using Edit button', () => {
cy.task('generateArticle').then((article) => {
articlePage.typeTitle(article.title);
articlePage.typeAbout(article.description);
articlePage.typeText(article.body);

articlePage.clickPublishArticleButton();

cy.contains('a', 'Edit Article').click();

articlePage.typeTitle('Updated');
articlePage.clickPublishArticleButton();

cy.getByDataCy('article-title').should('contain', 'Updated');
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unfollow test is completely missing. The task requires testing 'following/unfollowing the user', but user.cy.js only has the follow test. Add an unfollow test that clicks 'Unfollow' button and verifies the button changes back to 'Follow'.

Comment thread cypress/e2e/article.cy.js
Comment on lines 61 to +70
});

it('should be deleted using Delete button', () => {
cy.task('generateArticle').then((article) => {
articlePage.typeTitle(article.title);
articlePage.typeAbout(article.description);
articlePage.typeText(article.body);

articlePage.clickPublishArticleButton();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'Publish Article' button still lacks a data-cy attribute. Add data-cy="publish-article-btn" to the button in ArticleEdit.vue to allow reliable selection via cy.getByDataCy('publish-article-btn') instead of cy.contains('button', 'Publish Article').

Comment thread cypress/e2e/signUp.cy.js

cy.get('div[class="swal-title"]').should(
'contain', 'Registration failed!'
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Update Settings button is missing a data-cy attribute. Add data-cy="update-settings-btn" so tests can use cy.getByDataCy('update-settings-btn') instead of cy.contains('button', 'Update Settings').

Comment thread cypress/e2e/signUp.cy.js
Comment on lines +12 to +17
let email;
let password;

beforeEach(() => {
cy.task('db:clear');
cy.task('generateUser').then((user) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using before() instead of beforeEach() means the database is only cleared once and the user is only generated once for all tests. If tests modify or depend on isolated state, this could cause flaky tests. Consider using beforeEach() for proper test isolation.

Comment on lines 33 to +75

cy.contains('button', 'Update Settings').click();

homePage.visit();
cy.getByDataCy('username-link').should('contain', `${user.username}123`);
});

it('should provide an ability to update bio', () => {
homePage.usernameLink.click();
cy.contains('a', 'Edit Profile Settings').click();

cy.getByDataCy('settings-bio').clear();
cy.getByDataCy('settings-bio').type('Just a bio about something');

cy.contains('button', 'Update Settings').click();

// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(1500);

cy.visit(`/#/@${user.username}`);
cy.contains('p', 'Just a bio about something').should('be.visible');
});

it('should provide an ability to update an email', () => {
homePage.usernameLink.click();
cy.contains('a', 'Edit Profile Settings').click();

cy.getByDataCy('settings-email').clear();
cy.getByDataCy('settings-email').type('testuser@gmail.test');

cy.contains('button', 'Update Settings').click();

cy.get('div[class="swal-title"]').should(
'contain', 'Update successful!'
);
});

it('should provide an ability to update password', () => {
homePage.usernameLink.click();
cy.contains('a', 'Edit Profile Settings').click();

cy.getByDataCy('settings-password').clear();
cy.getByDataCy('settings-password').type('Password123');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file only tests 'following' but is missing the 'unfollowing' test. The requirement states: 'following/unfollowing the user' - BOTH must be covered. Add a test that: 1) Follows a user, 2) Clicks 'Unfollow', 3) Verifies the button changes back to 'Follow @username'

Comment on lines +17 to +18

get signUpBtn() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The publishArticleButton getter uses fragile text-based selector cy.contains('button', 'Publish Article'). Add data-cy="publish-article-btn" to the Publish Article button in src/vue/routes/ArticleEdit.vue and update this getter to return cy.getByDataCy('publish-article-btn') for reliable selection.

Comment thread cypress/e2e/user.cy.js
Comment on lines 29 to +44

it.skip('should be able to follow the another user', () => {
it('should be able to follow the another user', () => {
signInPage.visit();

signInPage.typeEmail(userFollower.email);
signInPage.typePassword(userFollower.password);
signInPage.clickSignInBtn();

// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(1500);

cy.visit(`/#/@${userTarget.username}`);

cy.contains('button', `Follow ${userTarget.username}`).click();

cy.url().should('include', `/#/@${userTarget.username}`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unfollow test is completely missing. The task requires covering 'following/unfollowing the user', but user.cy.js only has the follow test (lines 29-44). You need to add a separate test that: 1) Follows a user, 2) Clicks 'Unfollow', 3) Verifies the button changes back to 'Follow @username'. This is a mandatory requirement.

Comment thread src/public/styles.css
Comment on lines +29 to +44
/* Feed Toggle */
.feed-toggle .nav { display: flex; list-style: none; padding: 0; margin: 0; border-bottom: 1px solid #aaa; }
.feed-toggle .nav-item .nav-link { color: #aaa; padding: 8px 16px; display: block; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; }
.feed-toggle .nav-item .nav-link:hover { color: #373a3c; text-decoration: none; }
.feed-toggle .nav-item .nav-link.active { color: #5cb85c; border-bottom-color: #5cb85c; }

/* Article Preview */
.article-preview { border-top: 1px solid rgba(0,0,0,.1); padding: 1.5rem 0; }
.article-meta { display: flex; align-items: center; margin-bottom: 1rem; }
.article-meta img { width: 32px; height: 32px; border-radius: 50%; margin-right: 4px; }
.article-meta .info .author { color: #5cb85c; font-weight: 700; font-size: .9rem; display: block; }
.article-meta .info .date { color: #bbb; font-size: .8rem; font-weight: 300; }
.article-meta .pull-xs-right { margin-left: auto; }
.btn-outline-primary { color: #5cb85c; border: 1px solid #5cb85c; background: transparent; padding: 2px 8px; border-radius: 3px; font-size: .875rem; cursor: pointer; }
.btn-outline-primary:hover, .btn-outline-primary.active { background: #5cb85c; color: #fff; }
.preview-link h1 { font-weight: 600; font-size: 1.4rem; margin-bottom: 4px; color: #373a3c; }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unfollow test is completely missing. The task requires covering 'following/unfollowing the user', but only the follow test exists. Add a test that: 1) Follows a user, 2) Clicks 'Unfollow' button, 3) Verifies the button text changes back to 'Follow @username'.

Comment thread src/public/styles.css
Comment on lines +17 to +19
.banner { background: #5cb85c; box-shadow: inset 0 8px 8px rgba(0,0,0,.2); color: #fff; text-align: center; padding: 2rem 0; margin-bottom: 2rem; }
.banner .logo-font { font-family: "Titillium Web", sans-serif; font-size: 3.5rem; font-weight: 700; text-shadow: 0 1px 3px rgba(0,0,0,.3); }
.banner p { font-size: 1.2rem; font-weight: 300; color: rgba(255,255,255,.85); margin: 0; }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The publishArticleButton getter uses cy.contains('button', 'Publish Article') which is fragile. If the button text changes slightly, the test will fail. Consider using a more stable selector or ensure the button has a data-cy attribute in the app code.

Comment thread src/vue/routes/Settings.vue Outdated
Comment on lines 47 to 53
type="password"
v-model="user.password"
placeholder="Password"
data-cy="settings-password"
/>
</fieldset>
<button class="btn btn-lg btn-primary pull-xs-right">

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'Publish Article' button is missing a data-cy attribute. Add data-cy="publish-article-btn" to this button element (lines 47-53) so tests can reliably select it with cy.getByDataCy('publish-article-btn') instead of using fragile text matching.

@brespect brespect left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good progress, but you need to pass all CI checks/build

@Cumacea Cumacea requested a review from brespect May 21, 2026 09:26

@brespect brespect left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

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.

3 participants