Skip to content

Commit

Permalink
fixed card payment test
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-kurmanov committed Dec 12, 2023
1 parent dcac21c commit b38d1d8
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions playwright/payment.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,27 @@ test('Cart: vat number field', async ({ page }) => {
await page.locator('div:nth-child(4) > .v2-class---pricing-header__content > div:nth-child(2) > .v2-class---button').first().click();

await page.waitForTimeout(5000);
await page.locator("[data-name=companyVATNumber]").click();

await expect(page.locator("[data-name=companyVATNumber]")).toBeVisible();
await expect(page.locator("[data-name=companyVATNumber] .v2-class---text-edit__title-required")).toBeHidden();
await page.getByPlaceholder('Country').click();
await page.getByPlaceholder('Country').type("A");
await page.getByText('Austria').click();

await expect(page.locator("[data-name=companyVATNumber]")).toBeVisible();
await expect(page.locator("[data-name=companyVATNumber] .v2-class---text-edit__title-required")).toBeHidden();
await expect(page.locator("[data-name=companyVATNumber] .v2-class---text-edit__title-required")).toBeVisible();

await page.getByPlaceholder('Company Name').click();
await page.getByPlaceholder('Company Name').fill("Comp inc.");

await expect(page.locator('.v2-class---text-edit__title--disabled').getByText("VAT Number")).toBeVisible();

await expect(page.locator("[data-name=companyVATNumber]")).toBeVisible();
await expect(page.locator("[data-name=companyVATNumber] .v2-class---text-edit__title--disabled")).toBeVisible();
await expect(page.locator("[data-name=companyVATNumber] .v2-class---text-edit__title-required")).toBeVisible();

await page.locator("[data-name=country]").click();
await page.getByText('Australia').click();

await expect(page.locator("[data-name=companyVATNumber]")).toBeVisible();
await expect(page.locator("[data-name=companyVATNumber] .v2-class---text-edit__title--disabled")).toBeVisible();
await expect(page.locator("[data-name=companyVATNumber] .v2-class---text-edit__title-required")).toBeHidden();
});


Expand Down

0 comments on commit b38d1d8

Please sign in to comment.