Skip to content

Instantly share code, notes, and snippets.

@maksimlaptev
maksimlaptev / MainScreenLocators.java
Last active June 19, 2023 11:52
Describing locators for both platforms(Android,Ios)
import com.codeborne.selenide.Selenide;
import com.codeborne.selenide.SelenideElement;
import io.appium.java_client.pagefactory.AndroidFindBy;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
/**
* Locators for the main page of the application. The same locators can be used for different platforms
* example
@maksimlaptev
maksimlaptev / MainScreenSteps.java
Created June 19, 2023 11:51
Working with steps (2 examples of step descriptions for the Allure report)
import io.qameta.allure.Step;
import screens.MainScreenLocators;
import static com.codeborne.selenide.Selenide.page;
import static io.qameta.allure.Allure.step;
import static org.testng.Assert.assertEquals;
/** This class describes the action steps for the Calculator screen. Step descriptions appear in the report for each test. **/
public class MainScreenSteps {
@maksimlaptev
maksimlaptev / Env_mobile.java
Created June 19, 2023 11:56
how to configure the main class to work with appium
import com.codeborne.selenide.WebDriverRunner;
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.service.local.AppiumDriverLocalService;
import io.appium.java_client.service.local.AppiumServiceBuilder;
import io.qameta.allure.selenide.AllureSelenide;
import org.aeonbits.owner.ConfigFactory;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.AfterSuite;
import org.testng.annotations.BeforeSuite;
@maksimlaptev
maksimlaptev / versions.md
Last active July 11, 2023 19:49
version check commands
java --version
mvn --version
allure --version
adb --version
git --version
@maksimlaptev
maksimlaptev / capabilities.JSON
Last active July 11, 2023 19:35
Desired Capabilities
{
"deviceName": "1255b4c0",
"platformName": "android"
}
@maksimlaptev
maksimlaptev / adb_shell.md
Last active July 11, 2023 19:47
adb command from SDK tools
adb shell
dumpsys activity | grep mFocusedActivity
adb logcat pathTo/log.txt
@maksimlaptev
maksimlaptev / link_for_appium.md
Created July 11, 2023 19:56
Appium Server link
@maksimlaptev
maksimlaptev / mvn_run_suite.md
Created July 11, 2023 19:58
run the test suite specified in the testng.xml file

mvn clean test -DsuiteXmlFile=testng.xml

@maksimlaptev
maksimlaptev / mvn_run_class.md
Created July 11, 2023 20:00
run class with tests

mvn -Dtest=TestNameClass test