Skip to content

Instantly share code, notes, and snippets.

@SarahElson
SarahElson / singleLoginButScript.py
Created September 6, 2022 16:40
Playwright Python Tutorial: Getting Started With Python End To End Testing
from playwright.sync_api import sync_playwright
import sys
sys.path.append(sys.path[0] + "/..")
from elementSelectors.loginAndBuySelectors import elementSelector
from testCapabilities.testCaps import testCapabilities
select = elementSelector()
@SarahElson
SarahElson / singleLoginBuyRun.py
Created September 6, 2022 16:41
Playwright Python Tutorial: Getting Started With Python End To End Testing
import sys
sys.path.append(sys.path[0] + "/..")
from testScripts.singleLoginBuyScript import LoginAndBuy
from playwright.sync_api import sync_playwright
with sync_playwright() as playwright:
try:
playwright = LoginAndBuy(playwright)
@SarahElson
SarahElson / DriverManager class.java
Last active September 9, 2022 16:14
How To Identify Locators In Appium? [With Examples]
import static io.appium.java_client.remote.AndroidMobileCapabilityType.AVD;
import static io.appium.java_client.remote.AutomationName.ANDROID_UIAUTOMATOR2;
import static io.appium.java_client.remote.AutomationName.ESPRESSO;
import static io.appium.java_client.remote.AutomationName.IOS_XCUI_TEST;
import static io.appium.java_client.remote.MobileCapabilityType.APP;
import static io.appium.java_client.remote.MobileCapabilityType.AUTOMATION_NAME;
import static io.appium.java_client.remote.MobileCapabilityType.DEVICE_NAME;
import static io.appium.java_client.remote.MobileCapabilityType.FULL_RESET;
import static io.appium.java_client.remote.MobileCapabilityType.PLATFORM_VERSION;
import static java.lang.System.getenv;
@SarahElson
SarahElson / adapters attribute.java
Created September 9, 2022 16:25
How To Identify Locators In Appium? [With Examples]
{
contentDescription=Access'ibility, title=Access'ibility, intent=Intent { cmp=io.appium.android.apis/.ApiDemos (has extras)
}
},
{
contentDescription=Accessibility, title=Accessibility, intent=Intent { cmp=io.appium.android.apis/.ApiDemos (has extras)
}
},
{
contentDescription=Animation, title=Animation, intent=Intent { cmp=io.appium.android.apis/.ApiDemos (has extras)
@SarahElson
SarahElson / BaseTest.java
Created September 9, 2022 16:28
How To Identify Locators In Appium? [With Examples]
import static java.lang.System.currentTimeMillis;
import static java.text.MessageFormat.format;
import com.github.wasiqb.appium.core.DriverManager;
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.MobileElement;
import org.openqa.selenium.By;
import org.testng.annotations.AfterClass;
public class BaseTest {
@SarahElson
SarahElson / LocatorsAndroidEspressoTest.java
Created September 9, 2022 16:30
How To Identify Locators In Appium? [With Examples]
import static org.testng.Assert.assertTrue;
import com.github.wasiqb.appium.pages.AndroidLocators;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
public class LocatorsAndroidEspressoTest extends BaseTest {
private AndroidLocators page;
@BeforeClass (alwaysRun = true)
@SarahElson
SarahElson / LocatorsAndroidUiAutomatorTest.java
Created September 9, 2022 16:32
How To Identify Locators In Appium? [With Examples]
import static org.testng.Assert.assertTrue;
import java.net.MalformedURLException;
import com.github.wasiqb.appium.pages.AndroidLocators;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
public class LocatorsAndroidUiAutomatorTest extends BaseTest {
private AndroidLocators page;
@SarahElson
SarahElson / LocatorsIOSTest.java
Created September 9, 2022 16:33
How To Identify Locators In Appium? [With Examples]
import static org.testng.Assert.assertTrue;
import java.net.MalformedURLException;
import com.github.wasiqb.appium.pages.IOSLocators;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
public class LocatorsIOSTest extends BaseTest {
private IOSLocators page;
@SarahElson
SarahElson / setUp.py
Created September 15, 2022 08:33
How To Drag And Drop In Selenium With Python?
def setUp(self):
username = "your_lambdatest_username"
# Register on lambdatest, if you’ve not already. It hardly takes 30 seconds to 2 minutes to get started.
accessToken = "your_lambdatest_accessToken"
# You can find access token post registration on your LambdaTest profile page.
gridUrl = "hub.lambdatest.com/wd/hub"
desired_cap = {
'platform' : "win10",
'browserName' : "chrome",
'version' : "67.0",
@SarahElson
SarahElson / Jenkinsfile
Last active September 16, 2022 07:23
How To Run Cypress Tests In Jenkins Pipeline [Cypress Jenkins Tutorial]
pipeline {
agent any
tools {nodejs "Node12"}
environment {
CHROME_BIN = '/bin/google-chrome'
}