froth-webdriverio-framework 7.0.43 → 7.0.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,138 +0,0 @@
1
- const deepmerge = require('deepmerge')
2
- const fs = require('fs');
3
- const yaml = require('js-yaml');
4
- const path = require('path');
5
- const commonconfig = require('./commonconfig');
6
- console.log('=====wdios common config===== ');
7
-
8
- // Select platform at runtime
9
- const PLATFORM = process.env.PLATFORM || 'browserstack';
10
- console.log('====>PLATFORM:', PLATFORM);
11
-
12
- const configFile = process.env.YML_NAME;
13
-
14
- const resultdetails = {
15
- comments: [],
16
- excution_status: null, // Pass/Fail
17
- excution_time: null, // Execution time in milliseconds
18
- };
19
-
20
- // Load YAML file
21
- //const capabilities = yaml.load(fs.readFileSync(path.join(path.resolve(process.cwd(), configFile)), 'utf8'));
22
-
23
- let capabilities;
24
-
25
- try {
26
- capabilities = yaml.load(fs.readFileSync(path.join(path.resolve(process.cwd(), configFile)), 'utf8'));
27
- // Merge chrome-specific options if applicable
28
-
29
- } catch (e) {
30
- const errorMsg = `The capability file does not exist in the currently configured repository at path: ${path.resolve(process.cwd(), configFile)}: ${e.message},Please update the Capability by editing the file`;
31
- console.error(errorMsg);
32
- resultdetails.comments.push(errorMsg);
33
- resultdetails.excution_status = 'FAIL';
34
-
35
- try {
36
- exeDetails.updateExecuitonDetails(
37
- process.env.ORGANISATION_DOMAIN_URL,
38
- process.env.API_TOKEN,
39
- process.env.EXECUTION_ID,
40
- resultdetails
41
- );
42
- setTimeout(() => {
43
- console.log("30 seconds passed.");
44
- // You can call your API or exit the process here
45
- }, 30000);
46
- console.log('Execution details updated successfully.');
47
- } catch (err) {
48
- console.error('Failed to update execution details:', err.message);
49
- }
50
- process.exit(1);
51
- }
52
- console.log('====>capabilities:', capabilities);
53
-
54
- const SUITE_FILE = path.resolve(process.cwd(), process.env.SUITE);
55
- console.log('====>SUITE_FILE:', SUITE_FILE);
56
-
57
- if (!SUITE_FILE || !fs.existsSync(SUITE_FILE)) {
58
- let errorMsg = `The suite file does not exist in the currently configured repository at path: ${SUITE_FILE}. Please update the SUITE by editing the file`;
59
-
60
- console.error(errorMsg);
61
- resultdetails.comments.push(errorMsg);
62
- resultdetails.excution_status = 'FAIL';
63
-
64
- // Fire API call in background (non-blocking)
65
-
66
- try {
67
- exeDetails.updateExecuitonDetails(
68
- process.env.ORGANISATION_DOMAIN_URL,
69
- process.env.API_TOKEN,
70
- process.env.EXECUTION_ID,
71
- resultdetails
72
- );
73
- setTimeout(() => {
74
- console.log("30 seconds passed.");
75
- // You can call your API or exit the process here
76
- }, 30000);
77
- console.log('Execution details updated successfully.');
78
- } catch (err) {
79
- console.error('Failed to update execution details:', err.message);
80
- }
81
- process.exit(1);
82
- }
83
-
84
- function setupPrerequisites() {
85
- console.log("inside this fuction first ");
86
- if (PLATFORM === 'browserstack') {
87
- process.env.BROWSERSTACK_USERNAME = capabilities.userName;
88
- capabilities.accessKey = Buffer.from(capabilities.accessKey, 'base64').toString('utf-8');
89
- process.env.BROWSERSTACK_ACCESS_KEY = capabilities.accessKey
90
-
91
- console.log('capabilities.platformName:', capabilities.platformName ?? 'web');
92
- process.env.BS_SESSION_TYPE = capabilities.platformName === 'android' || capabilities.platformName === 'ios' ? 'app-automate' : 'automate';
93
- capabilities.buildName = process.env.FROTH_TESTOPS_BUILD_NAME;
94
-
95
- }
96
-
97
- }
98
-
99
- const specificConfig = setupPrerequisites();
100
-
101
-
102
- exports.config = deepmerge(commonconfig,
103
-
104
- {
105
- user: process.env.BROWSERSTACK_USERNAME,
106
- key: process.env.BROWSERSTACK_ACCESS_KEY,
107
- // debug: true,
108
- // execArgv: ['--inspect-brk'],
109
- services: PLATFORM === 'browserstack'
110
- ? ['browserstack']
111
- : PLATFORM === 'saucelabs'
112
- ? ['sauce']
113
- : [],
114
-
115
- //runner: 'local',
116
- specs: require(SUITE_FILE).tests,
117
-
118
- maxInstances: 1,
119
- capabilities: [capabilities],
120
-
121
- logLevel: 'info',
122
- coloredLogs: true,
123
- screenshotPath: './errorShots/',
124
- bail: 0,
125
- //baseUrl: 'https://example.com',
126
- waitforTimeout: 90000,
127
- connectionRetryTimeout: 90000,
128
- connectionRetryCount: 3,
129
-
130
- framework: 'mocha',
131
- reporters: ['spec'],
132
- maxInstances: 10,
133
- updateJob: false,
134
- mochaOpts: {
135
- ui: 'bdd',
136
- timeout: 300000
137
- }
138
- });