Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaymo committed Apr 22, 2024
1 parent 7b521f3 commit 43165a8
Show file tree
Hide file tree
Showing 16 changed files with 80 additions and 1,271 deletions.
5 changes: 0 additions & 5 deletions .idea/php.xml

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

10 changes: 5 additions & 5 deletions tests/Playwright/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
node_modules
pw-browsers
test-results
.env
yarn.lock
node_modules/
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
13 changes: 0 additions & 13 deletions tests/Playwright/README.md

This file was deleted.

15 changes: 11 additions & 4 deletions tests/Playwright/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
{
"license": "MIT",
"dependencies": {
"@playwright/test": "^1.34.2",
"dotenv": "^16.0.3"
"name": "playwright",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@playwright/test": "^1.43.1",
"@types/node": "^20.12.7"
}
}
179 changes: 64 additions & 115 deletions tests/Playwright/playwright.config.js
Original file line number Diff line number Diff line change
@@ -1,130 +1,79 @@
// @ts-check
const {defineConfig, devices} = require('@playwright/test');
const { defineConfig, devices } = require('@playwright/test');

/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
require('dotenv').config();
const testRailOptions = {
// Whether to add <properties> with all annotations; default is false
embedAnnotationsAsProperties: true,
// Where to put the report.
outputFile: './test-results/junit-report.xml'
};
// require('dotenv').config();

/**
* @see https://playwright.dev/docs/test-configuration
*/
module.exports = defineConfig({
retries: 0,
testDir: './tests',
/* Run tests in files in parallel */
fullyParallel: false,
//timeout: 120000,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: [
['line'],
['junit', testRailOptions]
],
//globalSetup: './globalSetup.js',
testDir: './tests',
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
// baseURL: 'http://127.0.0.1:3000',

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
},

/* Configure projects for major browsers */
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},

/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
baseURL: process.env.BASEURL,
storageState: './storageState.json',
extraHTTPHeaders: {'ngrok-skip-browser-warning': '123'},
//actionTimeout: 120000,
ignoreHTTPSErrors: true,
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
video: {
mode: 'on-first-retry',
size: {width: 1280, height: 720},
dir: './videos'
}
{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
},

/* Configure projects for major browsers */
projects: [
{
name: 'setup-default-settings-merchant',
testMatch: './tests/Shared/setup-default-settings-merchant.spec.js',
use: {
...devices['Desktop Chrome'],
baseURL: process.env.BASEURL_DEFAULT_80
}
},
/*{
name: 'setup-settings-merchant',
testMatch: './tests/Shared/setup-default-settings-merchant.spec.js',
use: {
...devices['Desktop Chrome'],
baseURL: process.env.BASEURL_SETTINGS_80
}
},
{
name: 'setup-payment-api-merchant',
testMatch: './tests/Shared/setup-default-settings-merchant.spec.js',
use: {
...devices['Desktop Chrome'],
baseURL: process.env.BASEURL_PAYMENT_80
}
},
{
name: 'plugins-page-80',
testDir: './tests/Plugins page',
dependencies: ['setup-settings-merchant'],
use: {
...devices['Desktop Chrome'],
testIdAttribute: 'data-slug',
baseURL: process.env.BASEURL_SETTINGS_80
}
},
{
name: 'woo-payments-tab-80',
testDir: './tests/WooCommerce Payments tab',
dependencies: ['setup-default-settings-merchant'],
use: {
...devices['Desktop Chrome'],
baseURL: process.env.BASEURL_DEFAULT_80
}
},*/
{
name: 'transaction-scenarios-orders-80',
testDir: './tests/transaction',
dependencies: ['setup-default-settings-merchant'],
use: {
...devices['Desktop Chrome'],
baseURL: process.env.BASEURL_DEFAULT_80
}
},
/*{
name: 'transaction-scenarios-payments-80',
testDir: './tests/Transaction Scenarios',
dependencies: ['setup-payment-api-merchant'],
use: {
...devices['Desktop Chrome'],
baseURL: process.env.BASEURL_PAYMENT_80
}
},
{
name: 'mollie-settings-tab-80',
testDir: './tests/Mollie Settings tab',
dependencies: ['setup-settings-merchant'],
use: {
...devices['Desktop Chrome'],
baseURL: process.env.BASEURL_SETTINGS_80
}
},
{
name: 'error-handling-80',
testDir: './tests/Error Handling',
dependencies: ['setup-default-settings-merchant'],
use: {
...devices['Desktop Chrome'],
baseURL: process.env.BASEURL_DEFAULT_80
}
},*/
],
{
name: 'webkit',
use: { ...devices['Desktop Safari'] },
},

/* Test against mobile viewports. */
// {
// name: 'Mobile Chrome',
// use: { ...devices['Pixel 5'] },
// },
// {
// name: 'Mobile Safari',
// use: { ...devices['iPhone 12'] },
// },

/* Test against branded browsers. */
// {
// name: 'Microsoft Edge',
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
// },
// {
// name: 'Google Chrome',
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
// },
],

/* Run your local dev server before starting the tests */
// webServer: {
// command: 'npm run start',
// url: 'http://127.0.0.1:3000',
// reuseExistingServer: !process.env.CI,
// },
});

22 changes: 0 additions & 22 deletions tests/Playwright/tests/Shared/base-test.js

This file was deleted.

17 changes: 0 additions & 17 deletions tests/Playwright/tests/Shared/gateways.js

This file was deleted.

38 changes: 0 additions & 38 deletions tests/Playwright/tests/Shared/manualOrder.js

This file was deleted.

Loading

0 comments on commit 43165a8

Please sign in to comment.