Skip to content

Commit

Permalink
Merge pull request #5 from Mahbub091/mahbub
Browse files Browse the repository at this point in the history
update
  • Loading branch information
Mahbub091 authored Aug 15, 2023
2 parents 2e71fcb + 3f6d216 commit 5058ebe
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/test/java/BaseConfig/SettingAndroidEnv.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,32 @@
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.options.UiAutomator2Options;
import io.appium.java_client.remote.AutomationName;
import io.appium.java_client.service.local.AppiumDriverLocalService;
import io.appium.java_client.service.local.AppiumServiceBuilder;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;

import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.time.Duration;

public class SettingAndroidEnv {

public AndroidDriver driver;
public AppiumDriverLocalService service;


@BeforeTest
public AndroidDriver setup() throws MalformedURLException {


//run appium server automatically
service=new AppiumServiceBuilder().withAppiumJS(new File("C:\\Users\\Md. Mahbubur. Rahman\\AppData\\Roaming\\npm\\node_modules\\appium\\build\\lib\\main.js"))
.withIPAddress("127.0.0.1").usingPort(4723).withTimeout(Duration.ofSeconds(300)).build();

service.start();

UiAutomator2Options options = new UiAutomator2Options ();
options.setPlatformName("android");
options.setAutomationName(AutomationName.ANDROID_UIAUTOMATOR2);
Expand Down
1 change: 1 addition & 0 deletions src/test/java/PageManagement/HomePage.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public HomePage(WebDriver driver) {
public void clickingOnAppElement(){
testUtils.elementIsDisplayed(tshirtBox, time_out_min);
testUtils.clickingOnElement(tshirtBox);
testUtils.wait(1);
testUtils.verifyText(tshirtText, "Sauce Labs Backpack");

}
Expand Down

0 comments on commit 5058ebe

Please sign in to comment.