From 5dcac60ab7b1b095bcb188668fb1e76a5ae8b259 Mon Sep 17 00:00:00 2001 From: svetlana Date: Tue, 27 Oct 2020 18:21:27 +0300 Subject: [PATCH] set scenario name of test to selenoid name capability, if we don't set capability via properties, add description --- page-factory-doc/src/main/asciidoc/web_properties.asciidoc | 4 ++-- .../web/capabilities/SelenoidCapabilitiesParser.java | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/page-factory-doc/src/main/asciidoc/web_properties.asciidoc b/page-factory-doc/src/main/asciidoc/web_properties.asciidoc index 45c8ab5d..100c0e6c 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 -| Имя теста +| Имя теста, по умолчанию наименование берется из названия сценария |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..494b946d 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,7 @@ public DesiredCapabilities parse() { setCapability("videoName", PROPERTIES.getSelenoidVideoName(), VIDEONAME_FORMAT); setCapability("videoScreenSize", PROPERTIES.getSelenoidVideoScreenSize()); setCapability("videoFrameRate", PROPERTIES.getSelenoidVideoFrameRate()); - setCapability("name", PROPERTIES.getSelenoidNameOfTests()); + setCapability("name", PROPERTIES.getSelenoidNameOfTests().trim().isEmpty() ? Environment.getScenario().getName() : PROPERTIES.getSelenoidNameOfTests()); setCapability("timeZone", PROPERTIES.getSelenoidTimeZone()); setCapability("hostsEntries", PROPERTIES.getSelenoidHostEntries()); setCapability("applicationContainers", PROPERTIES.getSelenoidApplicationContainers());