Skip to content

Commit

Permalink
I deleted the comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
NazarAntoniuk19 committed Feb 13, 2025
1 parent 08d1833 commit 8f8c952
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions test-mocha/specs/checkout-test-case.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,53 +6,43 @@ describe("Checkout functionality", () => {
await loginPage.open();
await loginPage.login("standard_user", "secret_sauce");

// Checking the availability of a block with products
const inventoryContainer = await $("#inventory_container");
await expect(inventoryContainer).toBeDisplayed();

// To click on the "Add to cart" button
await menuPage.clickAddToCardBtn();

const badgeValue = await menuPage.badgeShoppingCard.getText();
console.log(`Badge value: ${badgeValue}`);
expect(badgeValue).toBe("1");

// To click on the "Cart" button
await menuPage.clickCartBtn();

const cartItemText = await menuPage.cartItemName.getText();
const trimmedCartItemText = cartItemText.trim();
console.log(`Product in the cart: ${trimmedCartItemText}`);
expect(trimmedCartItemText).toBe("Sauce Labs Backpack");

// Open the Checkout page
await menuPage.clickCheckoutBtn();

const checkoutTitle = await $(".title=Checkout: Your Information");
await expect(checkoutTitle).toBeDisplayed();

// To fill the "First Name" field
await menuPage.setValueInputValidFirstName();

// To fill the "Last Name" field
await menuPage.setValueInputValidLastName();

// To fill the "Postal Code" field
await menuPage.setValueInputPostalCode();

// To click on the "Continue" button
await menuPage.clickContinueBtn();

const overviewTitle = await $(".title=Checkout: Overview");
await expect(overviewTitle).toBeDisplayed();

// To finish the order
await menuPage.clickFinishBtn();

const thankYouMessage = await $(".complete-header");
await expect(thankYouMessage).toHaveText("Thank you for your order!");

// To click on the "Back Home" button
await menuPage.clickBackHomeBtn();

const inventoryTitle = await $(".title=Products");
Expand Down

0 comments on commit 8f8c952

Please sign in to comment.