Fix capabilities (#12)

This commit is contained in:
Egor Cherniak 2022-06-23 14:26:34 +03:00 committed by GitHub
parent c5c1a8b1ad
commit dc33dd9bb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -35,7 +35,8 @@ public class SeleniumConfig {
URL lambdaTestUrl = buildLambdaTestUrl(seleniumProperties.getLambdaTest()); URL lambdaTestUrl = buildLambdaTestUrl(seleniumProperties.getLambdaTest());
String formUrl = paymentsProperties.getFormUrl(); String formUrl = paymentsProperties.getFormUrl();
Long formTimeoutSec = paymentsProperties.getFormTimeoutSec(); Long formTimeoutSec = paymentsProperties.getFormTimeoutSec();
DesiredCapabilities desiredCapabilities = SeleniumUtil.getLambdaTestCapabilities(); DesiredCapabilities desiredCapabilities =
SeleniumUtil.getLambdaTestCapabilities(seleniumProperties.getLambdaTest());
return new SeleniumService(lambdaTestUrl, formUrl, formTimeoutSec, desiredCapabilities, converter); return new SeleniumService(lambdaTestUrl, formUrl, formTimeoutSec, desiredCapabilities, converter);
} }

View File

@ -1,5 +1,6 @@
package dev.vality.beholder.util; package dev.vality.beholder.util;
import dev.vality.beholder.config.properties.SeleniumProperties;
import lombok.experimental.UtilityClass; import lombok.experimental.UtilityClass;
import org.openqa.selenium.logging.LogType; import org.openqa.selenium.logging.LogType;
import org.openqa.selenium.logging.LoggingPreferences; import org.openqa.selenium.logging.LoggingPreferences;
@ -29,12 +30,14 @@ public class SeleniumUtil {
return capabilities; return capabilities;
} }
public static DesiredCapabilities getLambdaTestCapabilities() { public static DesiredCapabilities getLambdaTestCapabilities(SeleniumProperties.LambdaTestProperties lambdaTest) {
var capabilities = getCommonCapabilities(); var capabilities = getCommonCapabilities();
capabilities.setCapability("network", false); capabilities.setCapability("network", false);
capabilities.setCapability("visual", false); capabilities.setCapability("visual", false);
capabilities.setCapability("video", false); capabilities.setCapability("video", false);
capabilities.setCapability("console", false); capabilities.setCapability("console", false);
capabilities.setCapability("user", lambdaTest.getUser());
capabilities.setCapability("accessKey", lambdaTest.getToken());
return capabilities; return capabilities;
} }
} }