Skip to content

Commit

Permalink
Merge pull request #42 from sequra/feature/PAR-372-E2E-tests-for-Conf…
Browse files Browse the repository at this point in the history
…iguration-onboarding

Add onboarding configuration E2E test
  • Loading branch information
mescalantea authored Feb 6, 2025
2 parents 5e2d8bb + 1990fef commit 5a7d9e8
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions playwright.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ export default defineConfig({
use: { ...devices['Desktop Chrome'] },
testMatch: '001-checkout-product.spec.js',
},
{
name: 'configuration-onboarding',
use: { ...devices['Desktop Chrome'] },
testMatch: '003-configuration-onboarding.spec.js',
},
{
name: 'configuration-payment-methods',
use: { ...devices['Desktop Chrome'] },
Expand Down
3 changes: 2 additions & 1 deletion tests-e2e/fixtures/test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { test as baseTest, expect } from "@playwright/test";
import { DataProvider, PaymentMethodsSettingsPage } from "playwright-fixture-for-plugins";
import { DataProvider, PaymentMethodsSettingsPage, OnboardingSettingsPage } from "playwright-fixture-for-plugins";
import BackOffice from "./base/BackOffice";
import SeQuraHelper from "./utils/SeQuraHelper";
import ProductPage from "./pages/ProductPage";
Expand All @@ -12,6 +12,7 @@ const test = baseTest.extend({
paymentMethodsSettingsPage: async ({ page, baseURL, request, backOffice, helper}, use) => await use(new PaymentMethodsSettingsPage(page, baseURL, expect, request, backOffice, helper)),
productPage: async ({ page, baseURL, request}, use) => await use(new ProductPage(page, baseURL, expect, request)),
checkoutPage: async ({ page, baseURL, request}, use) => await use(new CheckoutPage(page, baseURL, expect, request)),
onboardingSettingsPage: async ({ page, baseURL, request, backOffice, helper}, use) => await use(new OnboardingSettingsPage(page, baseURL, expect, request, backOffice, helper)),
});

test.afterEach(async ({ page }, testInfo) => {
Expand Down
17 changes: 17 additions & 0 deletions tests-e2e/specs/003-configuration-onboarding.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { test } from '../fixtures/test';

test.describe('Configuration Onboarding', () => {
test('Configure using dummy', async ({ helper, dataProvider, onboardingSettingsPage }) => {
// Setup
const { clear_config } = helper.webhooks;
await helper.executeWebhook({ webhook: clear_config }); // Clear the configuration
const connect = { username: process.env.SQ_USER_NAME, password: process.env.SQ_USER_SECRET };
const countriesForm = { countries: dataProvider.countriesMerchantRefs(connect.username) };
const widgetForm = { assetsKey: process.env.SQ_ASSETS_KEY };
// Execution
await onboardingSettingsPage.goto();
await onboardingSettingsPage.fillConnectForm(connect);
await onboardingSettingsPage.fillCountriesForm(countriesForm);
await onboardingSettingsPage.fillWidgetsForm(widgetForm);
});
});

0 comments on commit 5a7d9e8

Please sign in to comment.