From 098e39c506b09b35b96a127ec5879cce97a900f8 Mon Sep 17 00:00:00 2001 From: Konstantin Maltsev Date: Thu, 22 Apr 2021 09:56:45 +0700 Subject: [PATCH 1/2] fix disable animations capability --- .../capabilities/SelenoidCapabilitiesParser.java | 9 ++++----- .../sbtqa/tag/pagefactory/properties/Configuration.java | 4 ---- .../src/main/asciidoc/mobile_properties.asciidoc | 3 +++ .../pagefactory/mobile/drivers/MobileDriverService.java | 3 +-- .../mobile/properties/MobileConfiguration.java | 4 ---- 5 files changed, 8 insertions(+), 15 deletions(-) diff --git a/page-factory-core/src/main/java/ru/sbtqa/tag/pagefactory/capabilities/SelenoidCapabilitiesParser.java b/page-factory-core/src/main/java/ru/sbtqa/tag/pagefactory/capabilities/SelenoidCapabilitiesParser.java index 47f83ff7..b3b7e029 100644 --- a/page-factory-core/src/main/java/ru/sbtqa/tag/pagefactory/capabilities/SelenoidCapabilitiesParser.java +++ b/page-factory-core/src/main/java/ru/sbtqa/tag/pagefactory/capabilities/SelenoidCapabilitiesParser.java @@ -29,8 +29,8 @@ public DesiredCapabilities parse() { setVersion(version); String name = getProperty(PROPERTIES.getSelenoidNameOfTests()); - String logName = getProperty(PROPERTIES.getSelenoidLogName()) + ".log"; - String videoName = getProperty(PROPERTIES.getSelenoidVideoName()) + ".mp4"; + String logName = getProperty(PROPERTIES.getSelenoidLogName()); + String videoName = getProperty(PROPERTIES.getSelenoidVideoName()); setCapability("enableVNC", PROPERTIES.getSelenoidEnableVNC()); @@ -40,14 +40,13 @@ public DesiredCapabilities parse() { setCapability("videoScreenSize", PROPERTIES.getSelenoidVideoScreenSize()); setCapability("videoFrameRate", PROPERTIES.getSelenoidVideoFrameRate()); setCapability("name", name); - setCapability("logName", logName, UNIQUE_NAME_FORMAT); - setCapability("videoName", videoName, UNIQUE_NAME_FORMAT); + setCapability("logName", logName, UNIQUE_NAME_FORMAT + ".log"); + setCapability("videoName", videoName, UNIQUE_NAME_FORMAT + ".mp4"); setCapability("timeZone", PROPERTIES.getSelenoidTimeZone()); setCapability("hostsEntries", PROPERTIES.getSelenoidHostEntries()); setCapability("applicationContainers", PROPERTIES.getSelenoidApplicationContainers()); setCapability("labels", PROPERTIES.getSelenoidContainerLabels()); setCapability("sessionTimeout", PROPERTIES.getSelenoidSessionTimeout()); - setCapability("timeZone", PROPERTIES.getSelenoidTimeZone()); return capabilities; } diff --git a/page-factory-core/src/main/java/ru/sbtqa/tag/pagefactory/properties/Configuration.java b/page-factory-core/src/main/java/ru/sbtqa/tag/pagefactory/properties/Configuration.java index ffeb746a..2f0cfee2 100644 --- a/page-factory-core/src/main/java/ru/sbtqa/tag/pagefactory/properties/Configuration.java +++ b/page-factory-core/src/main/java/ru/sbtqa/tag/pagefactory/properties/Configuration.java @@ -103,10 +103,6 @@ public interface Configuration extends Config { @DefaultValue("") String getSelenoidSessionTimeout(); - @Key("selenoid.timeZone") - @DefaultValue("") - String getSelenoidTimezone(); - @Key("aspects.report.fill.enabled") @DefaultValue("true") diff --git a/page-factory-doc/src/main/asciidoc/mobile_properties.asciidoc b/page-factory-doc/src/main/asciidoc/mobile_properties.asciidoc index 980b2803..b820c475 100644 --- a/page-factory-doc/src/main/asciidoc/mobile_properties.asciidoc +++ b/page-factory-doc/src/main/asciidoc/mobile_properties.asciidoc @@ -108,6 +108,9 @@ include::common_properties.asciidoc[] | appium.xcodeSigningId | iOS only. Идентификатор подписи кода в Xcode + +| appium.disableWindowAnimation +| Android only. Следует ли отключать анимацию окон при запуске, по умолчанию false |==================== ==== Параметры работы с Selenoid/Moon diff --git a/plugins/mobile-plugin/src/main/java/ru/sbtqa/tag/pagefactory/mobile/drivers/MobileDriverService.java b/plugins/mobile-plugin/src/main/java/ru/sbtqa/tag/pagefactory/mobile/drivers/MobileDriverService.java index 71dc9e6a..9e2872e3 100644 --- a/plugins/mobile-plugin/src/main/java/ru/sbtqa/tag/pagefactory/mobile/drivers/MobileDriverService.java +++ b/plugins/mobile-plugin/src/main/java/ru/sbtqa/tag/pagefactory/mobile/drivers/MobileDriverService.java @@ -59,8 +59,7 @@ public void mountDriver() { capabilities.setCapability("xcodeOrgId", PROPERTIES.getAppiumXcodeOrgId()); capabilities.setCapability("xcodeSigningId", PROPERTIES.getAppiumXcodeSigningId()); capabilities.setCapability("showIOSLog", PROPERTIES.getAppiumShowIOSLog()); - capabilities.setCapability("waitForIdleTimeout", PROPERTIES.getWaitForIdleTimeout()); - capabilities.setCapability("disableWindowAnimation", PROPERTIES.getDisableWindowAnimation()); + capabilities.setCapability("appium:disableWindowAnimation", PROPERTIES.getDisableWindowAnimation()); capabilities.setCapability("appium:useJSONSource", PROPERTIES.getAppiumUseJSONSource()); capabilities.setCapability("appium:simpleIsVisibleCheck", PROPERTIES.getAppiumSimpleIsVisibleCheck()); capabilities.setCapability("appium:useNewWDA", PROPERTIES.getAppiumUseNewWDA()); diff --git a/plugins/mobile-plugin/src/main/java/ru/sbtqa/tag/pagefactory/mobile/properties/MobileConfiguration.java b/plugins/mobile-plugin/src/main/java/ru/sbtqa/tag/pagefactory/mobile/properties/MobileConfiguration.java index c40b8be1..a16b36ef 100644 --- a/plugins/mobile-plugin/src/main/java/ru/sbtqa/tag/pagefactory/mobile/properties/MobileConfiguration.java +++ b/plugins/mobile-plugin/src/main/java/ru/sbtqa/tag/pagefactory/mobile/properties/MobileConfiguration.java @@ -156,10 +156,6 @@ public interface MobileConfiguration extends Configuration { @DefaultValue("false") String getAppiumShowIOSLog(); - @Key("appium.waitForIdleTimeout") - @DefaultValue("") - String getWaitForIdleTimeout(); - @Key("appium.disableWindowAnimation") @DefaultValue("false") boolean getDisableWindowAnimation(); From 05ebbd0e831bf8e212ea800cd6a27dd2ad911d51 Mon Sep 17 00:00:00 2001 From: Konstantin Maltsev Date: Thu, 22 Apr 2021 10:25:17 +0700 Subject: [PATCH 2/2] add wait idle timeout in props --- .../src/main/asciidoc/mobile_properties.asciidoc | 3 +++ .../tag/pagefactory/mobile/drivers/MobileDriverService.java | 5 +++++ .../pagefactory/mobile/properties/MobileConfiguration.java | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/page-factory-doc/src/main/asciidoc/mobile_properties.asciidoc b/page-factory-doc/src/main/asciidoc/mobile_properties.asciidoc index b820c475..8eaaff61 100644 --- a/page-factory-doc/src/main/asciidoc/mobile_properties.asciidoc +++ b/page-factory-doc/src/main/asciidoc/mobile_properties.asciidoc @@ -111,6 +111,9 @@ include::common_properties.asciidoc[] | appium.disableWindowAnimation | Android only. Следует ли отключать анимацию окон при запуске, по умолчанию false + +| appium.waitForIdleTimeout +| Android only. Тайм-аут, используемый для ожидания перехода пользовательского интерфейса в состояние ожидания, по умолчанию 10000 |==================== ==== Параметры работы с Selenoid/Moon diff --git a/plugins/mobile-plugin/src/main/java/ru/sbtqa/tag/pagefactory/mobile/drivers/MobileDriverService.java b/plugins/mobile-plugin/src/main/java/ru/sbtqa/tag/pagefactory/mobile/drivers/MobileDriverService.java index 9e2872e3..bf84460b 100644 --- a/plugins/mobile-plugin/src/main/java/ru/sbtqa/tag/pagefactory/mobile/drivers/MobileDriverService.java +++ b/plugins/mobile-plugin/src/main/java/ru/sbtqa/tag/pagefactory/mobile/drivers/MobileDriverService.java @@ -1,6 +1,7 @@ package ru.sbtqa.tag.pagefactory.mobile.drivers; import io.appium.java_client.AppiumDriver; +import io.appium.java_client.Setting; import io.appium.java_client.android.AndroidDriver; import io.appium.java_client.ios.IOSDriver; import io.appium.java_client.remote.IOSMobileCapabilityType; @@ -81,6 +82,10 @@ public void mountDriver() { mobileDriver = PROPERTIES.getAppiumPlatformName() == IOS ? new IOSDriver(url, capabilities) : new AndroidDriver(url, capabilities); + if (PROPERTIES.getAppiumPlatformName() == ANDROID) { + ((AndroidDriver) mobileDriver).setSetting(Setting.WAIT_FOR_IDLE_TIMEOUT, PROPERTIES.getWaitForIdleTimeout()); + } + if (PROPERTIES.getAppiumVideoEnabled()) { appiumVideoRecorder = new AppiumVideoRecorder(Environment.getScenario()); appiumVideoRecorder.startRecord(); diff --git a/plugins/mobile-plugin/src/main/java/ru/sbtqa/tag/pagefactory/mobile/properties/MobileConfiguration.java b/plugins/mobile-plugin/src/main/java/ru/sbtqa/tag/pagefactory/mobile/properties/MobileConfiguration.java index a16b36ef..2ebf2bba 100644 --- a/plugins/mobile-plugin/src/main/java/ru/sbtqa/tag/pagefactory/mobile/properties/MobileConfiguration.java +++ b/plugins/mobile-plugin/src/main/java/ru/sbtqa/tag/pagefactory/mobile/properties/MobileConfiguration.java @@ -156,6 +156,10 @@ public interface MobileConfiguration extends Configuration { @DefaultValue("false") String getAppiumShowIOSLog(); + @Key("appium.waitForIdleTimeout") + @DefaultValue("10000") + long getWaitForIdleTimeout(); + @Key("appium.disableWindowAnimation") @DefaultValue("false") boolean getDisableWindowAnimation();