froth-webdriverio-framework 7.0.99 → 7.0.100
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.
- package/froth_configs/commonhook.js +2 -17
- package/package.json +1 -1
|
@@ -10,7 +10,6 @@ const fs = require('fs');
|
|
|
10
10
|
const path = require('path');
|
|
11
11
|
const vm = require('vm');
|
|
12
12
|
|
|
13
|
-
let suiteDetails;
|
|
14
13
|
let executionUpdated = false;
|
|
15
14
|
const resultdetails = {
|
|
16
15
|
comments: [],
|
|
@@ -139,7 +138,6 @@ const commonHooks = {
|
|
|
139
138
|
|
|
140
139
|
beforeSession: async function (config, capabilities, specs) {
|
|
141
140
|
console.log('==== BEFORE SESSION ====');
|
|
142
|
-
suiteDetails = JSON.parse(BUFFER.getItem('FROTHE_SUITE_DETAILS'));
|
|
143
141
|
try {
|
|
144
142
|
/** 1️⃣ Validate test syntax */
|
|
145
143
|
// let syntaxFailed = false;
|
|
@@ -163,17 +161,13 @@ const commonHooks = {
|
|
|
163
161
|
|
|
164
162
|
/** 1️⃣ Validate test syntax */
|
|
165
163
|
let syntaxFailed = false;
|
|
166
|
-
|
|
164
|
+
|
|
167
165
|
for (const fileUrl of specs) {
|
|
168
166
|
const filePath = url.fileURLToPath(fileUrl);
|
|
169
167
|
const code = fs.readFileSync(filePath, 'utf8');
|
|
170
168
|
|
|
171
169
|
try {
|
|
172
170
|
new vm.Script(code, { filename: filePath });
|
|
173
|
-
script = suiteDetails.find(s => s.scriptName === filePath.replace('.js', ''));
|
|
174
|
-
console.log("Script Details:", script);
|
|
175
|
-
|
|
176
|
-
|
|
177
171
|
} catch (err) {
|
|
178
172
|
const { line, column } = await extractLineColumn(err);
|
|
179
173
|
|
|
@@ -186,17 +180,8 @@ const commonHooks = {
|
|
|
186
180
|
}
|
|
187
181
|
|
|
188
182
|
if (syntaxFailed) {
|
|
189
|
-
|
|
190
|
-
await exeDetails.updateScriptExecutionStatus(
|
|
191
|
-
BUFFER.getItem('ORGANISATION_DOMAIN_URL'),
|
|
192
|
-
BUFFER.getItem('FROTH_LOGIN_TOKEN'),
|
|
193
|
-
script.scriptId,
|
|
194
|
-
script.platform.toLowerCase(),
|
|
195
|
-
"FAILED"
|
|
196
|
-
);
|
|
197
183
|
await failExecution('Syntax validation failed');
|
|
198
184
|
}
|
|
199
|
-
|
|
200
185
|
/** 2️⃣ BrowserStack capability normalization */
|
|
201
186
|
|
|
202
187
|
if (process.env.PLATFORM === 'browserstack' || process.env.PLATFORM === 'browserstacklocal') {
|
|
@@ -300,7 +285,7 @@ const commonHooks = {
|
|
|
300
285
|
|
|
301
286
|
}
|
|
302
287
|
|
|
303
|
-
|
|
288
|
+
const suiteDetails = JSON.parse(BUFFER.getItem('FROTHE_SUITE_DETAILS'));
|
|
304
289
|
const script = suiteDetails.find(s => s.scriptName === fileName.replace('.js', ''));
|
|
305
290
|
console.log("Script Details:", script);
|
|
306
291
|
|