From 1d1937a93e5f5d625757cbddaeca6b4599e5bd22 Mon Sep 17 00:00:00 2001 From: Nick Evans <2616208+nickevansuk@users.noreply.github.com> Date: Wed, 2 Aug 2023 08:55:34 +0100 Subject: [PATCH 1/6] fix: Certificate generation for custom built system (#549) --- .../test/certification/certification-writer.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/openactive-integration-tests/test/certification/certification-writer.js b/packages/openactive-integration-tests/test/certification/certification-writer.js index 9c7a0653c7..c3fb642ee3 100644 --- a/packages/openactive-integration-tests/test/certification/certification-writer.js +++ b/packages/openactive-integration-tests/test/certification/certification-writer.js @@ -61,11 +61,16 @@ class CertificationWriter { get awardedTo() { if (this.datasetJson) { - return this.datasetJson.bookingService || this.datasetJson.publisher && { + return this.datasetJson.bookingService?.name ? { + '@type': 'Organization', + name: this.datasetJson.bookingService.name, + url: this.datasetJson.bookingService.url, + softwareVersion: this.datasetJson.bookingService.softwareVersion, + } : (this.datasetJson.publisher && { '@type': 'Organization', name: this.datasetJson.publisher.name, url: this.datasetJson.publisher.url, - }; + }); } return {}; } From 5fbbf22e98b12d9ea6f7b0e97af12d8607a33402 Mon Sep 17 00:00:00 2001 From: nickevansuk <2616208+nickevansuk@users.noreply.github.com> Date: Wed, 2 Aug 2023 12:31:45 +0100 Subject: [PATCH 2/6] fix: Clarify error message for cert generation --- packages/openactive-integration-tests/test/reporter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/openactive-integration-tests/test/reporter.js b/packages/openactive-integration-tests/test/reporter.js index c6f07a9fd3..7c684d0eac 100644 --- a/packages/openactive-integration-tests/test/reporter.js +++ b/packages/openactive-integration-tests/test/reporter.js @@ -202,7 +202,7 @@ class Reporter { } if (!validationResult?.valid) { console.error(`\n${chalk.red( - 'A valid conformance certificate could not be generated.\n\nIf you have not already done so, try simply running `npm start`, without specifying a specific test subset, to ensure that all tests are run for this feature configuration.', + 'A valid conformance certificate could not be generated.\n\nIf you have not already done so, try simply running `npm start` without any parameters, to ensure that all tests are run for this feature configuration.', )}`); // Ensure that CI fails on validation error, without a stack trace process.exitCode = 1; From e95024d48bee804bfbaaaa7ae85236aefc6e5a83 Mon Sep 17 00:00:00 2001 From: Nick Evans <2616208+nickevansuk@users.noreply.github.com> Date: Wed, 2 Aug 2023 16:25:39 +0100 Subject: [PATCH 3/6] feat: Add IFU support for CI (#550) --- .github/workflows/reference-implementation.yml | 2 +- config/.example.facilityuse-has-slots.json | 8 ++++++++ config/default.json | 4 ++-- 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 config/.example.facilityuse-has-slots.json diff --git a/.github/workflows/reference-implementation.yml b/.github/workflows/reference-implementation.yml index 909fbb7e6f..5d8f1c3cbb 100644 --- a/.github/workflows/reference-implementation.yml +++ b/.github/workflows/reference-implementation.yml @@ -13,7 +13,7 @@ jobs: fail-fast: false matrix: mode: ['random', 'controlled'] - profile: ['all-features', 'single-seller', 'no-payment-reconciliation', 'no-auth', 'no-tax-calculation', 'prepayment-always-required'] + profile: ['all-features', 'single-seller', 'no-payment-reconciliation', 'no-auth', 'no-tax-calculation', 'prepayment-always-required', 'facilityuse-has-slots'] flow: ['simple', 'approval'] include: - mode: 'random' diff --git a/config/.example.facilityuse-has-slots.json b/config/.example.facilityuse-has-slots.json new file mode 100644 index 0000000000..88d0ebf1c3 --- /dev/null +++ b/config/.example.facilityuse-has-slots.json @@ -0,0 +1,8 @@ +{ + "integrationTests": { + "bookableOpportunityTypesInScope": { + "IndividualFacilityUseSlot": false, + "FacilityUseSlot": true + } + } +} \ No newline at end of file diff --git a/config/default.json b/config/default.json index 09ac91b2b2..cc95122c27 100644 --- a/config/default.json +++ b/config/default.json @@ -42,8 +42,8 @@ "additionalReporters": [], "bookableOpportunityTypesInScope": { "ScheduledSession": true, - "FacilityUseSlot": true, - "IndividualFacilityUseSlot": false, + "IndividualFacilityUseSlot": true, + "FacilityUseSlot": false, "CourseInstance": false, "CourseInstanceSubEvent": false, "HeadlineEvent": false, From c79f8b2e7856cf1e70c4cc87e9d8f3ebaf615114 Mon Sep 17 00:00:00 2001 From: nickevansuk <2616208+nickevansuk@users.noreply.github.com> Date: Fri, 11 Aug 2023 10:19:26 +0100 Subject: [PATCH 4/6] fix: Screenshots for auth --- .../lib/browser-automation-for-auth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/openactive-openid-test-client/lib/browser-automation-for-auth.js b/packages/openactive-openid-test-client/lib/browser-automation-for-auth.js index b329828e68..70487db0f8 100644 --- a/packages/openactive-openid-test-client/lib/browser-automation-for-auth.js +++ b/packages/openactive-openid-test-client/lib/browser-automation-for-auth.js @@ -32,7 +32,7 @@ const AUTHORIZE_SUCCESS_CLASS = 'openactive-test-callback-success'; async function addScreenshot(page, title, context) { const image = await page.screenshot({ encoding: 'base64', - }).toString(); + }); const url = page.url(); context.screenshots.push({ title, From 9f81592075a308cb01b316aa5b87fa1d23c45cbb Mon Sep 17 00:00:00 2001 From: nickevansuk <2616208+nickevansuk@users.noreply.github.com> Date: Fri, 11 Aug 2023 10:22:54 +0100 Subject: [PATCH 5/6] fix: Screenshots for auth --- .../lib/browser-automation-for-auth.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/openactive-openid-test-client/lib/browser-automation-for-auth.js b/packages/openactive-openid-test-client/lib/browser-automation-for-auth.js index 70487db0f8..fbf4162958 100644 --- a/packages/openactive-openid-test-client/lib/browser-automation-for-auth.js +++ b/packages/openactive-openid-test-client/lib/browser-automation-for-auth.js @@ -30,9 +30,10 @@ const AUTHORIZE_SUCCESS_CLASS = 'openactive-test-callback-success'; * @param {Context} context */ async function addScreenshot(page, title, context) { - const image = await page.screenshot({ + const imageBuffer = await page.screenshot({ encoding: 'base64', }); + const image = imageBuffer.toString(); const url = page.url(); context.screenshots.push({ title, From 0df6e81b17e09032e7f5ff9dfec07379c68e8fcf Mon Sep 17 00:00:00 2001 From: nickevansuk <2616208+nickevansuk@users.noreply.github.com> Date: Fri, 11 Aug 2023 10:40:34 +0100 Subject: [PATCH 6/6] fix: Allow headless auth via config --- packages/openactive-broker-microservice/src/broker-config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/openactive-broker-microservice/src/broker-config.js b/packages/openactive-broker-microservice/src/broker-config.js index 9ae3234f4e..dc286266af 100644 --- a/packages/openactive-broker-microservice/src/broker-config.js +++ b/packages/openactive-broker-microservice/src/broker-config.js @@ -45,7 +45,7 @@ const BUTTON_SELECTORS = config.has('broker.loginPagesSelectors') ? config.get(' }; const CONSOLE_OUTPUT_LEVEL = config.has('consoleOutputLevel') ? config.get('consoleOutputLevel') : 'detailed'; -const HEADLESS_AUTH = true; +const HEADLESS_AUTH = config.has('broker.headlessAuth') ? config.get('broker.headlessAuth') : true; /** Directory for Validator remote JSON cache (https://github.com/openactive/data-model-validator#remotejsoncachepath) */ const VALIDATOR_TMP_DIR = './tmp';