public void RunBenchmarkHelper (string benchmark)
{
var assembly = Assembly.GetExecutingAssembly ();
using (Stream stream = assembly.GetManifestResourceStream ("AndroidAgent.UITests.params.json")) {
using (StreamReader reader = new StreamReader (stream)) {
dynamic json = JsonConvert.DeserializeObject (reader.ReadToEnd ());
string githubAPIKey = json.githubAPIKey;
string httpAPITokens = json.httpAPITokens;
string machineName = json.machineName;
string runSetId = json.runSetId;
string configName = json.configName;
app.Screenshot ("init");
clearAndSetTextField ("benchmark", benchmark);
clearAndSetTextField ("githubAPIKey", githubAPIKey);
clearAndSetTextField ("httpAPITokens", httpAPITokens);
clearAndSetTextField ("machineName", machineName);
clearAndSetTextField ("runSetId", runSetId);
clearAndSetTextField ("configName" ,configName);
app.Tap (c => c.Marked ("myButton"));
app.Screenshot ("after tap");
app.WaitForNoElement (c => c.Marked ("myButton").Text ("running"), "Benchmark is taking too long", TimeSpan.FromMinutes (179));
Assert.AreEqual (app.Query (c => c.Marked ("myButton")).First ().Text, "start");
app.Screenshot ("after benchmark");
}
}
}
}