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 #301

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

Solution #301

wants to merge 2 commits into from

Conversation

tperepelytsia
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 a couple of critical issues that need attention. The custom command cy.createArticle should be verified for correct implementation, and the cy.visit(''); command needs a valid URL to ensure proper navigation. Once these are addressed, your code will be in great shape! Keep up the good work! 🌟

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


beforeEach(() => {
cy.login(user);
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(''); command is visiting an empty URL, which might not be the intended behavior. Ensure that the correct URL or path is provided to navigate to the desired page.

});

it('', () => {
it('should delete the article', () => {
cy.createArticle(user, articlePayload);

Choose a reason for hiding this comment

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

The cy.createArticle(user, articlePayload); command suggests a custom command is being used. Ensure that this custom command is correctly defined in your Cypress support files and that it behaves as expected.

Copy link

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

Choose a reason for hiding this comment

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

Great job on setting up the configuration! While there are a few areas for improvement, such as optimizing the login process and ensuring correct command definitions, these are minor and don't critically impact functionality. Keep up the good work and consider the feedback for future enhancements! 😊

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


beforeEach(() => {
cy.login(user);
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(''); command is visiting an empty URL. Ensure that the correct URL or path is provided to visit the intended page.

});

it('', () => {
it('should delete the article', () => {
cy.createArticle(user, articlePayload);

Choose a reason for hiding this comment

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

The cy.createArticle(user, articlePayload); command assumes that a custom command createArticle exists. Ensure that this command is defined in your Cypress commands file, or replace it with the appropriate steps to create an article.

Cypress.Commands.add('createArticle', (user, article) => {
cy.request({
method: 'POST',
url: '/api/users/login',

Choose a reason for hiding this comment

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

It seems like the login request is being made again in the 'createArticle' command. If the user is already logged in, this step might be redundant. Consider reusing the authentication token from the 'login' command if possible.

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