From 34c33d7cf9f44950b0fb93da1a31191c1b5d89b8 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Fri, 17 Dec 2021 14:04:11 -0600 Subject: [PATCH] Make it easier to override default test UUIDS in cypress.json --- cypress.json | 7 ++++++- cypress/support/index.ts | 10 +++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/cypress.json b/cypress.json index e06de8e4c5..dfa75fdc57 100644 --- a/cypress.json +++ b/cypress.json @@ -6,5 +6,10 @@ "pluginsFile": "cypress/plugins/index.ts", "fixturesFolder": "cypress/fixtures", "baseUrl": "http://localhost:4000", - "retries": 2 + "retries": 2, + "env": { + "DSPACE_TEST_COMMUNITY": "0958c910-2037-42a9-81c7-dca80e3892b4", + "DSPACE_TEST_COLLECTION": "282164f5-d325-4740-8dd1-fa4d6d3e7200", + "DSPACE_TEST_ENTITY_PUBLICATION": "e98b0f27-5c19-49a0-960d-eb6ad5287067" + } } \ No newline at end of file diff --git a/cypress/support/index.ts b/cypress/support/index.ts index e8b10b9cfb..5a30a5e002 100644 --- a/cypress/support/index.ts +++ b/cypress/support/index.ts @@ -21,6 +21,10 @@ import 'cypress-axe'; // Global constants used in tests -export const TEST_COLLECTION = '282164f5-d325-4740-8dd1-fa4d6d3e7200'; -export const TEST_COMMUNITY = '0958c910-2037-42a9-81c7-dca80e3892b4'; -export const TEST_ENTITY_PUBLICATION = 'e98b0f27-5c19-49a0-960d-eb6ad5287067'; +// May be overridden in our cypress.json config file using specified environment variables. +// Default UUIDs listed here are all in the Demo Entities Data set available at +// https://github.com/DSpace-Labs/AIP-Files/releases/tag/demo-entities-data +// (This is the data set used in our CI environment) +export const TEST_COLLECTION = Cypress.env("DSPACE_TEST_COLLECTION") || '282164f5-d325-4740-8dd1-fa4d6d3e7200'; +export const TEST_COMMUNITY = Cypress.env("DSPACE_TEST_COMMUNITY") || '0958c910-2037-42a9-81c7-dca80e3892b4'; +export const TEST_ENTITY_PUBLICATION = Cypress.env("DSPACE_TEST_ENTITY_PUBLICATION") || 'e98b0f27-5c19-49a0-960d-eb6ad5287067';