Skip to content

Instantly share code, notes, and snippets.

@KrishnB
KrishnB / AdbCommands
Created April 19, 2022 11:50 — forked from Pulimet/AdbCommands
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
import org.testng.Assert;
import org.testng.annotations.Test;
public class SearchTests {
@Test
public void verifyIfSearchTermShowsRelevantResults() {
//Arrange
String searchItem = "Jeans";
String searchKey = "Jean";
LauncherPage launcherPage = new LauncherPage(webdriver); // Assume webdriver is created and // handy
We can make this file beautiful and searchable if this error is corrected: Illegal quoting in line 2.
Abbreviation, Generates a By statement to find locator using, Generated Code
mpf, Declare locators for multiple platforms - Android,iOS,Web, Responsive Web, MultiPlatformFinder locator = finder(queryByContentDesc("test-Username"), queryByName("test-Username"));
qba
attribute
private By locator = queryByAttribute("attribute", "value");
qbc
Language Votes
Java 43%
JavaScript 35%
C# 8.8%
Python 8%
Ruby 4.2%
stages:
- test
- allure
- deploy
.download_history: &download_history
after_script:
- apt-get install -y unzip
- mkdir backup && cd backup || true
- "curl --location --output report.zip --request GET \"https://gitlab.com/api/v4/projects/${CI_PROJECT_ID}/jobs/artifacts/master/download?job=pages\" --header \"Authorization: Bearer ${CI_DEPLOY_TOKEN}\" || true"
.download_history: &download_history
after_script:
- mkdir backup && cd backup || true
- "curl --location --output report.zip --request GET \"https://gitlab.com/api/v4/projects/${CI_PROJECT_ID}/jobs/artifacts/master/download?job=pages\" --header \"Authorization: Bearer ${CI_DEPLOY_TOKEN}\" || true"
- (unzip report.zip) || true
- cd ../
- (cp -r backup/public/history/ allure-results/history) || true
public class PageInitiator {
public static <T extends BasePage> T getPage(Class<T> tClass) {
Injector pageInjector = (Injector) Reporter.getCurrentTestResult()
.getAttribute(Constants.PAGE_INJECTOR);
T page = pageInjector.getInstance(tClass);
return (T) page.init(page);
}
public static <T extends BaseComponent> T getComponent(Class<T> tClass) {
@Guice(StaleHandlerModule.class)
public class LoginTest extends BaseTest {
@Inject
User userProvider;
@Test
public void userLogin() {
LoginPage loginPage = getPage(LoginPage.class);
User user = userProvider.init();
public class LoginPage extends BasePage<LoginPage> {
@FindBy(name = "username")
private WebElement username;
@FindBy(name = "password")
private WebElement password;
@FindBy(css = "input[name ='submit']")
private WebElement loginBtn;
public abstract class BasePage<T> {
@Inject
WebDriver webDriver;
@Inject
WebDriverWait webDriverWait;
@StaleHandler
public void click(WebElement element) {