9. Problem #3
• Firstly, Login takes 30 seconds
• And Then dismissing “What’s new” takes another 30 sec
• I don’t want to repeat this in each test
Our tests are so slow.
11. public class LoginActivity extends Activity {
public void foo() {
// code to set some app state
// Or seed DB before test
// Or Disable ‘Rate Us’ popup
}
}
12. public class LoginActivity extends Activity {
public void foo() {
// code to set some app state
// Or seed DB before test
// Or Disable ‘Rate Us’ popup
}
}
30. On Client side..
curl -X POST -H "Content-Type: application/json"
http://localhost:<forwarded_port>/wd/hub/sess
ion/:sessionId/backdoor
-d
'{"methods":[{"name":"<method>",
"args":["<method_arg>"]}]}'
31. On Client side..
def backdoor(*args)
url =
"http://localhost:#{FORWARDED_PORT}"+
“/wd/hub/session/:sessionId/backdoor"
body = {'methods' => args}.to_json
# code to post data
end
32. On Client side..
def backdoor(*args)
url =
"http://localhost:#{FORWARDED_PORT}"+
“/wd/hub/session/:sessionId/backdoor"
body = {'methods' => args}.to_json
# code to post data
end
backdoor({name:”methodName",args:["Arg"]})
33.
34. Quiz
1. Add a backdoor method to change refersh interval:
changeRefreshInterval(time)
2. Add a backdoor method to refresh weather
refreshWeather()
Weather refresh every 30 min. How will you
test this case?