Created
July 15, 2022 16:42
-
-
Save SarahElson/deffdd31fc1c19e135a40c1015a4264e to your computer and use it in GitHub Desktop.
Automated App Testing Using Appium With TestNG [Tutorial]
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
package com.lambdatest.appium.sample.ios; | |
import static com.lambdatest.appium.sample.enums.Platform.IOS; | |
import static org.openqa.selenium.support.ui.ExpectedConditions.elementToBeClickable; | |
import static org.openqa.selenium.support.ui.ExpectedConditions.visibilityOfElementLocated; | |
import java.net.MalformedURLException; | |
import com.lambdatest.appium.sample.BaseTest; | |
import com.lambdatest.appium.sample.enums.Environment; | |
import com.lambdatest.appium.sample.enums.Platform; | |
import com.lambdatest.appium.sample.pages.HomePage; | |
import com.lambdatest.appium.sample.utils.Swipe; | |
import io.appium.java_client.MobileElement; | |
import io.appium.java_client.ios.IOSDriver; | |
import org.openqa.selenium.support.ui.WebDriverWait; | |
import org.testng.Assert; | |
import org.testng.annotations.BeforeTest; | |
import org.testng.annotations.Parameters; | |
import org.testng.annotations.Test; | |
// 1. | |
public class IOSTest extends BaseTest<IOSDriver<MobileElement>> { | |
private static final Platform PLATFORM = IOS; | |
private HomePage homePage; | |
// 2. | |
@Parameters ({ "environment", "deviceName", "version", "app" }) | |
@BeforeTest | |
public void setupDriver (final Environment environment, final String deviceName, final String version, | |
final String app) throws MalformedURLException { | |
this.homePage = new HomePage (); | |
this.driver = new IOSDriver<> (getUrl (environment), getOptions (environment, "iOS", deviceName, version, app)); | |
this.wait = new WebDriverWait (this.driver, 10); | |
this.swipe = new Swipe<> (this.driver); | |
} | |
// 3. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment