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

solution #183

Open
wants to merge 2 commits into
base: next
Choose a base branch
from
Open

Conversation

rodionpasternak
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.

It looks like there are several critical issues that need to be addressed to ensure the functionality of the code. Each method is missing essential parameters, and the navigation path is incomplete. Once these are fixed, your code will be in great shape! Keep up the good work and don't hesitate to reach out if you need any help. 😊

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

});

beforeEach(() => {

cy.task('db:clear');
cy.visit('');

Choose a reason for hiding this comment

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

The cy.visit(''); line should include the URL or path to the page you want to visit. Currently, it is empty, which means Cypress will not navigate to any page.


settingsPage.editUsername(user.username);
settingsPage.submitEdit();
settingsPage.verifyProfilePage(user.username);

Choose a reason for hiding this comment

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

The verifyProfilePage method is called with user.username, but the default parameter in verifyProfilePage is 'riot'. Ensure that the verifyProfilePage method in settings.pageObject.js is correctly using the passed username parameter.

}

editUsername() {
this.usernameField.clear().type(username);

Choose a reason for hiding this comment

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

The editUsername method is missing the username parameter. You should pass username as an argument to this method to ensure it works correctly.

}

editBio() {
this.bioField.clear().type(bio);

Choose a reason for hiding this comment

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

The editBio method is missing the bio parameter. You should pass bio as an argument to this method to ensure it works correctly.

}

editEmail() {
this.emailField.clear().type(email);

Choose a reason for hiding this comment

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

The editEmail method is missing the email parameter. You should pass email as an argument to this method to ensure it works correctly.

}

editPassword() {
this.passwordField.clear().type(password);

Choose a reason for hiding this comment

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

The editPassword method is missing the password parameter. You should pass password as an argument to this method to ensure it works correctly.

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 work on implementing the functionality! 🎉 There are a few areas for improvement: ensure methods like verifyLogout and verifyProfilePage can handle dynamic usernames, and verify updates for password, email, and bio changes. Also, make sure the cy.login() and cy.register() methods use the same user data for consistency. Addressing these will enhance your code's robustness. Keep learning and improving! 🚀

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


cy.task('db:clear');
cy.visit('/');
cy.register();

Choose a reason for hiding this comment

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

The cy.register() method is called here, but it is not clear if it uses the user object generated in the before hook. Ensure that the registration process uses the same user data to maintain consistency across tests.

cy.task('db:clear');
cy.visit('/');
cy.register();
cy.login();

Choose a reason for hiding this comment

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

The cy.login() method is called here, but it is not clear if it uses the user object generated in the before hook. Ensure that the login process uses the same user data to maintain consistency across tests.


settingsPage.editUsername(user.username);
settingsPage.submitEdit();
settingsPage.verifyProfilePage(user.username);

Choose a reason for hiding this comment

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

The verifyProfilePage method is used here to verify the username update. Ensure that this method correctly checks the updated username on the profile page.

});

it('should provide an ability to update bio', () => {

settingsPage.editBio(user.bio);
settingsPage.submitEdit();

Choose a reason for hiding this comment

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

After updating the bio, consider adding a verification step similar to the username update to ensure the bio has been updated successfully.

});

it('should provide an ability to update an email', () => {

settingsPage.editEmail(user.email);
settingsPage.submitEdit();

Choose a reason for hiding this comment

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

After updating the email, consider adding a verification step to ensure the email has been updated successfully.

});

it('should provide an ability to update password', () => {

settingsPage.editPassword(user.password);
settingsPage.submitEdit();

Choose a reason for hiding this comment

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

After updating the password, consider adding a verification step to ensure the password has been updated successfully.

});

it('should provide an ability to log out', () => {

settingsPage.logoutUser();
settingsPage.verifyLogout();

Choose a reason for hiding this comment

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

The verifyLogout method is used here to verify the logout functionality. Ensure that this method correctly checks that the user is logged out.

this.logoutBtn.click();
}

verifyProfilePage(username='riot') {

Choose a reason for hiding this comment

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

The verifyProfilePage method uses a default username 'riot'. Ensure that this method can accept dynamic usernames to verify the profile page for different users.

return cy.url().should('contain', `/profile/${username}`);
}

verifyLogout(username='riot') {

Choose a reason for hiding this comment

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

The verifyLogout method uses a default username 'riot'. Ensure that this method can accept dynamic usernames to verify the logout functionality for different users.

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