-
Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy pathContactsTest.java
More file actions
43 lines (37 loc) · 1.38 KB
/
ContactsTest.java
File metadata and controls
43 lines (37 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package com.pik.contact.gui.selenium.test;
import com.pik.contact.Application;
import com.pik.contact.gui.selenium.pageobjects.ContactsPage;
import com.pik.contact.gui.selenium.setup.SeleniumDriver;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.IntegrationTest;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import static com.pik.contact.gui.selenium.setup.SeleniumDriver.getDriver;
import static org.assertj.core.api.Assertions.assertThat;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = Application.class)
@WebAppConfiguration
@IntegrationTest("server.port:8090")
public class ContactsTest {
@Value("${local.server.port}")
int port;
@AfterClass
public static void tearDown() {
getDriver().close();
}
@Test
public void should_display_contact() throws Exception {
//given
ContactsPage contactsPage = new ContactsPage().open();
//when
contactsPage.find("John");
//then
assertThat(contactsPage.firstContactTitle()).isEqualTo("John");
}
}