Skip to content

Commit

Permalink
NTR - Js code style
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisGarding committed Jun 26, 2023
1 parent 2acd0ec commit 9057d04
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 17 deletions.
6 changes: 3 additions & 3 deletions Tests/E2E/helper/backendLoginHelper.mjs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import credentials from '../test/credentials.mjs';
import {expect} from '@playwright/test';
import clearCacheHelper from "./clearCacheHelper.mjs";
import { expect } from '@playwright/test';
import clearCacheHelper from './clearCacheHelper.mjs';

export default (function() {
return {
login: async function(page) {
await clearCacheHelper.clearCache();

await page.goto('/backend', {waitUntil: 'load'});
await page.goto('/backend', { waitUntil: 'load' });

await expect(page).toHaveTitle(/Backend/);

Expand Down
2 changes: 1 addition & 1 deletion Tests/E2E/helper/clearCacheHelper.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ export default (function() {
resolve();
});
});
},
}
};
}());
2 changes: 0 additions & 2 deletions Tests/E2E/helper/cookieHelper.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ export default (function() {
* @param { FrameLocator } parentFrame
*/
acceptCookies: async function(parentFrame) {


const gdprCookieBanner = await parentFrame.locator('#gdprCookieBanner');
const acceptButton = await gdprCookieBanner.locator('button#acceptAllButton');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import credentials from './credentials.mjs';
import clearPaypalSettingsSql from '../helper/clearPaypalSettingsHelper.mjs';
import backendHandleSaveHelper from '../helper/backendHandleSaveHelper.mjs';
import backendLoginHelper from '../helper/backendLoginHelper.mjs';
import defaultPaypalSettingsSql from "../helper/paypalSqlHelper.mjs";
import clearCacheHelper from "../helper/clearCacheHelper.mjs";
import clearCacheHelper from '../helper/clearCacheHelper.mjs';

const connection = MysqlFactory.getInstance();

test.describe('Check the active state of PUI and ACDC', () => {
test.beforeEach(async() => {
await connection.query(clearPaypalSettingsSql);
await clearCacheHelper.clearCache();
});

test('Check active state', async({ page }) => {
Expand Down
1 change: 0 additions & 1 deletion Tests/E2E/test/pay_later_button_is_not_shown.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ test.describe('Test Pay Later is not shown', () => {
});

test('PayLater button is not shown: ProductDetailPage, OffCanvasBasket, CheckoutPage, ProductListingPage @notIn5.2', async({ page }) => {

// Go to product listing
await page.goto('/sommerwelten/beachwear/', { waitUntil: 'load' });

Expand Down
2 changes: 1 addition & 1 deletion Tests/E2E/test/pay_later_button_is_shown.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test.describe('Test Pay Later is shown', () => {
await page.goto('/sommerwelten/beachwear/', { waitUntil: 'load' });

// Check listing page
let fistPayLaterButtonContainer = await page.locator('div[data-showpaylater="1"]').first();
const fistPayLaterButtonContainer = await page.locator('div[data-showpaylater="1"]').first();
await expect(fistPayLaterButtonContainer).toBeVisible();

// Go to detail page
Expand Down
2 changes: 1 addition & 1 deletion Tests/E2E/test/pay_with_acdc.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import clearCacheHelper from '../helper/clearCacheHelper.mjs';
import cookieHelper from '../helper/cookieHelper.mjs';

import getPaypalPaymentMethodSelector from '../helper/getPayPalPaymentMethodSelector.mjs';
import credentials from "./credentials.mjs";
import credentials from './credentials.mjs';

const connection = MysqlFactory.getInstance();

Expand Down
10 changes: 5 additions & 5 deletions Tests/E2E/test/pay_with_express.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ test.describe('Is Express Checkout button available', () => {
url = url.replace(/buyerCountry=[A-Z]*/, '');
url += '&buyerCountry=DE';

route.continue({ url: url });
route.continue({ url });
});

await paypalPage.locator('#email').fill(credentials.paypalCustomerEmail);
Expand Down Expand Up @@ -75,7 +75,7 @@ test.describe('Is Express Checkout button available', () => {
url = url.replace(/buyerCountry=[A-Z]*/, '');
url += '&buyerCountry=DE';

route.continue({ url: url });
route.continue({ url });
});

await paypalPage.locator('#email').fill(credentials.paypalCustomerEmail);
Expand Down Expand Up @@ -122,7 +122,7 @@ test.describe('Is Express Checkout button available', () => {
url = url.replace(/buyerCountry=[A-Z]*/, '');
url += '&buyerCountry=DE';

route.continue({ url: url });
route.continue({ url });
});

await paypalPage.locator('#email').fill(credentials.paypalCustomerEmail);
Expand Down Expand Up @@ -168,7 +168,7 @@ test.describe('Is Express Checkout button available', () => {
url = url.replace(/buyerCountry=[A-Z]*/, '');
url += '&buyerCountry=DE';

route.continue({ url: url });
route.continue({ url });
});

await paypalPage.locator('#email').fill(credentials.paypalCustomerEmail);
Expand Down Expand Up @@ -205,7 +205,7 @@ test.describe('Is Express Checkout button available', () => {
url = url.replace(/buyerCountry=[A-Z]*/, '');
url += '&buyerCountry=DE';

route.continue({ url: url });
route.continue({ url });
});

await paypalPage.locator('#email').fill(credentials.paypalCustomerEmail);
Expand Down
2 changes: 1 addition & 1 deletion Tests/E2E/test/pay_with_sepa.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ test.describe('Is SEPA fully functional', () => {
url = url.replace(/buyerCountry=[A-Z]*/, '');
url += '&buyerCountry=DE';

route.continue({ url: url });
route.continue({ url });
});

await paypalPage.locator('#bankIban').fill(credentials.sepaIban);
Expand Down

0 comments on commit 9057d04

Please sign in to comment.