Make it easier to override default test UUIDS in cypress.json

This commit is contained in:
Tim Donohue
2021-12-17 14:04:11 -06:00
parent 0b543ac4de
commit 34c33d7cf9
2 changed files with 13 additions and 4 deletions

View File

@@ -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"
}
}

View File

@@ -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';