add task solution#359
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
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
| }); | ||
| }); | ||
|
|
||
| it('should be created using New Article form', () => { |
There was a problem hiding this comment.
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.
| cy.contains('a', 'New Article').click(); | ||
|
|
||
| cy.task('generateArticle').then((article) => { | ||
| articlePage.typeTitle(article.title); |
There was a problem hiding this comment.
Missing data-qa attribute for title field - should use data-qa selector instead of placeholder.
|
|
||
| cy.task('generateArticle').then((article) => { | ||
| articlePage.typeTitle(article.title); | ||
| articlePage.typeAbout(article.description); |
There was a problem hiding this comment.
Missing data-qa attribute for about field - should use data-qa selector instead of placeholder.
| cy.task('generateArticle').then((article) => { | ||
| articlePage.typeTitle(article.title); | ||
| articlePage.typeAbout(article.description); | ||
| articlePage.typeText(article.body); |
There was a problem hiding this comment.
Missing data-qa attribute for text field - should use data-qa selector instead of placeholder.
| articlePage.typeTitle(article.title); | ||
| articlePage.typeAbout(article.description); | ||
| articlePage.typeText(article.body); | ||
| articlePage.typeTag('Other'); |
There was a problem hiding this comment.
Missing data-qa attribute for tag field - should use data-qa selector instead of placeholder.
| articlePage.typeText(article.body); | ||
| articlePage.typeTag('Other'); | ||
|
|
||
| articlePage.clickPublishArticleButton(); |
There was a problem hiding this comment.
Missing data-qa attribute for publish button - should use data-qa selector.
| articlePage.typeTag('Other'); | ||
|
|
||
| articlePage.clickPublishArticleButton(); | ||
|
|
There was a problem hiding this comment.
Missing data-qa attribute for Edit Article link.
| articlePage.typeTag('Other'); | ||
|
|
||
| articlePage.clickPublishArticleButton(); | ||
|
|
There was a problem hiding this comment.
Missing data-qa attribute for Delete Article button.
| }); | ||
|
|
||
| it('should be created using New Article form', () => { | ||
| cy.contains('a', 'New Article').click(); |
There was a problem hiding this comment.
Missing data-qa attribute for username field - should use data-qa selector instead of placeholder.
|
|
||
| cy.contains('h1', article.title).should('be.visible'); | ||
| }); | ||
| }); |
There was a problem hiding this comment.
Missing data-qa attribute for bio textarea - should use data-qa selector instead of placeholder.
| articlePage.clickPublishArticleButton(); | ||
|
|
||
| cy.contains('h1', 'updated').should('be.visible'); | ||
| }); |
There was a problem hiding this comment.
Missing data-qa attribute for email field - should use data-qa selector instead of placeholder.
| articlePage.typeTitle(article.title); | ||
| articlePage.typeAbout(article.description); | ||
| articlePage.typeText(article.body); | ||
| articlePage.typeTag('Other'); |
There was a problem hiding this comment.
Missing data-qa attribute for password field - should use data-qa selector instead of placeholder.
| signInPage.typePassword(password); | ||
| signInPage.clickSignInBtn(); | ||
| }); | ||
| }); |
There was a problem hiding this comment.
Missing data-qa attribute for Edit Profile Settings link.
| it('should be created using New Article form', () => { | ||
| cy.contains('a', 'New Article').click(); | ||
|
|
||
| cy.task('generateArticle').then((article) => { |
There was a problem hiding this comment.
Missing data-qa attribute for Update Settings button.
| cy.contains('div', 'No articles are here... yet.').should('be.visible'); | ||
| }); | ||
| }); | ||
| }); |
There was a problem hiding this comment.
Missing data-qa attribute for logout button.
| cy.register(email, username, password); | ||
|
|
||
| signInPage.typeEmail(email); |
There was a problem hiding this comment.
Missing data-qa attributes for Sign In email and password inputs and button.
|
|
||
| cy.task('generateArticle').then((article) => { | ||
| articlePage.typeTitle(article.title); | ||
| articlePage.typeAbout(article.description); | ||
| articlePage.typeText(article.body); |
There was a problem hiding this comment.
Missing data-qa attributes for Sign Up username, email, password inputs and button.
| }); | ||
| }); | ||
|
|
||
| it('should be created using New Article form', () => { |
There was a problem hiding this comment.
Missing data-qa attribute for Sign up navigation link.
|
|
||
| signInPage.typeEmail(email); | ||
| signInPage.typePassword(password); | ||
| signInPage.clickSignInBtn(); |
There was a problem hiding this comment.
The positive sign up test lacks verification - it should assert that registration succeeded (e.g., checking for username in header or redirect).
|
|
||
| articlePage.typeTitle('updated'); | ||
| articlePage.clickPublishArticleButton(); | ||
|
|
||
| cy.contains('h1', 'updated').should('be.visible'); | ||
| }); | ||
| }); | ||
|
|
||
| it('should be deleted using Delete button', () => { |
There was a problem hiding this comment.
The email update test lacks assertion to verify the change was applied.
|
|
||
| cy.task('generateArticle').then((article) => { | ||
| articlePage.typeTitle(article.title); | ||
| articlePage.typeAbout(article.description); | ||
| articlePage.typeText(article.body); | ||
| articlePage.typeTag('Other'); | ||
|
|
||
| articlePage.clickPublishArticleButton(); | ||
|
|
There was a problem hiding this comment.
The password update test lacks assertion to verify the change was applied.
|
|
||
| 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'); | ||
| }); |
There was a problem hiding this comment.
Task requirement for 'Following/unfollowing the user' is incomplete - only following is tested, but unfollowing functionality is missing.
| }); | ||
|
|
||
| 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' |
There was a problem hiding this comment.
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.
| let username; | ||
| let email; | ||
| let password; | ||
|
|
There was a problem hiding this comment.
The before hook at line 12 is empty and unnecessary. Either remove it or add the database clear logic here.
| /// <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); | ||
| }); | ||
|
|
There was a problem hiding this comment.
This file only tests following, but the task requires testing 'following/unfollowing the user'. A test for unfollowing is missing.
| beforeEach(() => { | ||
| cy.task('db:clear'); | ||
| cy.task('generateUser').then((user) => { | ||
| username = user.username; |
There was a problem hiding this comment.
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) => { |
There was a problem hiding this comment.
Empty before() hook with no logic should be removed to clean up the code.
| signInPage.clickSignInBtn(); | ||
| }); | ||
|
|
There was a problem hiding this comment.
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.
|
|
||
| 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(); |
There was a problem hiding this comment.
Email update test lacks assertion to verify the email was actually changed. Consider adding verification after clicking 'Update Settings'.
|
|
||
| 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(); |
There was a problem hiding this comment.
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).
|
|
||
| typeAbout(about) { | ||
| this.aboutField.type(about); | ||
| } | ||
|
|
||
| typeText(text) { | ||
| this.textField.type(text); | ||
| } | ||
|
|
||
| typeTag(tag) { | ||
| this.tagsField.type(tag + '{Enter}'); | ||
| } | ||
|
|
||
| clickPublishArticleButton() { |
There was a problem hiding this comment.
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'.
|
|
||
| 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(); |
There was a problem hiding this comment.
The task requires testing 'following/unfollowing the user', but this file only tests following. An unfollow test is missing.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
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
| signInPage.typePassword(password); | ||
| signInPage.clickSignInBtn(); | ||
| }); | ||
|
|
There was a problem hiding this comment.
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')
|
|
||
| cy.getByDataCy('article-title').should('contain', article.title); | ||
| }); | ||
| }); |
There was a problem hiding this comment.
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')
| articlePage.typeAbout(article.description); | ||
| articlePage.typeText(article.body); | ||
|
|
||
| articlePage.clickPublishArticleButton(); |
There was a problem hiding this comment.
This CSS selector with text matching should use a data-cy attribute instead. Add data-cy='edit-settings-link' to the frontend element.
| cy.contains('a', 'Edit Article').click(); | ||
|
|
||
| articlePage.typeTitle('Updated'); | ||
| articlePage.clickPublishArticleButton(); |
There was a problem hiding this comment.
This CSS selector with text matching should use a data-cy attribute instead.
| articlePage.typeTitle(article.title); | ||
| articlePage.typeAbout(article.description); | ||
| articlePage.typeText(article.body); | ||
|
|
There was a problem hiding this comment.
This CSS selector with text matching should use a data-cy attribute instead.
|
|
||
| cy.contains('button', 'Delete Article').click(); | ||
|
|
||
| cy.contains('div', 'No articles are here... yet.').should('be.visible'); |
There was a problem hiding this comment.
This CSS selector with text matching should use a data-cy attribute instead.
|
|
||
| cy.contains('div', 'No articles are here... yet.').should('be.visible'); | ||
| }); | ||
| }); |
There was a problem hiding this comment.
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.
| cy.task('generateArticle').then((article) => { | ||
| articlePage.typeTitle(article.title); | ||
| articlePage.typeAbout(article.description); | ||
| articlePage.typeText(article.body); |
There was a problem hiding this comment.
This CSS selector with class should use a data-cy attribute instead.
| articlePage.typeText(article.body); | ||
|
|
||
| articlePage.clickPublishArticleButton(); | ||
|
|
There was a problem hiding this comment.
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.
| cy.getByDataCy('new-article-link').click(); | ||
| }); | ||
|
|
||
| it('should be created using New Article form', () => { |
There was a problem hiding this comment.
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.
|
|
||
| it('should be edited using Edit button', () => { | ||
| cy.task('generateArticle').then((article) => { | ||
| articlePage.typeTitle(article.title); |
There was a problem hiding this comment.
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'.
| articlePage.typeText(article.body); | ||
|
|
||
| articlePage.clickPublishArticleButton(); | ||
|
|
There was a problem hiding this comment.
This CSS selector with text matching should use a data-cy attribute instead.
| articlePage.typeText(article.body); | ||
|
|
||
| articlePage.clickPublishArticleButton(); | ||
|
|
There was a problem hiding this comment.
This CSS selector with text matching should use a data-cy attribute instead. Add data-cy='delete-article-btn' to the Delete Article button.
| articlePage.clickPublishArticleButton(); | ||
|
|
||
| cy.contains('button', 'Delete Article').click(); | ||
|
|
There was a problem hiding this comment.
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.
| @@ -29,6 +29,14 @@ describe('Sign In page', () => { | |||
| }); | |||
|
|
|||
There was a problem hiding this comment.
Use data-qa selector instead of text matching. Consider adding data-cy="settings-link" to the Edit Profile Settings link.
| cy.contains('div[class="swal-title"]', 'Login failed!').should( | ||
| 'be.visible' | ||
| ); | ||
| }); |
There was a problem hiding this comment.
Use data-qa selector instead of text matching. Consider adding data-cy="sign-up-link" to the Sign up link.
|
|
||
| before(() => { | ||
| cy.task('db:clear'); | ||
| cy.task('generateUser').then((generateUser) => { | ||
| user = generateUser; | ||
| cy.register(user.email, user.username, user.password); | ||
| }); | ||
| }); | ||
|
|
There was a problem hiding this comment.
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().
|
|
||
| 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!' | ||
| ); |
There was a problem hiding this comment.
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).
|
|
||
| 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!' | ||
| ); |
There was a problem hiding this comment.
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).
| 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'); | ||
| }); | ||
|
|
There was a problem hiding this comment.
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).
|
|
||
| cy.getByDataCy('settings-email').clear(); | ||
| cy.getByDataCy('settings-email').type('testuser@gmail.test'); | ||
|
|
There was a problem hiding this comment.
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.
| .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; } |
There was a problem hiding this comment.
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.
|
|
||
| /* 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); } |
There was a problem hiding this comment.
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').
|
|
||
| it.skip('should be able to unfollow the another user', () => { | ||
| // The unfollow button never appears, so it's impossible to unfollow a user. |
There was a problem hiding this comment.
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'.
| cy.wait(1500); | ||
|
|
||
| cy.visit(`/#/@${userTarget.username}`); | ||
|
|
There was a problem hiding this comment.
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.
| cy.task('generateUser').then((generatedUser) => { | ||
| userTarget = generatedUser; | ||
| cy.register(userTarget.email, userTarget.username, userTarget.password); | ||
| }); |
There was a problem hiding this comment.
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').
|
|
||
| get publishArticleButton() { |
There was a problem hiding this comment.
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() { |
There was a problem hiding this comment.
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"> |
There was a problem hiding this comment.
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').
| > | ||
| Sign up | ||
| </button> |
There was a problem hiding this comment.
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" | ||
| /> |
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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
| /// <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'); | ||
| }); |
There was a problem hiding this comment.
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'.
| }); | ||
|
|
||
| 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(); | ||
|
|
There was a problem hiding this comment.
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').
|
|
||
| cy.get('div[class="swal-title"]').should( | ||
| 'contain', 'Registration failed!' | ||
| ); |
There was a problem hiding this comment.
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').
| let email; | ||
| let password; | ||
|
|
||
| beforeEach(() => { | ||
| cy.task('db:clear'); | ||
| cy.task('generateUser').then((user) => { |
There was a problem hiding this comment.
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.
|
|
||
| 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'); |
There was a problem hiding this comment.
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'
|
|
||
| get signUpBtn() { |
There was a problem hiding this comment.
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.
|
|
||
| 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}`); |
There was a problem hiding this comment.
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.
| /* 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; } |
There was a problem hiding this comment.
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'.
| .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; } |
There was a problem hiding this comment.
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.
| type="password" | ||
| v-model="user.password" | ||
| placeholder="Password" | ||
| data-cy="settings-password" | ||
| /> | ||
| </fieldset> | ||
| <button class="btn btn-lg btn-primary pull-xs-right"> |
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
Good progress, but you need to pass all CI checks/build
No description provided.