-
Notifications
You must be signed in to change notification settings - Fork 63
/
PersonCRUDTests.groovy
47 lines (37 loc) · 1.12 KB
/
PersonCRUDTests.groovy
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
import geb.junit4.GebReportingTest
import pages.*
import org.junit.Test
class PersonCRUDTests extends GebReportingTest {
@Test
void doSomeCrud() {
to ListPage
assert personRows.size() == 0
newPersonButton.click()
assert at(CreatePage)
$("#visible").click()
firstName = "Luke"
lastName = "Daley"
createButton.click()
assert at(ShowPage)
assert visible == true
assert firstName == "Luke"
assert lastName == "Daley"
editButton.click()
assert at(EditPage)
$("#visible").click()
updateButton.click()
assert at(ShowPage)
to ListPage
assert personRows.size() == 1
def row = personRow(0)
assert row.firstName == "Luke"
assert row.lastName == "Daley"
row.showLink.click()
assert at(ShowPage)
def deletedId = id
withConfirm { deleteButton.click() }
assert at(ListPage)
assert message == "Person $deletedId deleted"
assert personRows.size() == 0
}
}