From 3d8264f0e8dd66f89bbeeaf1477a910b411eb1a6 Mon Sep 17 00:00:00 2001 From: Vijay Venkatesh Date: Fri, 15 Oct 2021 09:44:53 -0600 Subject: [PATCH 1/2] Support for parallel execution --- index.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 003ffea..8884051 100644 --- a/index.js +++ b/index.js @@ -233,7 +233,7 @@ module.exports = (config) => { status: suiteStatus, }).promise; } - await finishLaunch(); + if (!process.env.RP_LAUNCH_ID) await finishLaunch(); }); function startLaunch(suiteTitle) { @@ -244,13 +244,19 @@ module.exports = (config) => { debug: config.debug, }); - return rpClient.startLaunch({ + const options = { name: config.launchName || suiteTitle, description: config.launchDescription, attributes: config.launchAttributes, rerun: config.rerun, rerunOf: config.rerunOf, - }); + } + + if (process.env.RP_LAUNCH_ID) { + options.id = process.env.RP_LAUNCH_ID + } + + return rpClient.startLaunch(options); } async function attachScreenshot() { From aef6f97b28f2134e0e3a033f1be20a7924592985 Mon Sep 17 00:00:00 2001 From: Vijay Venkatesh Date: Fri, 5 Nov 2021 08:55:39 -0600 Subject: [PATCH 2/2] fix issue with test case widgets not working --- index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index 8884051..1a3a356 100644 --- a/index.js +++ b/index.js @@ -102,7 +102,7 @@ module.exports = (config) => { event.dispatcher.on(event.suite.before, (suite) => { recorder.add(async () => { - suiteObj = startTestItem(suite.title, rp_SUITE); + suiteObj = startTestItem(suite.title, rp_TEST); debug(`${suiteObj.tempId}: The suiteId '${suite.title}' is started.`); suite.tempId = suiteObj.tempId; suiteStatus = rp_PASSED; @@ -113,7 +113,7 @@ module.exports = (config) => { recorder.add(async () => { currentMetaSteps = []; stepObj = null; - testObj = startTestItem(test.title, rp_TEST, suiteObj.tempId); + testObj = startTestItem(test.title, rp_STEP, suiteObj.tempId, true); test.tempId = testObj.tempId; failedStep = null; debug(`${testObj.tempId}: The testId '${test.title}' is started.`); @@ -211,9 +211,9 @@ module.exports = (config) => { }); }); - function startTestItem(testTitle, method, parentId = null) { + function startTestItem(testTitle, method, parentId = null, stats = null) { try { - const hasStats = method !== rp_STEP; + const hasStats = stats || (method !== rp_STEP); return rpClient.startTestItem({ name: testTitle, type: method, @@ -322,7 +322,7 @@ module.exports = (config) => { metaStepObj = currentMetaSteps[i-1] || metaStepObj; const isNested = !!metaStepObj.tempId; - metaStepObj = startTestItem(metaStep.toString(), rp_STEP, metaStepObj.tempId || testObj.tempId); + metaStepObj = startTestItem(metaStep.toString(), rp_STEP , metaStepObj.tempId || testObj.tempId, false); metaStep.tempId = metaStepObj.tempId; debug(`${metaStep.tempId}: The stepId '${metaStep.toString()}' is started. Nested: ${isNested}`); }