add tests

This commit is contained in:
romanov73 2018-02-16 14:18:07 +04:00
parent 178e4b87a9
commit 7a08e1ec83
3 changed files with 46 additions and 1 deletions

View File

@ -18,6 +18,11 @@
<artifactId>selenium-java</artifactId>
<version>3.6.0</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.1.0-RC1</version>
</dependency>
</dependencies>
<build>
<plugins>

View File

@ -11,10 +11,10 @@ import java.util.concurrent.TimeUnit;
public class Main {
private final static String APP_URL = "http://ya.ru";
private final static String DRIVER_TYPE = "webdriver.chrome.driver";
private final static String DRIVER_LOCATION = "drivers/%s";
private final static String WINDOWS_CHROME_DRIVER = "chromedriver.exe";
private final static String LINUX_CHROME_DRIVER = "chromedriver";
private final static String DRIVER_TYPE = "webdriver.chrome.driver";
public static void main(String[] args) {

View File

@ -0,0 +1,40 @@
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import ru.ulstu.tis.Main;
import java.util.concurrent.TimeUnit;
public class YandexSearch {
private final static String DRIVER_TYPE = "webdriver.chrome.driver";
private final static String DRIVER_LOCATION = "drivers/%s";
private final static String WINDOWS_CHROME_DRIVER = "chromedriver.exe";
private final static String LINUX_CHROME_DRIVER = "chromedriver";
private static WebDriver driver;
@BeforeAll
public static void setup() {
System.setProperty(DRIVER_TYPE, getDriverExecutable());
driver = new ChromeDriver();
driver.manage().timeouts().implicitlyWait(100, TimeUnit.SECONDS);
}
@Test
public void testGetFreeEmployeesNextUnits() {
}
@AfterAll
public static void quit() {
driver.quit();
}
private static String getDriverExecutable() {
return YandexSearch.class.getClassLoader().getResource(String.format(DRIVER_LOCATION, WINDOWS_CHROME_DRIVER)).getFile();
}
}