Skip to content

Commit

Permalink
Junit5 parallel execution (#2707)
Browse files Browse the repository at this point in the history
* PageElements can now be used in Action Classes

* PageElements can now be used in Action Classes

* Removed old datatable files to fix #2667.

* Improved support for aria-labels in the PageElement components.

* Fixed a broken unit test.

* Minor refactoring.

* Minor test refactoring

* Unit test fixes

* Added better reporing on the number of test cases vs the number of scenarios

* Fixed #2660

* Minor refactoring

* Updated to appium 8.0.0-beta2

* fixed syntax error in pom file

* minor refactoring

* [ci skip] prepare release 3.1.16

* [ci skip] prepare for next development iteration

* [maven-release-plugin] rollback the release of 3.1.16

* [ci skip] prepare release 3.1.16

* [maven-release-plugin] rollback the release of 3.1.16

* [ci skip] prepare release 3.1.16

* [ci skip] prepare for next development iteration

* Added possessive pronouns to Screenplay defaults

* Fixed an error in reporting test duration statistics with data-driven tests

* Minor refactoring

* Minor performance improvements

* Extend Playwright integration (#2681)

* Refactor Playwright screenshot.

* Implement screenshots for SERENITY_TAKE_SCREENSHOTS: FOR_FAILURES and FOR_EACH_ACTION.

* Update return classes for Open action.

* Add Playwright actions to open page from class.
Divide Playwright questions and add methods to get text of multiple matching elements.

* Use LOGGER.debug instead of System.out.println and fix NPE in BrowseTheWebWithPlaywright.

* Use ScreenshotPermission instead of hardcoded screenshot levels for Playwright.

* Upgrade Playwright.
Implement SelectFromOptions interaction.

* Implement Select interactions by index and visible text for Playwright.

* Implement Ensure.currentValue to check current vales of input, textarea and select.

* Update Javadoc

* Implement Attribute question.

* Implement SelectOptions and Visibility questions.

Co-authored-by: Serghei Pogodin <serghei.pogodin@rabobank.nl>

* Fixed a bug where requirements where not reported when defined in WebTestScenario tests

* Removed an unnecessary test

* [ci skip] prepare release 3.1.17

* [ci skip] prepare for next development iteration

* [ci skip] prepare release 3.1.18

* [ci skip] prepare for next development iteration

* Updated to Selenium 4.1.2

* [ci skip] prepare release 3.1.20

* [ci skip] prepare for next development iteration

* Removed the @deprecated annotation from some of the WebElementFacade methods.

* Updated the Page Elements classes

* Fixed library security issues due to colors.js and xstream 1.4.18

* Bump xstream from 1.4.18 to 1.4.19 (#2683)

Bumps [xstream](https://github.com/x-stream/xstream) from 1.4.18 to 1.4.19.
- [Release notes](https://github.com/x-stream/xstream/releases)
- [Commits](https://github.com/x-stream/xstream/commits)

---
updated-dependencies:
- dependency-name: com.thoughtworks.xstream:xstream
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Create SECURITY.md

* 🚑 FIX an error when executing actions on After methods (#2693)

* serenity-junit5: replace org.junit.AssumptionViolatedException with org.opentest4j.TestAbortedException (#2687)

* Update README.md

* Fixed #2695

* Minor refactoring.

* Fixed an issue with capitalisation of test titles containing apostrophes.

* Refactoring.

* Performance enhancements

* Updated some javadocs regarding proxy settings

* Updated proxy documentation in Javadoc

* Refactored to make unit tests less OS-specific

* Refactored to make unit tests less OS-specific

* Switch some tests to Firefox for variety

* Use a standardised path for requirements to make the tests less OS-dependent

* Fixed a potential Windows-specific issue when reading requirements

* fix: BrowserStack session properties not parsed correctly if null (#2701)

Co-authored-by: Keith <xxthePantzxx@gmail.com>

* Fixed Windows-specific issue related to analysing requirements

* Fixed OS-specific unit tests

* Requirements display the parent requirement if duplicate requirement names are present

* Improvements in the requirements reporting

* Fixed #2688

* [ci skip] prepare release 3.2.0

* [ci skip] prepare for next development iteration

* Updated javadocs

* Added release notes for version 3.2.0

* Update README.md

* Updated release notes

* Added Javadoc for shadow dom locators

* Update README.md

* Create codeql-analysis.yml

* Delete codeql-analysis.yml

* improve parallel support for JUnit5 tests

* fix Junit Test

Co-authored-by: John Ferguson Smart <john.smart@wakaleo.com>
Co-authored-by: Serghei Pogodin <pogodin.serg@gmail.com>
Co-authored-by: Serghei Pogodin <serghei.pogodin@rabobank.nl>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: ricardo larrahondo <ricardolarrahondo2@hotmail.com>
Co-authored-by: zeners <zener@sbg.at>
Co-authored-by: Keith Tremorin <thePantz@users.noreply.github.com>
Co-authored-by: Keith <xxthePantzxx@gmail.com>
  • Loading branch information
9 people authored Feb 14, 2022
1 parent 376f07a commit 0e05112
Show file tree
Hide file tree
Showing 754 changed files with 4,763 additions and 99,043 deletions.
67 changes: 38 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

[![Gitter](https://badges.gitter.im/serenity-bdd/serenity-core.svg)](https://gitter.im/serenity-bdd/serenity-core?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
![Continuous Integration](https://github.com/serenity-bdd/serenity-core/workflows/Continuous%20Integration/badge.svg)
[![javadoc](https://javadoc.io/badge2/net.serenity-bdd/serenity-core/javadoc.svg)](https://javadoc.io/doc/net.serenity-bdd/serenity-core)


### That feeling you get when you know you can trust your tests

Expand Down Expand Up @@ -74,6 +76,7 @@ Check out Serenity BDD in more detail here:
## Release Notes
Release notes are available for major releases:
* [2.3.2](docs/release-notes/2.3.2.md)
* [3.2.0](docs/release-notes/3.2.0.md)
* [2.2.0](docs/release-notes/2.2.0.md)
* [2.1.5](docs/release-notes/2.1.5.md)
* [2.1.4](docs/release-notes/2.1.4.md)
Expand All @@ -85,39 +88,42 @@ The tables below list the latest stable and tested versions of Serenity BDD and

### Serenity with JUnit

| serenity-core | serenity-maven-plugin | Selenium version | RestAssured version | Appium client version |
|---------------|-----------------------|-------------------|----------------------|-----------------------|
| 3.1.15 | 3.1.15 | 4.1.1 | 4.4.0 | 8.0.0-BETA |
| 3.1.1 | 3.1.1 | 4.0.0 | 4.3.3 | 8.0.0-BETA |
| 3.0.5 | 3.0.5 | 3.141.59 | 4.3.3 | 7.5.1 |
| 2.5.8 | 2.5.8 | 3.141.59 | 4.3.3 | 7.5.1 |
| 2.5.7 | 2.5.7 | 3.141.59 | 4.3.3 | 7.5.1 |
| 2.4.51 | 2.4.51 | 3.141.59 | 4.3.3 | 7.5.1 |
| 2.4.34 | 2.4.34 | 3.141.59 | 4.3.3 | 7.5.1 |
| 2.4.24 | 2.4.24 | 3.141.59 | 4.3.3 | 7.5.1 |
| 2.3.12 | 2.3.12 | 3.141.59 | 4.3.2 | 7.3.0 |
| 2.3.5 | 2.3.5 | 3.141.59 | 4.3.1 | 7.3.0 |
| 2.3.4 | 2.3.4 | 3.141.59 | 3.3.0 | 7.2.0 |
| 2.2.12 | 2.2.12 | 3.141.59 | 3.3.0 | 7.2.0 |
| 2.2.5 | 2.2.5 | 3.141.59 | 3.3.0 | 7.2.0 |
| 2.2.2 | 2.2.2 | 3.141.59 | 3.3.0 | 7.2.0 |
| 2.2.0 | 2.2.0 | 3.141.59 | 3.3.0 | 7.2.0 |
| 2.1.5 | 2.1.5 | 3.141.59 | 3.3.0 | 7.2.0 |
| 2.1.0 | 2.1.0 | 3.141.59 | 3.3.0 | 7.2.0 |
| 2.0.90 | 2.0.90 | 3.141.59 | 3.3.0 | 7.2.0 |
| 2.0.84 | 2.0.84 | 3.141.59 | 3.3.0 | 7.2.0 |
| 2.0.71 | 2.0.71 | 3.141.59 | 3.3.0 | 7.2.0 |
| 2.0.69 | 2.0.69 | 3.141.59 | 3.3.0 | 7.0.0 |
| 2.0.56 | 2.0.56 | 3.141.59 | 3.3.0 | 7.0.0 |
| 2.0.52 | 2.0.52 | 3.141.59 | 3.3.0 | 7.0.0 |
| 2.0.48 | 2.0.48 | 3.141.59 | 3.3.0 | 7.0.0 |
| serenity-core | serenity-maven-plugin | Selenium version | RestAssured version | Appium client version |
|---------------|-----------------------|------------------|----------------------|-----------------------|
| 3.2.0 | 3.2.0 | 4.1.2 | 4.4.0 | 8.0.0-beta2 |
| 3.1.15 | 3.1.15 | 4.1.1 | 4.4.0 | 8.0.0-BETA |
| 3.1.1 | 3.1.1 | 4.0.0 | 4.3.3 | 8.0.0-BETA |
| 3.0.5 | 3.0.5 | 3.141.59 | 4.3.3 | 7.5.1 |
| 2.5.8 | 2.5.8 | 3.141.59 | 4.3.3 | 7.5.1 |
| 2.5.7 | 2.5.7 | 3.141.59 | 4.3.3 | 7.5.1 |
| 2.4.51 | 2.4.51 | 3.141.59 | 4.3.3 | 7.5.1 |
| 2.4.34 | 2.4.34 | 3.141.59 | 4.3.3 | 7.5.1 |
| 2.4.24 | 2.4.24 | 3.141.59 | 4.3.3 | 7.5.1 |
| 2.3.12 | 2.3.12 | 3.141.59 | 4.3.2 | 7.3.0 |
| 2.3.5 | 2.3.5 | 3.141.59 | 4.3.1 | 7.3.0 |
| 2.3.4 | 2.3.4 | 3.141.59 | 3.3.0 | 7.2.0 |
| 2.2.12 | 2.2.12 | 3.141.59 | 3.3.0 | 7.2.0 |
| 2.2.5 | 2.2.5 | 3.141.59 | 3.3.0 | 7.2.0 |
| 2.2.2 | 2.2.2 | 3.141.59 | 3.3.0 | 7.2.0 |
| 2.2.0 | 2.2.0 | 3.141.59 | 3.3.0 | 7.2.0 |
| 2.1.5 | 2.1.5 | 3.141.59 | 3.3.0 | 7.2.0 |
| 2.1.0 | 2.1.0 | 3.141.59 | 3.3.0 | 7.2.0 |
| 2.0.90 | 2.0.90 | 3.141.59 | 3.3.0 | 7.2.0 |
| 2.0.84 | 2.0.84 | 3.141.59 | 3.3.0 | 7.2.0 |
| 2.0.71 | 2.0.71 | 3.141.59 | 3.3.0 | 7.2.0 |
| 2.0.69 | 2.0.69 | 3.141.59 | 3.3.0 | 7.0.0 |
| 2.0.56 | 2.0.56 | 3.141.59 | 3.3.0 | 7.0.0 |
| 2.0.52 | 2.0.52 | 3.141.59 | 3.3.0 | 7.0.0 |
| 2.0.48 | 2.0.48 | 3.141.59 | 3.3.0 | 7.0.0 |

Sample project: [Serenity JUnit Starter Project](https://github.com/serenity-bdd/serenity-junit-starter).

#### Cucumber 7 (Serenity 3.1.15 onwards)
| serenity-core | serenity-maven-plugin | serenity-cucumber | Cucumber |
|---------------|-----------------------|--------------------|---------------------|
| 3.1.15 | 3.1.15 | 3.1.15 | 7.0.0 |
| serenity-core | serenity-maven-plugin | serenity-cucumber | Cucumber |
|---------------|----------------------|----------00--------|----------|
| 3.2.0 | 3.2.0 | 3.2.0 | 7.2.3 |
| 3.1.20 | 3.1.20 | 3.1.20 | 7.1.1 |
| 3.1.15 | 3.1.15 | 3.1.15 | 7.0.0 |

#### Cucumber 6
_Note:_ Cucumber 6 is no longer supported in newer versions of Serenity.
Expand Down Expand Up @@ -268,10 +274,13 @@ You can raise a defect here. Note that this is an open source project, so **the

Some companies and individuals who find that Serenity BDD helps in their daily work choose to give back by sponsoring the project in different capacities. Bug fixes or change requests coming from sponsors are generally prioritised over other requests.

**NOTE:** From time to time, old issues that have not been active for over 6 months will be automatically closed. If one of these issues affects your project and is still reproducible with the latest version of Serenity, feel free to reopen.

You can help out by sponsoring Serenity BDD directly here:
[:heart: Sponsor](https://github.com/sponsors/serenity-bdd)

Take a look at [this article](https://opensource.guide/how-to-contribute/#communicating-effectively) for more information.


## Need Commercial Support?

Expand Down
14 changes: 14 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Security Policy

## Supported Versions

The following versions are currently being supported with Security updates

| Version | Supported |
| ------- | ------------------ |
| 3.2.x | :white_check_mark: |
| <= 3.1.x | :x: |

## Reporting a Vulnerability

To report a vunerability, raise an issue and include the "security" label. Security vunerabilities are reviewed and assessed as high priority issues.
15 changes: 15 additions & 0 deletions docs/release-notes/3.2.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Serenity 3.2.0

Serenity 3.2.0 contains a number of bug fixes and enhancements, including:
- Improved performance in report generation
- Updated the Page Elements API (https://serenity-bdd.github.io/documentation/docs/guide/page_elements)
- Improved requirements reporting to include more comprehensive requirements tables and better support for deep requirements hierarchies
- Collections of elements retrieved with findAll() methods and then processed (e.g. `findAll(".myelements").texts()`) will now automatically requery if a stale element exception occurs. You can disable this behaviour by setting the `webdriver.retry.on.stable.element.exception` property to false.
- Improved Playwright/Screenplay integration
- Support for @singlebrowser annotation in Cucumber scenarios
- Bug fixes include:
- [2687](https://github.com/serenity-bdd/serenity-core/issues/2687)
- [2693](https://github.com/serenity-bdd/serenity-core/issues/#2693)
- [2660](https://github.com/serenity-bdd/serenity-core/issues/#2660)
- [2667](https://github.com/serenity-bdd/serenity-core/issues/#2667)
- [2655](https://github.com/serenity-bdd/serenity-core/issues/#2655)
19 changes: 9 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-bdd</artifactId>
<packaging>pom</packaging>
<description>Serenity BDD Core Libraries</description>
<name>Serenity BDD</name>
<version>3.1.16-SNAPSHOT</version>
<version>3.2.1-SNAPSHOT</version>
<url>https://serenity-bdd.github.io/</url>

<licenses>
Expand Down Expand Up @@ -49,8 +48,8 @@
<hamcrest.version>2.2</hamcrest.version>
<slf4j.version>1.7.30</slf4j.version>
<guice.version>5.0.1</guice.version>
<cucumber.version>7.1.0</cucumber.version>
<gson.version>2.8.8</gson.version>
<cucumber.version>7.2.3</cucumber.version>
<gson.version>2.8.9</gson.version>
<junit5.version>5.8.2</junit5.version>
<mockito.version>3.3.3</mockito.version>
<assertj.version>3.21.0</assertj.version>
Expand All @@ -63,17 +62,17 @@
<commons.net.version>3.6</commons.net.version>
<commons.codec.version>1.15</commons.codec.version>
<freemarker.version>2.3.31</freemarker.version>
<selenium.version>4.1.1</selenium.version>
<selenium.version>4.1.2</selenium.version>
<jsonassert.version>1.5.0</jsonassert.version>
<jsoup.version>1.14.3</jsoup.version>
<joda-time.version>2.8.2</joda-time.version>
<xstream.version>1.4.18</xstream.version>
<xstream.version>1.4.19</xstream.version>
<opencsv.version>2.0</opencsv.version>
<typesafe.version>1.3.1</typesafe.version>
<imgscalr.version>4.2</imgscalr.version>
<awaitility.version>4.1.0</awaitility.version>
<freemarker.version>2.3.31</freemarker.version>
<appium.version>8.0.0-beta</appium.version>
<appium.version>8.0.0-beta2</appium.version>
<fluentlenium.version>0.10.2</fluentlenium.version>
<!-- <phantomjs.version>1.4.4</phantomjs.version>-->
<!-- <htmlunit.version>2.54.0</htmlunit.version>-->
Expand Down Expand Up @@ -578,9 +577,9 @@
<includes>
<include>**/integration/*IT</include>
<include>**/integration/When*</include>
<include>**/integration/*Examples</include>
<include>**/integration/*Test</include>
<include>**/integration/*TestSuite</include>
<include>**/integration/*Examples</include>
</includes>
<excludes>
<exclude>**/*$*</exclude>
Expand Down Expand Up @@ -636,7 +635,7 @@
<id>enforce</id>
<configuration>
<rules>
<dependencyConvergence/>
<dependencyConvergence />
</rules>
</configuration>
<!-- <goals>-->
Expand Down
2 changes: 1 addition & 1 deletion serenity-ant-task/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>serenity-bdd</artifactId>
<groupId>net.serenity-bdd</groupId>
<version>3.1.16-SNAPSHOT</version>
<version>3.2.1-SNAPSHOT</version>
</parent>
<artifactId>serenity-ant-task</artifactId>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion serenity-assertions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>serenity-bdd</artifactId>
<groupId>net.serenity-bdd</groupId>
<version>3.1.16-SNAPSHOT</version>
<version>3.2.1-SNAPSHOT</version>
</parent>
<artifactId>serenity-assertions</artifactId>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion serenity-browsermob-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>serenity-bdd</artifactId>
<groupId>net.serenity-bdd</groupId>
<version>3.1.16-SNAPSHOT</version>
<version>3.2.1-SNAPSHOT</version>
</parent>
<artifactId>serenity-browsermob-plugin</artifactId>
<packaging>jar</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import net.thucydides.core.guice.Injectors;
import net.thucydides.core.util.EnvironmentVariables;
import org.apache.commons.lang3.StringUtils;
import org.openqa.selenium.Capabilities;
import org.openqa.selenium.MutableCapabilities;
import org.openqa.selenium.Proxy;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
Expand Down Expand Up @@ -85,7 +87,7 @@ public void shutdown() {
}

@Override
public void addCapabilitiesTo(DesiredCapabilities capabilities) {
public void addCapabilitiesTo(MutableCapabilities capabilities) {
if (!proxyServerRunning()) {
setup();
}
Expand Down
2 changes: 1 addition & 1 deletion serenity-browserstack/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>serenity-bdd</artifactId>
<groupId>net.serenity-bdd</groupId>
<version>3.1.16-SNAPSHOT</version>
<version>3.2.1-SNAPSHOT</version>
</parent>
<artifactId>serenity-browserstack</artifactId>
<packaging>jar</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import net.thucydides.core.util.EnvironmentVariables;
import org.openqa.selenium.WebDriver;

import static net.thucydides.core.ThucydidesSystemProperty.WEBDRIVER_REMOTE_URL;


public class AfterABrowserStackScenario implements AfterAWebdriverScenario {

Expand All @@ -17,7 +19,8 @@ public void apply(EnvironmentVariables environmentVariables, TestOutcome testOut
if ((driver == null) || (!RemoteDriver.isARemoteDriver(driver)) || RemoteDriver.isStubbed(driver)) {
return;
}
if (!ThucydidesSystemProperty.WEBDRIVER_REMOTE_URL.from(environmentVariables,"").contains("browserstack")) {
String remoteUrl = EnvironmentSpecificConfiguration.from(environmentVariables).getOptionalProperty(WEBDRIVER_REMOTE_URL).orElse("");
if (!remoteUrl.contains("browserstack")) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
import net.thucydides.core.util.EnvironmentVariables;
import net.thucydides.core.webdriver.SupportedWebDriver;
import org.apache.commons.lang3.StringUtils;
import org.openqa.selenium.MutableCapabilities;
import org.openqa.selenium.Platform;
import org.openqa.selenium.remote.DesiredCapabilities;

import java.util.*;

import static net.thucydides.core.ThucydidesSystemProperty.WEBDRIVER_REMOTE_URL;
import static org.apache.commons.lang3.StringUtils.isNotEmpty;

public class BeforeABrowserStackScenario implements BeforeAWebdriverScenario {
Expand Down Expand Up @@ -45,23 +47,27 @@ public class BeforeABrowserStackScenario implements BeforeAWebdriverScenario {
);

@Override
public DesiredCapabilities apply(EnvironmentVariables environmentVariables,
public MutableCapabilities apply(EnvironmentVariables environmentVariables,
SupportedWebDriver driver,
TestOutcome testOutcome,
DesiredCapabilities capabilities) {
MutableCapabilities capabilities) {

if (driver != SupportedWebDriver.REMOTE) {
return capabilities;
}
if (!ThucydidesSystemProperty.WEBDRIVER_REMOTE_URL.from(environmentVariables,"").contains("browserstack")) {

String remoteUrl = EnvironmentSpecificConfiguration.from(environmentVariables).getOptionalProperty(WEBDRIVER_REMOTE_URL).orElse("");
if (!remoteUrl.contains("browserstack")) {
return capabilities;
}

String remotePlatform = EnvironmentSpecificConfiguration.from(environmentVariables)
.getOptionalProperty("remote.platform")
.orElse(null);
if (isNotEmpty(remotePlatform)) {
capabilities.setPlatform(Platform.valueOf(remotePlatform));
if (capabilities instanceof DesiredCapabilities) {
((DesiredCapabilities) capabilities).setPlatform(Platform.valueOf(remotePlatform));
}
}

Properties browserStackProperties = EnvironmentSpecificConfiguration
Expand All @@ -73,7 +79,6 @@ public DesiredCapabilities apply(EnvironmentVariables environmentVariables,
.forEach((key, value) -> browserStackPropertiesWithOverrides.setProperty(key, value.toString()));

setNonW3CCapabilities(capabilities, browserStackPropertiesWithOverrides);

Map<String, Object> browserstackOptions = w3CPropertyMapFrom(browserStackPropertiesWithOverrides);
String testName = testOutcome.getStoryTitle() + " - " + testOutcome.getTitle();
browserstackOptions.put("sessionName", testName);
Expand All @@ -95,7 +100,7 @@ private Properties caterForOverridesIn(Properties browserStackProperties) {
return propertiesWithOverrides;
}

private void setNonW3CCapabilities(DesiredCapabilities capabilities, Properties browserStackProperties) {
private void setNonW3CCapabilities(MutableCapabilities capabilities, Properties browserStackProperties) {
browserStackProperties.stringPropertyNames()
.stream()
.filter(this::isNonW3CProperty)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonSyntaxException;
import com.google.gson.stream.MalformedJsonException;
import net.thucydides.core.model.TestOutcome;
Expand Down Expand Up @@ -171,7 +172,8 @@ private String getSessionProperty(String propertyName) {
}

JsonElement automationSession = sessionElement.getAsJsonObject().get("automation_session");
return automationSession.getAsJsonObject().get(propertyName).getAsString();
JsonElement element = automationSession.getAsJsonObject().get(propertyName);
return element.isJsonNull() ? null : element.getAsString();
}


Expand Down
Loading

0 comments on commit 0e05112

Please sign in to comment.