GithubHelp home page GithubHelp logo

karate-devicefarm-demo's Introduction

Karate and AWS DeviceFarm Demo

This is a project that demonstrates the following:

Prerequisites:

  • Follow the instructions here to create a DeviceFarm project on AWS and set up your AWS access and secret keys in your environment.
  • Change the urn in karate-config.js to match the DeviceFarm URN of the DeviceFarm project.

Now you can run SearchRunner.java as a JUnit test.

karate-devicefarm-demo's People

Contributors

ptrthomas avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

karate-devicefarm-demo's Issues

timeout capabilities(aws:maxDurationSecs & aws:idleTimeoutSecs) are not reflecting in Karate

When I added the timeout capabilities(aws:maxDurationSecs & aws:idleTimeoutSecs) in DeviceFarmTarget.java as shown below its not getting reflected. Please see the devicefarm webdriver.log below
--------------------------DeviceFarmTarget.java---------------------------------
@OverRide
public Map<String, Object> start(Logger logger) {
logger.info("making request to aws for browser: {}", browserName);
logger.info(" sercurty key arn : {}", arn);
DeviceFarmClient client = DeviceFarmClient.builder().region(Region.US_WEST_2).build();
CreateTestGridUrlRequest request = CreateTestGridUrlRequest.builder()
.expiresInSeconds(86400)
.projectArn(arn)
.build();
// logger.info(" request: {}", request);
CreateTestGridUrlResponse response = client.createTestGridUrl(request);
// logger.info(" response: {}", response);
String webDriverUrl = response.url();
// logger.info("aws url provisioned: {}", webDriverUrl);
Map<String, Object> map = new HashMap();
map.put("type", driverType);
map.put("start", false);
map.put("webDriverUrl", webDriverUrl);
// this is needed because it can take a minute or two for the "desktop" to be provisioned by aws
map.put("httpConfig", Collections.singletonMap("readTimeout", 120000));
// refer: https://docs.aws.amazon.com/devicefarm/latest/testgrid/techref-support.html
Map<String, Object> session = new HashMap();
map.put("webDriverSession", session);
Map<String, Object> capabilities = new HashMap();
capabilities.put("browserName", browserName);
capabilities.put("aws:maxDurationSecs", 2400);
capabilities.put("aws:idleTimeoutSecs", 900);
session.put("capabilities", capabilities);

    // for some reason, both are needed for aws device farm
    session.put("desiredCapabilities", capabilities);    
    return map;
}

----------------------------Webdriver.log-------------------------------
"capabilities": {
"alwaysMatch": {
"goog:chromeOptions": {
"args": [
"user-data-dir=C:\Users\testnode\chrome_user_data",
"--enable-logging --v=1"
]
}
},
"aws:idleTimeoutSecs": 240,
"aws:maxDurationSecs": 2400,
"browserName": "chrome"
}

The AWS suggested was trying setting the timeout capabilities(aws:maxDurationSecs & aws:idleTimeoutSecs) inside alwaysMatch .However, In the above case its outside the alwaysMatch.
IF this is the case, how do we add this capabilities in the DeviceFarmTarget.java so that it reflects inside the alwaysMatch block. Please let me know if you have any suggestion.

DeviceFarmTarget.docx

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.