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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

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

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

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',

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,

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');

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);

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.

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