-
-
Notifications
You must be signed in to change notification settings - Fork 154
/
ExampleIT.kt
66 lines (56 loc) · 2.03 KB
/
ExampleIT.kt
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package tests.browser
import config.UiTest
import config.annotations.Browser
import config.annotations.Screenshot
import config.driver.Breakpoint
import config.driver.Browsers
import io.qameta.allure.Description
import org.fluentlenium.assertj.FluentLeniumAssertions.assertThat
import org.fluentlenium.core.annotation.Page
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.condition.DisabledOnJre
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable
import org.junit.jupiter.api.condition.EnabledIfSystemProperty
import org.junit.jupiter.api.condition.EnabledOnOs
import org.junit.jupiter.api.condition.JRE.JAVA_8
import org.junit.jupiter.api.condition.JRE.JAVA_9
import org.junit.jupiter.api.condition.OS.LINUX
import org.junit.jupiter.api.condition.OS.WINDOWS
import tests.browser.pageobjects.StartPage
@Browser(dimension = Breakpoint.XLARGE, use = Browsers.CHROME_HEADLESS)
@Screenshot
class ExampleIT : UiTest() {
@Page
lateinit var page: StartPage
@Test
fun `an example test using page object pattern`() {
goTo(page)
assertThat(page.searchField).isDisplayed
}
@Test
@Description("this is a custom description that will be visible in the detailed test report")
fun `an example test NOT using page object pattern`() {
goTo("https://github.com")
assertThat(el("input[name=q]")).isDisplayed
}
@Test
@EnabledOnOs(LINUX, WINDOWS)
fun `will be skipped on all platforms beside LINUX & WINDOWS`() {
// do something here
}
@Test
@DisabledOnJre(JAVA_8, JAVA_9)
fun `will be skipped if tests are running with specified JRE`() {
// do something here
}
@Test
@EnabledIfSystemProperty(named = "os.arch", matches = ".*64.*")
fun `will only run if system properties matches - otherwise skipped`() {
// do something here
}
@Test
@EnabledIfEnvironmentVariable(named = "ENV", matches = "ci")
fun `will only run if environment variable matches - otherwise skipped`() {
// do something here
}
}