From 29e42dea4bf0d82715076466fd669e21863f8ee5 Mon Sep 17 00:00:00 2001
From: Neha Agarwal <agarneha1331@gmail.com>
Date: Thu, 23 Mar 2023 14:13:43 +0530
Subject: [PATCH 1/3] Made parallel test as default

---
 README.md | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/README.md b/README.md
index 3f5331d..fef1a68 100644
--- a/README.md
+++ b/README.md
@@ -10,8 +10,7 @@
 * Update `*.conf.js` files inside the `src/test/resources/conf/` directory to update desired capabilities.
 
 ## Running your tests
-* To run a single test, run `mvn test -P single`
-* To run parallel tests, run `mvn test -P parallel` 
+* To run tests, run `mvn test -P parallel` 
 * To run local tests, run `mvn test -P local`
 
 

From 74f55f0870724b63868a48444c454ee9861e179c Mon Sep 17 00:00:00 2001
From: Neha Agarwal <agarneha1331@gmail.com>
Date: Fri, 24 Mar 2023 12:36:50 +0530
Subject: [PATCH 2/3] Fix for parallel with local

---
 pom.xml                                               |  6 +++---
 .../com/browserstack/RunWebDriverCucumberTests.java   | 11 ++++++-----
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/pom.xml b/pom.xml
index 8c097af..76fe56d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -94,9 +94,6 @@
     <profiles>
         <profile>
             <id>single</id>
-            <activation>
-                <activeByDefault>true</activeByDefault>
-            </activation>
             <build>
                 <plugins>
                     <plugin>
@@ -122,6 +119,9 @@
         </profile>
         <profile>
             <id>parallel</id>
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
             <build>
                 <plugins>
                     <plugin>
diff --git a/src/test/java/com/browserstack/RunWebDriverCucumberTests.java b/src/test/java/com/browserstack/RunWebDriverCucumberTests.java
index 6224b5b..7ff3935 100644
--- a/src/test/java/com/browserstack/RunWebDriverCucumberTests.java
+++ b/src/test/java/com/browserstack/RunWebDriverCucumberTests.java
@@ -30,7 +30,7 @@
 public class RunWebDriverCucumberTests {
 
     private TestNGCucumberRunner testNGCucumberRunner;
-    private Local local;
+    private static Local local;
     private static final ThreadLocal<ManagedWebDriver> threadLocalWebDriver = new ThreadLocal<>();
 
     @BeforeClass(alwaysRun = true)
@@ -40,6 +40,11 @@ public void setUpClass() {
 
     private synchronized static void setThreadLocalWebDriver(ManagedWebDriver managedWebDriver) {
         threadLocalWebDriver.set(managedWebDriver);
+        if(Utility.isLocal(managedWebDriver) && local==null){
+            local = new Local();
+            Utility.startLocal(local, managedWebDriver);
+        }
+      
     }
 
     public synchronized static ManagedWebDriver getManagedWebDriver() {
@@ -48,10 +53,6 @@ public synchronized static ManagedWebDriver getManagedWebDriver() {
 
     @Test(groups = "cucumber", description = "Runs Cucumber Feature", dataProvider = "scenarios")
     public void feature(PickleWrapper pickleWrapper, FeatureWrapper featureWrapper, ManagedWebDriver managedWebDriver) {
-        if(Utility.isLocal(managedWebDriver) && local==null){
-            local = new Local();
-            Utility.startLocal(local, managedWebDriver);
-        }
         managedWebDriver.setTestName(pickleWrapper.getPickle().getName());
         setThreadLocalWebDriver(managedWebDriver);
         testNGCucumberRunner.runScenario(pickleWrapper.getPickle());

From e12573d400125f38b3249b60eb39f45e88ee267a Mon Sep 17 00:00:00 2001
From: Neha Agarwal <agarneha1331@gmail.com>
Date: Tue, 28 Mar 2023 13:03:51 +0530
Subject: [PATCH 3/3] Update source

---
 src/test/java/com/browserstack/util/Utility.java | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/test/java/com/browserstack/util/Utility.java b/src/test/java/com/browserstack/util/Utility.java
index 5fe2a1f..6ff23d0 100644
--- a/src/test/java/com/browserstack/util/Utility.java
+++ b/src/test/java/com/browserstack/util/Utility.java
@@ -43,6 +43,7 @@ public static JSONObject getCombinedCapability(Map<String, String> envCapabiliti
             bstackOptions = new JSONObject();
         bstackOptions.put("userName", username);
         bstackOptions.put("accessKey", accessKey);
+        bstackOptions.put("source", "cucumber-java:sample-selenium-4:v1.1");
         capabilities.put("bstack:options", bstackOptions);
         return capabilities;
     }
