-
Notifications
You must be signed in to change notification settings - Fork 318
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
base: main
Are you sure you want to change the base?
DemoBlaze e2e #287
Conversation
There was a problem hiding this 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! ✨
cypress/e2e/checkout.cy.js
Outdated
const productPage = new ProductPageObject(); | ||
const cartPage = new CartPage(); | ||
|
||
const catagoryName = 'Laptops'; |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this 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(); |
There was a problem hiding this comment.
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(); | ||
}; |
There was a problem hiding this comment.
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'); | ||
}; |
There was a problem hiding this comment.
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(); | ||
}; |
There was a problem hiding this comment.
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); | ||
}; |
There was a problem hiding this comment.
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(); | ||
}; |
There was a problem hiding this comment.
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); | ||
}; |
There was a problem hiding this comment.
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(); | ||
}; |
There was a problem hiding this comment.
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.
No description provided.