-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5378b93
commit 04c096b
Showing
13 changed files
with
172 additions
and
214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,27 @@ | ||
import credentials from '../test/credentials.mjs'; | ||
import { expect } from '@playwright/test'; | ||
import {expect} from '@playwright/test'; | ||
import clearCacheHelper from "./clearCacheHelper.mjs"; | ||
|
||
export default (function () { | ||
export default (function() { | ||
return { | ||
login: async function (page) { | ||
await page.goto('/backend', { waitUntil: 'load' }); | ||
login: async function(page) { | ||
await clearCacheHelper.clearCache(); | ||
|
||
await page.goto('/backend', {waitUntil: 'load'}); | ||
|
||
await expect(page).toHaveTitle(/Backend/); | ||
await expect(page.locator('#button-1019-btnEl')).toHaveText(/Login/); | ||
|
||
const userNameField = await page.locator('input[name="username"]'); | ||
// Wait for the focus change of the shopware login | ||
await expect(page.locator('input[name="username"]')).toBeFocused(); | ||
await expect(userNameField).toBeFocused(); | ||
|
||
await page.fill('input[name="username"]', credentials.defaultBackendUserUsername); | ||
await page.fill('input[name="password"]', credentials.defaultBackendUserPassword); | ||
await userNameField.type(credentials.defaultBackendUserUsername); | ||
await page.locator('input[name="password"]').type(credentials.defaultBackendUserPassword); | ||
|
||
await page.click('#button-1019-btnEl'); | ||
|
||
await page.waitForLoadState('load'); | ||
await page.waitForLoadState('networkidle', { timeout: 5000 }); | ||
} | ||
}; | ||
}()); |
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
Tests/E2E/helper/scenario/pay_with_card/scenarioHelper.mjs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import {test, expect} from '@playwright/test'; | ||
import credentials from './credentials.mjs'; | ||
import MysqlFactory from '../helper/mysqlFactory.mjs'; | ||
import defaultPaypalSettingsSql from '../helper/paypalSqlHelper.mjs'; | ||
import clearCacheHelper from '../helper/clearCacheHelper.mjs'; | ||
import getPaypalPaymentMethodSelector from '../helper/getPayPalPaymentMethodSelector.mjs'; | ||
import payLaterSettingsHelper from '../helper/payLaterSettingsHelper.mjs'; | ||
|
||
const connection = MysqlFactory.getInstance(); | ||
|
||
test.use({ locale: 'de-DE' }); | ||
|
||
test.describe('Test Pay Later is shown', () => { | ||
test.beforeEach(async() => { | ||
await connection.query(defaultPaypalSettingsSql); | ||
await payLaterSettingsHelper.activateAll(); | ||
await clearCacheHelper.clearCache(); | ||
}); | ||
|
||
test('Is PayLater button available: ProductDetailPage, OffCanvasBasket, CheckoutPage, ProductListingPage @notIn5.2', async({ page }) => { | ||
test.skip(); | ||
// Go to product listing | ||
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/); | ||
|
||
// 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/); | ||
|
||
// 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/); | ||
|
||
// 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/); | ||
|
||
// Login | ||
await page.fill('#email', credentials.defaultShopCustomerEmail); | ||
await page.fill('#passwort', credentials.defaultShopCustomerPassword); | ||
await page.click('.register--login-btn'); | ||
|
||
// Change payment | ||
await page.click('.btn--change-payment'); | ||
|
||
const selector = await getPaypalPaymentMethodSelector.getSelector( | ||
getPaypalPaymentMethodSelector.paymentMethodNames.SwagPaymentPayPalUnified | ||
); | ||
|
||
await page.locator(selector).check(); | ||
await page.waitForLoadState('load'); | ||
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/); | ||
}); | ||
}); |
Oops, something went wrong.