Skip to content

Commit ecbc2c4

Browse files
agarneha1331francisf
authored andcommitted
Added BStack to files to add to session name
1 parent 663dc08 commit ecbc2c4

File tree

6 files changed

+31
-27
lines changed

6 files changed

+31
-27
lines changed

browserstack.yml

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,26 @@
33
# =============================
44
# Add your BrowserStack userName and accessKey here or set BROWSERSTACK_USERNAME and
55
# BROWSERSTACK_ACCESS_KEY as env variables
6-
userName: BROWSERSTACK_USERNAME
7-
accessKey: BROWSERSTACK_ACCESS_KEY
8-
9-
framework: selenide-testng
6+
userName: YOUR_USERNAME
7+
accessKey: YOUR_ACCESS_KEY
108

119
# ======================
12-
# Organizing your tests
10+
# BrowserStack Reporting
1311
# ======================
14-
# Use `projectName`, `buildName`, `name` capabilities to organise your tests
15-
# `name` is the name of your test sessions and is automatically picked from your
16-
# test name and doesn't need to be set manually when using BrowserStack SDK
17-
# `buildName` is used to name your CI/CD job or the execution of your test suite.
18-
# Ensure you add a dynamic identifier, like an incremental build number from your
19-
# CI/CD or timestamp at the end of every build; otherwise tests from different
20-
# executions will be grouped together on BrowserStack
21-
buildName: browserstack-build-1
22-
# Use `projectName` to set the name of your project. Example, Marketing Website
23-
projectName: BrowserStack Samples
12+
# The following capabilities are used to set up reporting on BrowserStack:
13+
# Set 'projectName' to the name of your project. Example, Marketing Website
14+
projectName: BrowserStack Samples
15+
# Set `buildName` as the name of the job / testsuite being run
16+
buildName: browserstack build
17+
# `buildIdentifier` is a unique id to differentiate every execution that gets appended to
18+
# buildName. Choose your buildIdentifier format from the available expressions:
19+
# ${BUILD_NUMBER} (Default): Generates an incremental counter with every execution
20+
# ${DATE_TIME}: Generates a Timestamp with every execution. Eg. 05-Nov-19:30
21+
# Read more about buildIdentifiers here -> https://www.browserstack.com/docs/automate/selenium/organize-tests
22+
buildIdentifier: '#${BUILD_NUMBER}' # Supports strings along with either/both ${expression}
23+
# Set `framework` of your test suite. Example, `testng`, `cucumber`, `cucumber-testng`
24+
# This property is needed to send test context to BrowserStack (test name, status)
25+
framework: selenide-testng
2426

2527
# =======================================
2628
# Platforms (Browsers / Devices to test)
@@ -36,10 +38,10 @@ platforms:
3638
osVersion: 10
3739
browserName: Edge
3840
browserVersion: latest
39-
- device: Samsung Galaxy S22 Ultra
41+
- deviceName: Samsung Galaxy S22 Ultra
4042
browserName: chrome # Try 'samsung' for Samsung browser
4143
osVersion: 12.0
42-
44+
4345
# =======================
4446
# Parallels per Platform
4547
# =======================
@@ -51,19 +53,22 @@ platforms:
5153
# Example 2 - If you have configured 1 platform and set `parallelsPerPlatform` as 5, a total of 5 (1 * 5) parallel threads will be used on BrowserStack
5254
parallelsPerPlatform: 1
5355

56+
source: selenide:sample-master:v1.3
57+
5458
# ==========================================
5559
# BrowserStack Local
5660
# (For localhost, staging/private websites)
5761
# ==========================================
5862
# Set browserStackLocal to true if your website under test is not accessible publicly over the internet
5963
# Learn more about how BrowserStack Local works here -> https://www.browserstack.com/docs/automate/selenium/local-testing-introduction
6064
browserstackLocal: true # <boolean> (Default false)
61-
# browserStackLocalOptions:
62-
# Options to be passed to BrowserStack local in-case of advanced configurations
63-
# localIdentifier: # <string> (Default: null) Needed if you need to run multiple instances of local.
64-
# forceLocal: true # <boolean> (Default: false) Set to true if you need to resolve all your traffic via BrowserStack Local tunnel.
65-
# Entire list of arguments available here -> https://www.browserstack.com/docs/automate/selenium/manage-incoming-connections
6665

66+
# Options to be passed to BrowserStack local in-case of advanced configurations
67+
# browserStackLocalOptions:
68+
# localIdentifier: # <string> (Default: null) Needed if you need to run multiple instances of local.
69+
# forceLocal: true # <boolean> (Default: false) Set to true if you need to resolve all your traffic via BrowserStack Local tunnel.
70+
# Entire list of arguments available here -> https://www.browserstack.com/docs/automate/selenium/manage-incoming-connections
71+
6772
# ===================
6873
# Debugging features
6974
# ===================

config/local.testng.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<suite name="Local">
44
<test name="LocalTest">
55
<classes>
6-
<class name="com.browserstack.LocalTest"/>
6+
<class name="com.browserstack.BStackLocalTest"/>
77
</classes>
88
</test>
99
</suite>

config/sample.testng.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<suite name="Sample">
44
<test name="SampleTest">
55
<classes>
6-
<class name="com.browserstack.SampleTest"/>
6+
<class name="com.browserstack.BStackSampleTest"/>
77
</classes>
88
</test>
99
</suite>

src/test/java/com/browserstack/LocalTest.java renamed to src/test/java/com/browserstack/BStackLocalTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import static com.codeborne.selenide.Selenide.open;
66
import org.testng.Assert;
77

8-
public class LocalTest extends BrowserStackTest {
8+
public class BStackLocalTest extends BrowserStackTest {
99

1010
@Test
1111
public void test() throws Exception {

src/test/java/com/browserstack/SampleTest.java renamed to src/test/java/com/browserstack/BStackSampleTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import static com.codeborne.selenide.Selenide.*;
99

10-
public class SampleTest extends BrowserStackTest {
10+
public class BStackSampleTest extends BrowserStackTest {
1111

1212
@Test
1313
public void test() throws Exception {

src/test/java/com/browserstack/BrowserStackTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ public BrowserStackTest() {
3535
public void setUp() throws Exception {
3636
MutableCapabilities capabilities = new MutableCapabilities();
3737
HashMap<String, String> bstackOptions = new HashMap<>();
38-
bstackOptions.put("source", "selenide:sample-master:v1.2");
3938
capabilities.setCapability("bstack:options", bstackOptions);
4039
driver = new RemoteWebDriver(new URL(String.format("https://%s:%[email protected]/wd/hub", userName, accessKey)), capabilities);
4140
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10));

0 commit comments

Comments
 (0)