import java.io.File;
import com.experitest.client.*;
import org.junit.*;
import java.util.Timer;
public class EriBankTest {
private static final boolean True = false;
private String host = "localhost";
private int port = 8889;
private String projectBaseDirectory = "C:\\Users\\markha\\workspace ";
protected Client client = null;
@
Before
public void setUp() {
client = new Client(host, port, true);
client.setProjectBaseDirectory(projectBaseDirectory);
File reports = new File(System.getProperty("user.dir"), "reports");
reports.mkdir();
client.setReporter("xml", reports.getAbsolutePath(), "EriBankTest");
}
@
Test
public void MyEriBankTest() {
client.setDevice("adb:Nexus 7 (Old)");
client.launch("com.experitest.ExperiBank/.LoginActivity", true, false);
client.elementSendText("NATIVE", "hint=Username", 0, "company");
client.elementSendText("NATIVE", "hint=Password", 0, "company");
client.click("NATIVE", "text=Login", 0, 1);
client.click("NATIVE", "text=Make Payment", 0, 1);
client.elementSendText("NATIVE", "hint=Phone", 0, "07700011101");
if (client.waitForElement("NATIVE", "hint=Name", 0, 30000)) {
// If statement
}
client.elementSendText("NATIVE", "hint=Name", 0, "Mark");
if (client.waitForElement("NATIVE", "hint=Amount", 0, 10000)) {
// If statement
}
client.elementSendText("NATIVE", "hint=Amount", 0, "100");
client.click("NATIVE", "text=Select", 0, 1);
client.click("NATIVE", "text=Ireland", 0, 1);
client.click("NATIVE", "text=Send Payment", 0, 1);
client.click("NATIVE", "text=Yes", 0, 1);
client.click("NATIVE", "text=Logout", 0, 1);
}
@
After
public void tearDown() {
client.generateReport();
}
}
21 września 2015
0 Likes