Skip to content

Instantly share code, notes, and snippets.

Bilal Haidar bhaidar

  • Remote
Block or report user

Report or block bhaidar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View chrome.driver
result summary {
all results=
TestResultContainer{
testResults=Existing test [ steps: 3, test name: Test Wikipedia Software Testing page, matches: 3, mismatches:0, missing: 0] , URL: https://eyes.applitools.com/app/batches/00000251833469890940/00000251833469890768?accountId=D9XKRBVuYUmBxXpWWWsB3g~~
exception = null}
passed=1
unresolved=0
failed=0
exceptions=0
mismatches=0
View before.chrome-driver
@Before
public void beforeEach() {
// Initialize the Runner for your test.
runner = new ClassicRunner();
// Initialize the eyes SDK
eyes = new Eyes(runner);
// Raise an error if no API Key has been found.
if(isNullOrEmpty(System.getenv("APPLITOOLS_API_KEY"))) {
View test.run.results
result summary {
all results=
TestResultContainer{
testResults=New test [ steps: 3, test name: Test Wikipedia Software Testing page, matches: 0, mismatches:0, missing: 0] , URL: https://eyes.applitools.com/app/batches/00000251833470642880/00000251833470642552?accountId=D9XKRBVuYUmBxXpWWWsB3g~~
exception = null}
passed=1
unresolved=0
failed=0
exceptions=0
mismatches=0
View after
@After
public void afterEach() {
// Close the browser.
if (driver != null) {
driver.quit();
}
// If the test was aborted before eyes.close was called, ends the test as
// aborted.
eyes.abortIfNotClosed();
View test.eyes
@Test
public void basicTest() {
// Set App name and Test name
eyes.open(driver, "Testing with Selenium/Edge/Applitools", "Test Wikipedia Software Testing page");
// Navigate the browser to the Wikipedia home page
driver.get("https://www.wikipedia.org/");
// Visual checkpoint #1 - Check the Wikipedia Home page
eyes.checkWindow("Home page");
View eyes.instance
@Before
public void beforeEach() {
// Initialize the Runner for your test.
runner = new ClassicRunner();
// Initialize the eyes SDK
eyes = new Eyes(runner);
// Raise an error if no API Key has been found.
if(isNullOrEmpty(System.getenv("APPLITOOLS_API_KEY"))) {
View before-class-batch
@BeforeClass
public static void setup() {
batch = new BatchInfo("Testing with Selenium/Edge/Applitools");
// Set the path for msedgedriver
System.setProperty("webdriver.edge.driver", "/usr/local/bin/msedgedriver");
}
View test
@Test
public void basicTest() {
// Navigate the browser to the Wikipedia home page
driver.get("https://www.wikipedia.org/");
// Locate the English hyerlink and click it
driver.findElement(By.id("js-link-box-en")).click();
// Verify "Welcome to Wikipedia" text is available
String text = driver.findElement(By.id("mp-topbanner")).getText().toLowerCase();
View before-each
private WebDriver driver;
@Before
public void beforeEach() {
// Use ChromeOptions to set the binary to the path where Edge Chromium is installed
ChromeOptions options = new ChromeOptions();
options.setBinary("/Applications/Microsoft Edge Beta.app/Contents/MacOS/Microsoft Edge Beta");
// Then merge with EdgeOptions()
EdgeOptions edgeOptions = new EdgeOptions().merge(options);
@bhaidar
bhaidar / basic-demo.java
Last active Sep 18, 2019
BasicDemo.java
View basic-demo.java
package dev.bhaidar.testing;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
You can’t perform that action at this time.