Checkout with invalid data S839bb7c9→

3 0 0

Tests (6)

A

Checkout with no data Tffee7008→

Description
Code
    test("Checkout with no data", async ({ page, loginPage, cartReady }) => {
      const checkout = new Checkout(page);

      await checkout.clickCheckout();

      // without filling the data


      await checkout.clickContinue();

      await expect(
        page.locator(".error-message-container.error")
      ).toBeVisible();

      await expect(page.locator("h3[data-test='error']")).toHaveText(
        "Error: First Name is required"
      );

      await page.waitForTimeout(2000);
    });

A

Checkout without Last Name And Zip Code T5f8d3365→

Description
Code
    test("Checkout without Last Name And Zip Code", async ({
      page,
      loginPage,
      cartReady,
    }) => {
      const checkout = new Checkout(page);

      await checkout.clickCheckout();

      await checkout.completeInfo("Kamran");

      await checkout.clickContinue();

      await expect(
        page.locator(".error-message-container.error")
      ).toBeVisible();

      await expect(page.locator("h3[data-test='error']")).toHaveText(
        "Error: Last Name is required"
      );

      await page.waitForTimeout(2000);
    });

A

Checkout without Zip Code T4149293d→

Description
Code
    test("Checkout without Zip Code", async ({
      page,
      loginPage,
      cartReady,
    }) => {
      const checkout = new Checkout(page);

      await checkout.clickCheckout();

      await checkout.completeInfo("Kamran", "Musadirli");

      await checkout.clickContinue();

      await expect(
        page.locator(".error-message-container.error")
      ).toBeVisible();

      await expect(page.locator("h3[data-test='error']")).toHaveText(
        "Error: Postal Code is required"
      );

      await page.waitForTimeout(2000);
    });

M

Checkout with no data Te05515cd→

Description
### Description
Verify that a user cannot complete an order without entering required data

### Preconditions
User is logged in. User is on [https://www.saucedemo.com/checkout-step-one.html](https://www.saucedemo.com/checkout-step-one.html). 


### Steps

| # | Action | Test Data | Expected Result |
|---|---------|------------|----------------|
| 1 | Leave **First Name** field empty | - | First Name field is empty |
| 2 | Leave **Last Name** filed empty | - | Last Name field is empty |
| 3 | Leave **Zip Code** field empty | - | Zip/Postal Code field is empty |
| 4 | Click “Continue” button | - | User is not allowed to proceed to the next step |
| 5 | Verify that the **"Error: First Name is required"** error message is displayed  | - | Error message is shown below the input field |



![](/attachments/Nhj9vzXvxT.png)

### Expected Result
User is unable to proceed with the checkout and sees the error message: "Error: First Name is required"
M

Checkout without Last Name And Zip Code T2cce08d7→

Description
### Description
Verify that a user cannot complete an order without entering **all** required data.

### Preconditions
User is logged in. User is on [https://www.saucedemo.com/checkout-step-one.html](https://www.saucedemo.com/checkout-step-one.html). 


### Steps

| # | Action | Test Data | Expected Result |
|---|---------|------------|----------------|
| 1 | Enter **First Name**  | Kamran | First name is entered successfully |
| 2 | Leave **Last Name** filed empty | - | Last Name field is empty |
| 3 | Leave **Zip Code** field empty | - | Zip/Postal Code field is empty |
| 4 | Click “Continue” button | - | User is not allowed to proceed to the next step |
| 5 | Verify that the **"Error: Last Name is required"** error message is displayed  | - | Error message is shown below the input field |

![](/attachments/XWTd8bb5HT.png)
### Expected Result
User is unable to proceed with the checkout and sees the error message: "Error: Last Name is required"
Attachments
M

Checkout without Zip Code Ta01306cb→

Description
### Description
Verify that a user cannot complete an order without entering **all** required data.

### Preconditions
User is logged in. User is on [https://www.saucedemo.com/checkout-step-one.html](https://www.saucedemo.com/checkout-step-one.html). 


### Steps

| # | Action | Test Data | Expected Result |
|---|---------|------------|----------------|
| 1 | Enter **First Name**  | Kamran | First name is entered successfully |
| 2 | Enter **Last Name**  | Musadirli | Last Name is entered successfully |
| 3 | Leave **Zip Code** field empty | - | Zip/Postal Code field remains empty |
| 4 | Click “Continue” button | - | User is not allowed to proceed to the next step |
| 5 | Verify that the **"Error: Postal Code is required"** error message is displayed  | - | Error message is shown below the input field |

![](/attachments/kR6V9KT9MV.png)

### Expected Result
User is unable to proceed with the checkout and sees the error message: "Error: Postal is required"
Attachments