Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feature/upgrade-puppeteer' into …
Browse files Browse the repository at this point in the history
…feature/docker-and-package-upgrades-new
  • Loading branch information
lukehesluke committed Sep 22, 2023
2 parents 8ae02f2 + 7fb9d9d commit d3c7d5e
Show file tree
Hide file tree
Showing 20 changed files with 64 additions and 93 deletions.
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,21 @@ This is different from the behaviour in the Client Credentials sub-section menti

## Installation

Node.js version 14 or above is required.
First, ensure that you have the correct Node.js version installed. We recommend managing this with [Node Version Manager (NVM)](https://github.com/nvm-sh/nvm). If you use NVM, switch to the correct version of Node.js with:

```sh
nvm use
```

Otherwise, get the correct version of Node.js from the [`.nvmrc`](./.nvmrc) file.

Then, install the dependencies needed for all packages in the test suite:

```bash
npm install
```

This will install the dependencies needed for all packages in the test suite.

For developers that are customising the installation, for use in e.g. Docker, the directories `./packages/test-interface-criteria` and `./packages/openactive-openid-test-client` are dependencies, and so must be present during `npm install`.
For developers that are customising the installation, for use in e.g. Docker, the directories `./packages/openactive-openid-browser-automation`, `./packages/openactive-openid-client`, `./packages/openactive-openid-test-cli`, `./packages/openactive-openid-test-client` and `./packages/test-interface-criteria` are dependencies, and so must be present during `npm install`.

## Running

Expand Down
12 changes: 6 additions & 6 deletions packages/openactive-broker-microservice/package-lock.json

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

2 changes: 1 addition & 1 deletion packages/openactive-broker-microservice/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"@types/express": "^4.17.9",
"@types/fs-extra": "^9.0.13",
"@types/lodash": "^4.14.175",
"@types/node": "^14.6.0",
"@types/node": "^18.17.1",
"@types/ramda": "0.27.37",
"eslint": "^7.24.0",
"eslint-config-airbnb": "^18.2.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/openactive-integration-tests/package-lock.json

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

Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const config = require('config');
* @returns {Config[TSubConfigPath][TKey]}
*/
function getConfigVarOrThrow(subConfigPath, key) {
// @ts-ignore
// @ts-expect-error TS thinks `key` can be a symbol
const dottedPath = subConfigPath ? `${subConfigPath}.${key}` : `${key}`;
return config.get(dottedPath);
}
Expand All @@ -48,7 +48,7 @@ function getConfigVarOrThrow(subConfigPath, key) {
* @returns {Config[TSubConfigPath][TKey]}
*/
function getConfigVarOrDefault(subConfigPath, key, defaultValue) {
// @ts-ignore
// @ts-expect-error TS thinks `key` can be a symbol
const dottedPath = `${subConfigPath}.${key}`;
if (config.has(dottedPath)) {
return config.get(dottedPath);
Expand Down
14 changes: 0 additions & 14 deletions packages/openactive-openid-browser-automation/.vscode/launch.json

This file was deleted.

9 changes: 8 additions & 1 deletion packages/openactive-openid-browser-automation/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# openactive-openid-browser-automation

This Node.js library provides an OpenID Connect test client. It caches tokens retrieved to allow them to be reused across tests, as well as providing endpoints that exercise a target OpenID Connect Server implementation according to the specific OpenID Connect profile defined within the Open Booking API.
This package forms part of the suite of [OpenID Connect](https://openid.net/developers/how-connect-works/) helper libraries and tools used within the Test Suite. The other packages are:

* [openactive-openid-client](../openactive-openid-client/)
* [openactive-openid-test-cli](../openactive-openid-test-cli/)

OpenID Connect is one of the authentication and authorization strategies facilitated by the Open Booking API (spec: [OpenID Connect Booking Partner Authentication for Multiple Seller Systems](https://openactive.io/open-booking-api/EditorsDraft/#openid-connect-booking-partner-authentication-for-multiple-seller-systems)).

This Node.js library automates the process of going to an authorization page on a booking system's OpenID Provider, filling in login details, navigating through the flow, and capturing screenshots along the way to track and report the process. It is used to exercise the booking system' OpenID Provider implementation according to the [spec](https://openactive.io/open-booking-api/EditorsDraft/#openid-connect-booking-partner-authentication-for-multiple-seller-systems).

## Redirect URI

Expand Down

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

2 changes: 1 addition & 1 deletion packages/openactive-openid-browser-automation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"devDependencies": {
"@types/cookie-session": "^2.0.41",
"@types/express": "^4.17.9",
"@types/node": "^14.6.0",
"@types/node": "^18.17.1",
"@types/puppeteer": "^5.4.0",
"eslint": "^7.13.0",
"eslint-config-airbnb": "^18.2.1",
Expand Down
14 changes: 0 additions & 14 deletions packages/openactive-openid-client/.vscode/launch.json

This file was deleted.

11 changes: 6 additions & 5 deletions packages/openactive-openid-client/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# openactive-openid-client

This Node.js library provides an OpenID Connect test client. It caches tokens retrieved to allow them to be reused across tests, as well as providing endpoints that exercise a target OpenID Connect Server implementation according to the specific OpenID Connect profile defined within the Open Booking API.
This package forms part of the suite of [OpenID Connect](https://openid.net/developers/how-connect-works/) helper libraries and tools used within the Test Suite. The other packages are:

## Command-line usage
The test client can be run stand-alone via a command-line interface, to aid debugging of an OpenID Connect implementation.
* [openactive-openid-browser-automation](../packages/openactive-openid-browser-automation/)
* [openactive-openid-test-cli](../openactive-openid-test-cli/)

1. `npm install`
2. `npm start -- --help`
OpenID Connect is one of the authentication and authorization strategies facilitated by the Open Booking API (spec: [OpenID Connect Booking Partner Authentication for Multiple Seller Systems](https://openactive.io/open-booking-api/EditorsDraft/#openid-connect-booking-partner-authentication-for-multiple-seller-systems)).

This Node.js library provides an OpenID Connect test client. It caches tokens retrieved to allow them to be reused across tests, and can connect to endpoints provided by [openactive-openid-browser-automation](../packages/openactive-openid-browser-automation/) in order to exercise a target booking system's OpenID Provider implementation according to the [spec](https://openactive.io/open-booking-api/EditorsDraft/#openid-connect-booking-partner-authentication-for-multiple-seller-systems).

## Redirect URI

Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion packages/openactive-openid-client/built-types/lib/cli.d.ts

This file was deleted.

8 changes: 4 additions & 4 deletions packages/openactive-openid-client/package-lock.json

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

2 changes: 1 addition & 1 deletion packages/openactive-openid-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"openid-client": "^4.2.1"
},
"devDependencies": {
"@types/node": "^14.6.0",
"@types/node": "^18.17.1",
"eslint": "^7.13.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-plugin-import": "^2.22.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/openactive-openid-test-cli/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceFolder}\\cli.js"
"program": "${workspaceFolder}\\lib\\cli.js"
}
]
}
12 changes: 10 additions & 2 deletions packages/openactive-openid-test-cli/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
# openactive-openid-test-cli

A package that tests `openactive-openid-client` and `openactive-openid-browser-automation` by providing a CLI interface that uses both.
This package forms part of the suite of [OpenID Connect](https://openid.net/developers/how-connect-works/) helper libraries and tools used within the Test Suite. The other packages are:

* [openactive-openid-browser-automation](../packages/openactive-openid-browser-automation/)
* [openactive-openid-client](../openactive-openid-client/)

OpenID Connect is one of the authentication and authorization strategies facilitated by the Open Booking API (spec: [OpenID Connect Booking Partner Authentication for Multiple Seller Systems](https://openactive.io/open-booking-api/EditorsDraft/#openid-connect-booking-partner-authentication-for-multiple-seller-systems)).

This Node.js script connects to an OpenID Provider using [openactive-openid-client](../openactive-openid-client/) and [openactive-openid-test-cli](../openactive-openid-test-cli/) and so tests that the OpenID Provider is correctly configured.

## Command-line usage
The test client can be run stand-alone via a command-line interface, to aid debugging of an OpenID Connect implementation.

The script is run via a command-line interface, to aid debugging of an OpenID Connect implementation.

1. `npm install`
2. `npm start -- --help`
Expand Down
7 changes: 2 additions & 5 deletions packages/openactive-openid-test-cli/lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,29 +84,26 @@ const argv = yargs(process.argv.slice(2))
type: 'string',
alias: 'u',
description: 'Username of the Seller',
default: 'test',
default: 'test1',
},
password: {
type: 'string',
alias: 'p',
description: 'Password of the Seller',
default: 'test',
default: 'test1',
},
usernameFieldSelector: {
type: 'string',
alias: 'l',
description: 'CSS selector for the username field',
default: "[name='username' i]",
},
passwordFieldSelector: {
type: 'string',
alias: 'l',
description: 'CSS selector for the password field',
default: "[name='password' i]",
},
loginPageButtonSelector: {
type: 'string',
alias: 'l',
description: 'CSS selector for the login button',
default: '.btn-primary',
},
Expand Down
12 changes: 6 additions & 6 deletions packages/openactive-openid-test-cli/package-lock.json

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

2 changes: 1 addition & 1 deletion packages/openactive-openid-test-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"devDependencies": {
"@types/express": "^4.17.9",
"@types/node": "^14.6.0",
"@types/node": "^18.17.1",
"@types/yargs": "^15.0.9",
"eslint": "^7.13.0",
"eslint-config-airbnb": "^18.2.1",
Expand Down

0 comments on commit d3c7d5e

Please sign in to comment.