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

DemoBlaze e2e #287

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

DemoBlaze e2e #287

wants to merge 2 commits into from

Conversation

Sofi-Mamzer
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 few issues that need to be addressed before approving the pull request. These include a syntax error, a potential issue with method functionality, and a typo in a variable name. Please fix these to ensure the code functions correctly. 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! ✨

const productPage = new ProductPageObject();
const cartPage = new CartPage();

const catagoryName = 'Laptops';

Choose a reason for hiding this comment

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

There is a typo in the variable name 'catagoryName'. It should be 'categoryName' to match the correct spelling of 'category'.

homePage.clickOnCategory(catagoryName);
homePage.clickOnProduct(productName);

productPage.addToCartBtn.click();

Choose a reason for hiding this comment

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

The method 'addToCartBtn.click()' seems to be directly accessing a button element. Ensure that 'addToCartBtn' is a method that performs the click action, or if it's a property, it should be a function call to perform the click.

cartPage.visitCart();
cartPage.assertProductInCart(productName);

cartPage.placeOrderBtn();

Choose a reason for hiding this comment

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

The method 'placeOrderBtn()' should be checked to ensure it performs the intended action. If 'placeOrderBtn' is a button element, it should be a function call to perform the click.

cy.contains('.btn', 'Purchase').click();
};

assertEnteredDataOnModal

Choose a reason for hiding this comment

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

There is a syntax error here. The method name assertEnteredDataOnModal should be followed by parentheses () to define it as a function.

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.

The code is well-structured and follows the expected pattern for a page object in Cypress. However, there are a few issues to address: an unnecessary semicolon at the end of a method definition and a potential misuse of placeOrderBtn. These should be reviewed and corrected to improve code quality. Keep up the good work and use this feedback to enhance your skills! 🚀

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

cartPage.visitCart();
cartPage.assertProductInCart(productName);

cartPage.placeOrderBtn();

Choose a reason for hiding this comment

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

This line seems to be calling placeOrderBtn as if it were a function, but it might be a property or element. Ensure that placeOrderBtn is a function if you intend to call it this way, or adjust the syntax if it's a property.

class CartPage extends PageObject {
visitCart() {
cy.contains('#cartur', 'Cart').click();
};

Choose a reason for hiding this comment

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

There's an unnecessary semicolon at the end of the method definition. In JavaScript, semicolons are not required after method definitions within a class.


assertProductInCart(productName) {
cy.contains(productName).should('be.visible');
};

Choose a reason for hiding this comment

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

There's an unnecessary semicolon at the end of the method definition. In JavaScript, semicolons are not required after method definitions within a class.


placeOrderBtn() {
cy.contains('.btn-success', 'Place Order').click();
};

Choose a reason for hiding this comment

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

There's an unnecessary semicolon at the end of the method definition. In JavaScript, semicolons are not required after method definitions within a class.

cy.get('#month').type(month);
cy.get('#city').type(city);
cy.get('#year').type(year);
};

Choose a reason for hiding this comment

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

There's an unnecessary semicolon at the end of the method definition. In JavaScript, semicolons are not required after method definitions within a class.


confirmOrder() {
cy.contains('.btn', 'Purchase').click();
};

Choose a reason for hiding this comment

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

There's an unnecessary semicolon at the end of the method definition. In JavaScript, semicolons are not required after method definitions within a class.

assertEnteredDataOnModal (orderName, creditCard) {
cy.get('.lead.text-muted').should('contain', orderName)
.and('contain', creditCard);
};

Choose a reason for hiding this comment

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

There's an unnecessary semicolon at the end of the method definition. In JavaScript, semicolons are not required after method definitions within a class.


clickOk() {
cy.contains('OK').click();
};

Choose a reason for hiding this comment

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

There's an unnecessary semicolon at the end of the method definition. In JavaScript, semicolons are not required after method definitions within a class.

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