Skip to content

Commit e021627

Browse files
authored
DTSCCI-3957 - Integrate .env to Load Environment Variables (#6327)
Fix dotenv import issues
1 parent c8b0610 commit e021627

File tree

4 files changed

+33
-48
lines changed

4 files changed

+33
-48
lines changed

codecept.conf.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
require('dotenv').config();
2+
13
const { testFilesHelper } = require('./e2e/plugins/failedAndNotExecutedTestFilesPlugin');
24

35
const functional = process.env.FUNCTIONAL;
@@ -140,3 +142,6 @@ exports.config = {
140142
},
141143
},
142144
};
145+
146+
console.log('SHOW BROWSER WINDOW: ' + process.env.SHOW_BROWSER_WINDOW)
147+
console.log('URL: ' + process.env.URL)

e2e/config.js

Lines changed: 12 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -13,54 +13,18 @@ module.exports = {
1313
url: 'http://localhost:5555'
1414
},
1515
url: {
16-
17-
// for Demo
18-
// manageCase: process.env.URL || 'https://manage-case-int.demo.platform.hmcts.net',
19-
// //manageCase: process.env.URL || 'https://manage-case-wa-int.demo.platform.hmcts.net',
20-
// authProviderApi: process.env.SERVICE_AUTH_PROVIDER_API_BASE_URL || 'http://rpe-service-auth-provider-demo.service.core-compute-demo.internal',
21-
// ccdDataStore: process.env.CCD_DATA_STORE_URL || 'http://ccd-data-store-api-demo.service.core-compute-demo.internal',
22-
// dmStore:process.env.DM_STORE_URL || 'http://dm-store-demo.service.core-compute-demo.internal',
23-
// idamApi: process.env.IDAM_API_URL || 'https://idam-api.demo.platform.hmcts.net',
24-
// idamTestSupportApi: process.env.IDAM_TEST_URL || 'https://idam-testing-support-api.demo.platform.hmcts.net',
25-
// civilService: process.env.CIVIL_SERVICE_URL || 'http://civil-service-demo.service.core-compute-demo.internal',
26-
// waTaskMgmtApi: process.env.WA_TASK_MGMT_URL || 'http://wa-task-management-api-demo.service.core-compute-demo.internal'
27-
28-
// for Preview
29-
// manageCase: 'https://xui-civil-ccd-pr-5627.preview.platform.hmcts.net',
30-
// authProviderApi: 'http://rpe-service-auth-provider-aat.service.core-compute-aat.internal',
31-
// ccdDataStore: 'https://ccd-data-store-api-civil-ccd-pr-5627.preview.platform.hmcts.net',
32-
// dmStore: 'http://dm-store-aat.service.core-compute-aat.internal',
33-
// idamApi: 'https://idam-api.aat.platform.hmcts.net',
34-
// idamTestSupportApi: process.env.IDAM_TEST_URL || 'https://idam-testing-support-api.aat.platform.hmcts.net',
35-
// civilService: 'https://civil-ccd-pr-5627.preview.platform.hmcts.net',
36-
// caseAssignmentService: 'http://manage-case-assignment-civil-ccd-pr-5627.preview.platform.hmcts.net',
37-
// orchestratorService: 'http://civil-orchestrator-service-aat.service.core-compute-aat.internal',
38-
39-
// for AAT
40-
// manageCase: 'https://manage-case.aat.platform.hmcts.net/',
41-
// authProviderApi: 'http://rpe-service-auth-provider-aat.service.core-compute-aat.internal',
42-
// ccdDataStore: 'http://ccd-data-store-api-aat.service.core-compute-aat.internal',
43-
// dmStore:'http://dm-store-aat.service.core-compute-aat.internal',
44-
// idamApi: 'https://idam-api.aat.platform.hmcts.net',
45-
// idamTestSupportApi: process.env.IDAM_TEST_URL || 'https://idam-testing-support-api.aat.platform.hmcts.net',
46-
// civilService: 'http://civil-service-aat.service.core-compute-aat.internal',
47-
// waTaskMgmtApi: 'http://wa-task-management-api-aat.service.core-compute-aat.internal',
48-
// caseAssignmentService: 'http://aac-manage-case-assignment-aat.service.core-compute-aat.internal',
49-
// orchestratorService: 'http://civil-orchestrator-service-aat.service.core-compute-aat.internal',
50-
51-
// Default - leave below uncommented when merging
52-
manageCase: process.env.URL || 'http://localhost:3333',
53-
authProviderApi: process.env.SERVICE_AUTH_PROVIDER_API_BASE_URL || 'http://localhost:4502',
54-
ccdDataStore: process.env.CCD_DATA_STORE_URL || 'http://localhost:4452',
55-
dmStore: process.env.DM_STORE_URL || 'http://dm-store:8080',
56-
idamApi: process.env.IDAM_API_URL || 'http://localhost:5000',
57-
idamTestSupportApi: process.env.IDAM_TEST_URL || 'https://idam-testing-support-api.aat.platform.hmcts.net',
58-
civilService: process.env.CIVIL_SERVICE_URL || 'http://localhost:4000',
59-
caseAssignmentService: process.env.AAC_API_URL || 'http://localhost:4454',
60-
orchestratorService: process.env.CIVIL_ORCHESTRATOR_SERVICE_URL || 'https://localhost:9090',
61-
waTaskMgmtApi: process.env.WA_TASK_MGMT_URL || 'http://wa-task-management-api-aat.service.core-compute-aat.internal',
62-
paymentApi: process.env.PAYMENT_API_URL || 'http://payment-api-aat.service.core-compute-aat.internal',
63-
wiremockService: process.env.WIREMOCK_URL || 'http://localhost:8765'
16+
manageCase: process.env.URL,
17+
authProviderApi: process.env.SERVICE_AUTH_PROVIDER_API_BASE_URL,
18+
ccdDataStore: process.env.CCD_DATA_STORE_URL,
19+
dmStore: process.env.DM_STORE_URL,
20+
idamApi: process.env.IDAM_API_URL,
21+
idamTestSupportApi: process.env.IDAM_TEST_URL,
22+
civilService: process.env.CIVIL_SERVICE_URL,
23+
caseAssignmentService: process.env.AAC_API_URL,
24+
orchestratorService: process.env.CIVIL_ORCHESTRATOR_SERVICE_URL,
25+
waTaskMgmtApi: process.env.WA_TASK_MGMT_URL,
26+
paymentApi: process.env.PAYMENT_API_URL,
27+
wiremockService: process.env.WIREMOCK_URL
6428
},
6529
s2s: {
6630
microservice: 'civil_service',

env.d.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ declare global {
1515
CIVIL_SERVICE_URL: string;
1616
WA_TASK_MGMT_URL: string;
1717
AAC_API_URL: string;
18+
IDAM_TEST_URL: string;
1819
CIVIL_ORCHESTRATOR_SERVICE_URL: string;
1920
PAYMENT_API_URL: string;
21+
WIREMOCK_URL: string;
2022
WIRE_MOCK_SERVICE_URL: string;
2123
DEFAULT_PASSWORD: string;
2224
JUDGE_DEFAULT_PASSWORD: string;
@@ -34,6 +36,19 @@ declare global {
3436
PLAYWRIGHT_RETRIES: string;
3537
PLAYWRIGHT_EXUI_RETRIES: string;
3638
PLAYWRIGHT_DEBUG_CASE_ID: string;
39+
PREV_FAILED_TEST_FILES: string;
40+
PREV_NOT_EXECUTED_TEST_FILES: string;
41+
WA_TESTS: string;
42+
REPORT_DIR: string;
43+
SHOW_BROWSER_WINDOW: string;
44+
REPORT_FILE: string;
45+
MOCHAWESOME_REPORTFILENAME: string;
46+
WAIT_FOR_TIMEOUT_MS: string;
47+
SMART_WAIT: string;
48+
SAUCELABS_BROWSER: string;
49+
SAUCE_USERNAME: string;
50+
SAUCE_ACCESS_KEY: string;
51+
TUNNEL_IDENTIFIER: string;
3752
}
3853
}
3954
}

saucelabs.conf.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22

3+
require('dotenv').config();
34
const supportedBrowsers = require('./e2e/crossbrowser/supportedBrowsers.js');
45
const testConfig = require('./e2e/config');
56

0 commit comments

Comments
 (0)