Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

Commit

Permalink
Merge pull request #323 from SvetlanaUtina/selenoid-name-of-test
Browse files Browse the repository at this point in the history
Selenoid name of test
  • Loading branch information
clicman authored Oct 29, 2020
2 parents 7388414 + 8305ed9 commit fb7915f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions page-factory-doc/src/main/asciidoc/web_properties.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ http://proxy.com:8080
|selenoid.enableVNC = true
|selenoid.screenResolution
| Разрешение экрана
selenoid.screenResolution = 1280x1024x24
|selenoid.screenResolution = 1280x1024x24
|selenoid.enableVideo
| Включение/выключение записи видео
|selenoid.enableVideo = true
Expand All @@ -149,7 +149,7 @@ selenoid.video.name = my-cool-video.mp4
| Количество кадров в секунду
|selenoid.video.frameRate = 24
|selenoid.nameOfTests
| Имя теста
| Имя теста, по умолчанию наименование берется из названия сценария (для cucumber сценария)
|selenoid.nameOfTests = myCoolTestName
|selenoid.timeZone
| Таймзона
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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());
Expand Down

0 comments on commit fb7915f

Please sign in to comment.