Revize 8bca0c14
Přidáno uživatelem Tomáš Šimandl před více než 6 roky(ů)
sources/src/test/java/cz/zcu/kiv/imiger/tests/frontend/SampleTest.java | ||
---|---|---|
1 |
package cz.zcu.kiv.imiger.tests.frontend; |
|
2 |
|
|
3 |
import org.junit.jupiter.api.AfterAll; |
|
4 |
import org.junit.jupiter.api.BeforeAll; |
|
5 |
import org.junit.jupiter.api.Test; |
|
6 |
import org.openqa.selenium.By; |
|
7 |
import org.openqa.selenium.WebDriver; |
|
8 |
import org.openqa.selenium.WebElement; |
|
9 |
import org.openqa.selenium.support.ui.ExpectedConditions; |
|
10 |
import org.openqa.selenium.support.ui.WebDriverWait; |
|
11 |
|
|
12 |
public class SampleTest { |
|
13 |
static WebDriver browser; |
|
14 |
|
|
15 |
@BeforeAll |
|
16 |
public static void initTest() { |
|
17 |
browser = SeleniumUtil.init(); |
|
18 |
} |
|
19 |
@Test |
|
20 |
public void Test(){ |
|
21 |
WebElement fileInput = browser.findElement(By.id("hidden_input")); |
|
22 |
fileInput.sendKeys(System.getProperty("user.dir") + "\\..\\test\\data\\aswi2017falsum.json" ); |
|
23 |
browser.findElement(By.className("load")).click(); |
|
24 |
|
|
25 |
WebDriverWait wait = new WebDriverWait(browser, 20); |
|
26 |
wait.until(ExpectedConditions.presenceOfElementLocated(By.className("vertices"))); |
|
27 |
|
|
28 |
System.out.println(browser.findElement(By.id("vertex1")).getAttribute("data-id")); |
|
29 |
|
|
30 |
//Assertions.assertTrue(header.getText().equals("Interactive Multimodal Graph Explorer")); |
|
31 |
} |
|
32 |
|
|
33 |
@AfterAll |
|
34 |
public static void finishTest() { |
|
35 |
SeleniumUtil.clear(); |
|
36 |
} |
|
37 |
|
|
38 |
} |
Také k dispozici: Unified diff
removed useless test - SampleTest