-
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
Solution #281
base: main
Are you sure you want to change the base?
Solution #281
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.
Great job on implementing the CartPageObject class and the page objects for the home and catalogue pages! 🎉 The functionality seems solid, and while there are minor issues like a missing semicolon, they don't impact the core functionality. Keep up the good work and consider addressing these minor points in future updates!
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
describe('', () => { | ||
before(() => { | ||
import { CartPageObject } from '../support/pages/cart.pageObject'; | ||
import HomeAndCataloguePageObject |
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 missing semicolon at the end of the import statement. This might cause issues depending on your project's configuration.
const testData = { | ||
product: 'Sony vaio i7', | ||
category: 'Laptops', | ||
alertMessage: 'Product added', |
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 alert message 'Product added' should be consistent with the actual alert message displayed by the application. Ensure that this string matches exactly what the application shows.
city: faker.location.city(), | ||
card: faker.finance.creditCardNumber(), | ||
month: faker.date.month(), | ||
year: Math.floor(Math.random() * (2024 - 1900 + 1)) + 1900, |
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 random year generation logic seems to be correct, but ensure that the range (1900 to 2024) is what you intend for your test case. If you need a specific range, adjust the logic accordingly.
homePage.clickOnProduct('Sony vaio i7'); | ||
homePage.clickOnButton('Add to cart'); | ||
|
||
homePage.verifyAlertMessage('Product added'); |
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.
Ensure that the alert message 'Product added' used here matches the actual alert message from the application. Any discrepancy will cause this verification to fail.
testData.card, testData.month, testData.year); | ||
|
||
cartPage.clickOnButton('Purchase'); | ||
cartPage.verifyEnteredDataOnModalWindow(testData.name, testData.card); |
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.
Ensure that the method 'verifyEnteredDataOnModalWindow' correctly verifies the data on the modal window. If the modal displays data differently, you may need to adjust this method.
No description provided.