Skip to content

Commit

Permalink
NTR - Fix pay later test
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisGarding committed Jun 21, 2023
1 parent 0d2a699 commit d67d086
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions Tests/E2E/test/pay_later_button_is_shown.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,25 @@ test.describe('Test Pay Later is shown', () => {
await page.goto('/sommerwelten/beachwear/', { waitUntil: 'load' });

// Check listing page
const listingPageLocator = await page.frameLocator('.component-frame').first().locator('div[data-funding-source="paylater"]');
await expect(listingPageLocator.locator('.paypal-button-text')).toHaveText(/Später Bezahlen/);
let fistPayLaterButtonContainer = await page.locator('div[data-showpaylater="1"]').first();
await expect(fistPayLaterButtonContainer).toBeVisible();

// Go to detail page
await page.goto('/sommerwelten/beachwear/178/strandtuch-ibiza', { waitUntil: 'load' });

// Check product detail page
const detailPageLocator = await page.frameLocator('.component-frame').locator('div[data-funding-source="paylater"]');
await expect(detailPageLocator.locator('.paypal-button-text')).toHaveText(/Später Bezahlen/);
await expect(page.locator('div[data-showpaylater="1"]')).toBeVisible();

// Add product to cart
await page.click('.buybox--button');

// Check offcanvas basket
const offCanvasLocator = await page.locator('.ajax--cart').frameLocator('.component-frame').locator('div[data-funding-source="paylater"]');
await expect(offCanvasLocator.locator('.paypal-button-text')).toHaveText(/Später Bezahlen/);
await expect(page.locator('.ajax--cart').locator('div[data-showpaylater="1"]')).toBeVisible();

// Go to checkout
await page.goto('checkout/confirm', { waitUntil: 'load' });

// Check checkout page
const checkoutLocator = await page.frameLocator('.component-frame').locator('div[data-funding-source="paylater"]');
await expect(checkoutLocator.locator('.paypal-button-text')).toHaveText(/Später Bezahlen/);
await expect(page.locator('div[data-showpaylater="1"]')).toBeVisible();

// Login
await page.fill('#email', credentials.defaultShopCustomerEmail);
Expand All @@ -61,7 +57,6 @@ test.describe('Test Pay Later is shown', () => {
await page.click('text=Weiter >> nth=1');

// Check checkout confirm page
const checkoutConfirmLocator = await page.frameLocator('.component-frame').locator('div[data-funding-source="paylater"]');
await expect(checkoutConfirmLocator.locator('.paypal-button-text')).toHaveText(/Später Bezahlen/);
await expect(page.locator('div[data-showpaylater="1"]')).toBeVisible();
});
});

0 comments on commit d67d086

Please sign in to comment.