@@ -36,43 +36,45 @@ class AdminFunctionalSpec extends AbstractSecuritySpec {
3636 // admin has admin on all
3737
3838 void setup () {
39- login ' admin'
39+ login( ' admin' )
4040 }
4141
4242 void ' check tags' () {
4343 when :
44- go ' tagLibTest/test'
44+ go( ' tagLibTest/test' )
4545
4646 then :
47- assertContentContains ' test 1 true 1'
48- assertContentContains ' test 2 true 1'
49- assertContentContains ' test 3 true 1'
50- assertContentContains ' test 4 true 1'
51- assertContentContains ' test 5 true 1'
52- assertContentContains ' test 6 true 1'
53-
54- assertContentContains ' test 1 true 13'
55- assertContentContains ' test 2 true 13'
56- assertContentContains ' test 3 true 13'
57- assertContentContains ' test 4 true 13'
58- assertContentContains ' test 5 true 13'
59- assertContentContains ' test 6 true 13'
60-
61- assertContentContains ' test 1 true 80'
62- assertContentContains ' test 2 true 80'
63- assertContentContains ' test 3 true 80'
64- assertContentContains ' test 4 true 80'
65- assertContentContains ' test 5 true 80'
66- assertContentContains ' test 6 true 80'
47+ pageSource . contains( ' test 1 true 1' )
48+ pageSource . contains( ' test 2 true 1' )
49+ pageSource . contains( ' test 3 true 1' )
50+ pageSource . contains( ' test 4 true 1' )
51+ pageSource . contains( ' test 5 true 1' )
52+ pageSource . contains( ' test 6 true 1' )
53+
54+ pageSource . contains( ' test 1 true 13' )
55+ pageSource . contains( ' test 2 true 13' )
56+ pageSource . contains( ' test 3 true 13' )
57+ pageSource . contains( ' test 4 true 13' )
58+ pageSource . contains( ' test 5 true 13' )
59+ pageSource . contains( ' test 6 true 13' )
60+
61+ pageSource . contains( ' test 1 true 80' )
62+ pageSource . contains( ' test 2 true 80' )
63+ pageSource . contains( ' test 3 true 80' )
64+ pageSource . contains( ' test 4 true 80' )
65+ pageSource . contains( ' test 5 true 80' )
66+ pageSource . contains( ' test 6 true 80' )
6767 }
6868
6969 void ' view all' () {
7070 when :
71- go " report/show?number=$i "
72- waitFor { title == ' Show Report' }
71+ go(" report/show?number=$i " )
72+ waitFor(10 , 1 ) { // 10 seconds, as has shown timeouts in CI
73+ title == ' Show Report'
74+ }
7375
7476 then :
75- assertContentContains " report$i "
77+ pageSource . contains( " report$i " )
7678
7779 where :
7880 i << (1 .. 100 )
@@ -81,65 +83,65 @@ class AdminFunctionalSpec extends AbstractSecuritySpec {
8183 void ' edit report 15' () {
8284
8385 when :
84- go ' report/edit?number=15'
86+ go( ' report/edit?number=15' )
8587
8688 then :
87- at EditReportPage
89+ at( EditReportPage )
8890 $(' form' ). name == ' report15'
8991
9092 when :
9193 name = ' report15_new'
9294 updateButton. click()
9395
9496 then :
95- at ShowReportPage
96- assertContentContains ' report15_new'
97+ at( ShowReportPage )
98+ pageSource . contains( ' report15_new' )
9799 }
98100
99101 void ' delete report 15' () {
100102 when :
101- go ' report/delete?number=15'
103+ go(' report/delete?number=15' )
104+ def listReportPage = at(ListReportPage )
102105
103106 then :
104- at ListReportPage
105107 message == ' Report 15 deleted'
106- reportRows. size() == 99
108+ listReportPage . reportRows. size() == 99
107109 }
108110
109111 void ' grant edit 16' () {
110112 when :
111- go ' report/grant?number=16'
113+ go(' report/grant?number=16' )
114+ def reportGrantPage = at(ReportGrantPage )
112115
113116 then :
114- at ReportGrantPage
115- assertContentContains ' Grant permission for report16'
117+ pageSource. contains(' Grant permission for report16' )
116118
117119 when :
118120 recipient = ' user2'
119121 permission = BasePermission . READ . mask. toString()
120- grantButton. click()
122+ reportGrantPage. grantButton. click()
123+ at(ShowReportPage )
121124
122125 then :
123- at ShowReportPage
124- assertContentContains " Permission $BasePermission . READ . mask granted on Report 16 to user2"
126+ pageSource. contains(" Permission $BasePermission . READ . mask granted on Report 16 to user2" )
125127
126128 // login as user2 and verify the grant
127129 when :
128- go ' logout'
130+ go( ' logout' )
129131
130132 then :
131- at IndexPage
133+ at( IndexPage )
132134
133135 when :
134- login ' user2'
136+ login( ' user2' )
135137
136138 then :
137- at IndexPage
139+ at( IndexPage )
138140
139141 when :
140- go ' report/show?number=16'
142+ go( ' report/show?number=16' )
141143
142144 then :
143- assertContentContains ' report16'
145+ pageSource . contains( ' report16' )
144146 }
145147}
0 commit comments