Skip to content

Commit

Permalink
attempt to fix cart tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-kurmanov committed Dec 4, 2023
1 parent 9bddb51 commit 48dead3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions playwright/payment.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ const url = "https://surveyjstest.azurewebsites.net";
// const url = "http://localhost:62946";

test('Cart: vat number field', async ({ page }) => {
test.setTimeout(480000);

await page.goto(`${url}/pricing`);
await page.locator('a').filter({ hasText: 'Accept All' }).click();
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();
Expand All @@ -20,16 +24,16 @@ test('Cart: vat number field', async ({ page }) => {
await page.getByPlaceholder('Company Name').click();
await page.getByPlaceholder('Company Name').fill("Comp inc.");

await page.getByPlaceholder('VAT Number').click();
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-required")).toBeVisible();
await expect(page.locator("[data-name=companyVATNumber] .v2-class---text-edit__title--disabled")).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-required")).toBeHidden();
await expect(page.locator("[data-name=companyVATNumber] .v2-class---text-edit__title--disabled")).toBeVisible();
});


Expand Down

0 comments on commit 48dead3

Please sign in to comment.