Domain.BaseTest.java Source code

Java tutorial

Introduction

Here is the source code for Domain.BaseTest.java

Source

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Domain;

import com.google.common.base.Predicate;
import org.junit.Before;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.WebDriverWait;

/**
 *
 * @author Zhang Tong
 */
public class BaseTest {
    public WebDriver driver;
    private WebDriverWait wait;

    @Before
    public void setup() {
        System.setProperty("webdriver.gecko.driver", "libs\\geckodriver.exe");
        driver = new FirefoxDriver();
        wait = new WebDriverWait(driver, 30);
    }

    public void waitUntil(Predicate<WebDriver> predicate) {
        wait.until(predicate);
    }
}