I'm quite new to Appium and testing. I want to write my first tests for Appium in Java using Eclipse and JUnit.
I have already written a simple test that does nothing. It compiles so far but I don't know what's going on...
I want to know how the tests work in general. I already have some experience in programming and therefore some actions going on are a bit strange to me :).
For example: As far as I can see all test layouts look like this:
public class AppiumIOSTest {
private WebDriver driver;
@Before
public void setUp() throws Exception {
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("platformName", "ios");
capabilities.setCapability("platformVersion", "9.2");
capabilities.setCapability("deviceName","iPhone 6");
capabilities.setCapability("app", "TestApp.app");
driver = new RemoteWebDriver( new URL( "http://127.0.0.1:4723/wd/hub" ), capabilities );
}
@After
public void tearDown() throws Exception {
driver.quit();
}
@Test
public void testScriptGoesHere() throws Exception {
}
}
But where can I find documentation that tells me to write a test layout like this. I mean, why is setUp()
called first - and from where?
Do I need a constructor and destructor?
Why is testScriptGoesHere()
called and what about if I have more than just one test?
How do I have to access the UI elements in the app? What's good practice and which methods I should not use?
So I would like to have any documentation that I can use. So far I haven't found anything on Google but maybe my keywords don't match...?
Greets.