Skip to content

Commit

Permalink
DTSCCI-862 Playwright Setup (#4845)
Browse files Browse the repository at this point in the history
* playwright-e2e setup

* adding users to playwright-e2e

* add more users

* enforcing one userKey per user

* complete setup of playwright test repo

* moved 'wa' folder to e2e

* remove unneeded projects

* add export to env.d.ts

* updating gitignorec

* adding playwright-core, required for axe-core

* update yarn lock

* fixed lint issues

* playwright sonar exclusions

* remove unneeded code and updated sonar properties

* move wa folder back to root

* updating yarn version

* updating node version

* setting version of yarn in project

---------

Co-authored-by: Ruban <[email protected]>
  • Loading branch information
kdaHMCTS and ruban72 authored Oct 1, 2024
1 parent 299c449 commit 9efcdc2
Show file tree
Hide file tree
Showing 73 changed files with 3,480 additions and 1,755 deletions.
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ bin/main/application.yaml

.DS_Store

# dotenv environment variables file
.env
.env.test

# node_modules
package-lock.json
Expand All @@ -42,3 +45,19 @@ charts/civil-ccd/Chart.lock
!.yarn/releases
!.yarn/sdks
!.yarn/versions
/test-results/
/playwright-report/
/blob-report/
playwright/.cache/

# Playwright
test-results/
allure-results/
allure-functional-results/
allure-bootstrap-results/
allure-report/
allure-functional-report/
allure-bootstrap-report/
playwright-report/
/playwright-e2e/fixtures/.users/
/playwright-e2e/fixtures/.user-cookies/
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.20.0
20.12.2
873 changes: 0 additions & 873 deletions .yarn/releases/yarn-3.5.0.cjs

This file was deleted.

875 changes: 0 additions & 875 deletions .yarn/releases/yarn-3.7.0.cjs

This file was deleted.

875 changes: 875 additions & 0 deletions .yarn/releases/yarn-3.8.5.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-3.7.0.cjs
yarnPath: .yarn/releases/yarn-3.8.5.cjs
35 changes: 35 additions & 0 deletions env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
declare global {
namespace NodeJS {
interface ProcessEnv {
CI: string;
CCD_UI_TESTS: string;
FUNCTIONAL: string;
ENVIRONMENT: string;
URL: string;
SERVICE_AUTH_PROVIDER_API_BASE_URL: string;
CCD_DATA_STORE_URL: string;
DM_STORE_URL: string;
IDAM_WEB_URL: string;
IDAM_API_URL: string;
CIVIL_SERVICE_URL: string;
CIVIL_GENERAL_APPLICATIONS_URL: string;
WA_TASK_MGMT_URL: string;
AAC_API_URL: string;
CIVIL_ORCHESTRATOR_SERVICE_URL: string;
PAYMENT_API_URL: string;
WIRE_MOCK_SERVICE_URL: string;
DEFAULT_PASSWORD: string;
JUDGE_DEFAULT_PASSWORD: string;
IAC_DEFAULT_PASSWORD: string;
SYSTEM_USER_PASSWORD: string;
SHOW_BROWSER_WINDOW: string;
UI_SOFT_EXPECT: string;
IDAM_STUB_ENABLED: string;
RUN_ACCESSIBILITY_TESTS: string;
S2S_SECRET: string;
XUI_S2S_SECRET: string;
}
}
}

export {};
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,13 @@
},
"license": "MIT",
"devDependencies": {
"@axe-core/playwright": "^4.10.0",
"@playwright/test": "^1.47.1",
"@types/node": "^22.5.5",
"chai": "^4.3.4",
"codeceptjs": "^3.5.11",
"deep-equal-in-any-order": "^1.0.28",
"dotenv": "^16.4.5",
"eslint": "^8.20.0",
"eslint-plugin-codeceptjs": "^1.3.0",
"faker": "^5.5.3",
Expand All @@ -102,12 +106,14 @@
"node-cache": "^5.1.2",
"node-fetch": "^2.6.9",
"playwright": "^1.41.1",
"playwright-core": "^1.47.2",
"totp-generator": "^0.0.14",
"typescript": "^5.6.2",
"uuid": "^3.4.0",
"webdriverio": "^6.12.1"
},
"resolutions": {
"minimatch": "^3.0.5"
},
"packageManager": "yarn@3.7.0"
"packageManager": "yarn@3.8.5"
}
10 changes: 10 additions & 0 deletions playwright-e2e/base/base-api-steps.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import BaseSteps from './base-steps';
import TestData from '../types/test-data';

export default abstract class BaseApiSteps extends BaseSteps {

constructor(isSetupTest: boolean, testData: TestData) {
super(testData);
}

}
20 changes: 20 additions & 0 deletions playwright-e2e/base/base-page-factory.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import AxeBuilder from '@axe-core/playwright';
import { Page } from '@playwright/test';

export default abstract class BasePageFactory {
private _page: Page;
private _axeBuilder: AxeBuilder;

constructor(page: Page, axeBuilder: AxeBuilder) {
this._page = page;
this._axeBuilder = axeBuilder;
}

protected get page() {
return this._page;
}

protected get axeBuilder() {
return this._axeBuilder;
}
}
Loading

0 comments on commit 9efcdc2

Please sign in to comment.