Last active
March 9, 2018 14:19
-
-
Save leomenezessz/9fbbeba1c2cc3c7287e467b72bc93bb8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TestIosCalculator { | |
private static CalculatorScreen calculatorScreen; | |
private static AppiumDriver<MobileElement> appiumDriver; | |
@BeforeClass | |
public static void setup() throws MalformedURLException { | |
DesiredCapabilities capabilities = new DesiredCapabilities(); | |
capabilities.setCapability("app",new File("apps/SimpleCalculator.app")); | |
capabilities.setCapability("plataform", "MAC" ); | |
capabilities.setCapability("plataformName", "ios" ); | |
capabilities.setCapability("deviceName", "iPhone SE"); | |
capabilities.setCapability("automationName" , "XCUITest"); | |
appiumDriver = new IOSDriver<MobileElement>(new URL("http://localhost:4723/wd/hub") , capabilities); | |
calculatorScreen = new CalculatorScreen(appiumDriver); | |
} | |
@Test | |
public void should_sum() { | |
calculatorScreen.fillFirstNumber("10").fillSecondNumber("10").closeKeyboard().buttonSum.click(); | |
assertTrue(calculatorScreen.operationResult().equals("20")); | |
} | |
@AfterClass | |
public static void teardown() { | |
calculatorScreen.quitDriver(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment