diff --git a/page-factory-doc/src/main/asciidoc/web_properties.asciidoc b/page-factory-doc/src/main/asciidoc/web_properties.asciidoc index 45c8ab5d..20d2cbe2 100644 --- a/page-factory-doc/src/main/asciidoc/web_properties.asciidoc +++ b/page-factory-doc/src/main/asciidoc/web_properties.asciidoc @@ -135,7 +135,7 @@ http://proxy.com:8080 |selenoid.enableVNC = true |selenoid.screenResolution | Разрешение экрана -selenoid.screenResolution = 1280x1024x24 +|selenoid.screenResolution = 1280x1024x24 |selenoid.enableVideo | Включение/выключение записи видео |selenoid.enableVideo = true @@ -149,7 +149,7 @@ selenoid.video.name = my-cool-video.mp4 | Количество кадров в секунду |selenoid.video.frameRate = 24 |selenoid.nameOfTests -| Имя теста +| Имя теста, по умолчанию наименование берется из названия сценария (для cucumber сценария) |selenoid.nameOfTests = myCoolTestName |selenoid.timeZone | Таймзона diff --git a/plugins/web-plugin/src/main/java/ru/sbtqa/tag/pagefactory/web/capabilities/SelenoidCapabilitiesParser.java b/plugins/web-plugin/src/main/java/ru/sbtqa/tag/pagefactory/web/capabilities/SelenoidCapabilitiesParser.java index 80701cb4..b0c014ef 100644 --- a/plugins/web-plugin/src/main/java/ru/sbtqa/tag/pagefactory/web/capabilities/SelenoidCapabilitiesParser.java +++ b/plugins/web-plugin/src/main/java/ru/sbtqa/tag/pagefactory/web/capabilities/SelenoidCapabilitiesParser.java @@ -8,6 +8,7 @@ import org.openqa.selenium.remote.DesiredCapabilities; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import ru.sbtqa.tag.pagefactory.environment.Environment; import ru.sbtqa.tag.pagefactory.web.environment.WebEnvironment; import ru.sbtqa.tag.pagefactory.web.properties.WebConfiguration; @@ -30,7 +31,13 @@ public DesiredCapabilities parse() { setCapability("videoName", PROPERTIES.getSelenoidVideoName(), VIDEONAME_FORMAT); setCapability("videoScreenSize", PROPERTIES.getSelenoidVideoScreenSize()); setCapability("videoFrameRate", PROPERTIES.getSelenoidVideoFrameRate()); - setCapability("name", PROPERTIES.getSelenoidNameOfTests()); + String selenoidName; + if (PROPERTIES.getSelenoidNameOfTests().trim().isEmpty() && Environment.getScenario() != null) { + selenoidName = Environment.getScenario().getName(); + } else { + selenoidName = PROPERTIES.getSelenoidNameOfTests(); + } + setCapability("name", selenoidName); setCapability("timeZone", PROPERTIES.getSelenoidTimeZone()); setCapability("hostsEntries", PROPERTIES.getSelenoidHostEntries()); setCapability("applicationContainers", PROPERTIES.getSelenoidApplicationContainers());