1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package org.htmlunit.libraries;
16
17 import org.htmlunit.WebDriverTestCase;
18 import org.htmlunit.junit.BrowserRunner;
19 import org.htmlunit.junit.annotation.Alerts;
20 import org.junit.Before;
21 import org.junit.Test;
22 import org.junit.runner.RunWith;
23 import org.openqa.selenium.By;
24 import org.openqa.selenium.WebDriver;
25
26
27
28
29
30
31 @RunWith(BrowserRunner.class)
32 public class PolymerWebComponentsTest extends WebDriverTestCase {
33
34
35
36
37
38
39 @Test
40 @Alerts("Hello Unicorn :)")
41 public void hello() throws Exception {
42 final String url = URL_FIRST + "index.html";
43
44 final WebDriver driver = getWebDriver();
45 driver.get(url);
46
47 verify(() -> driver.findElement(By.tagName("body")).getText(), getExpectedAlerts()[0]);
48 }
49
50
51
52
53
54 @Before
55 public void setUp() throws Exception {
56 startWebServer("src/test/resources/libraries/polymer/0_6_1", null, null);
57 }
58 }