@@ -36,6 +36,14 @@ import (
36
36
func TestLifecycleWaitForLoadState (t * testing.T ) {
37
37
t .Parallel ()
38
38
39
+ // Test description
40
+ //
41
+ // 1. goto /home and wait for the specified lifecycle event.
42
+ // 2. use WaitForLoadState with the same specified lifecycle event.
43
+ //
44
+ // Success criteria: We want to ensure that the specified event is persisted in
45
+ // memory, and we don't block on WaitForLoadState.
46
+
39
47
tests := []struct {
40
48
name string
41
49
pingSlowness time.Duration
@@ -46,13 +54,6 @@ func TestLifecycleWaitForLoadState(t *testing.T) {
46
54
assertFunc func (p api.Page )
47
55
}{
48
56
{
49
- // Test description
50
- //
51
- // 1. goto /home and wait for the load lifecycle event.
52
- // 2. use WaitForLoadState with load.
53
- //
54
- // Success criteria: We want to ensure that the load event is persisted in
55
- // memory, and we don't block on WaitForLoadState.
56
57
name : "load" ,
57
58
pingSlowness : time .Millisecond * 100 ,
58
59
pingJSSlow : false ,
@@ -65,13 +66,6 @@ func TestLifecycleWaitForLoadState(t *testing.T) {
65
66
},
66
67
},
67
68
{
68
- // Test description
69
- //
70
- // 1. goto /home and wait for the domcontentloaded lifecycle event.
71
- // 2. use WaitForLoadState with domcontentloaded.
72
- //
73
- // Success criteria: We want to ensure that the domcontentloaded event is
74
- // persisted in memory, and we don't block on WaitForLoadState.
75
69
name : "domcontentloaded" ,
76
70
pingSlowness : time .Millisecond * 100 ,
77
71
pingJSSlow : true ,
@@ -84,13 +78,6 @@ func TestLifecycleWaitForLoadState(t *testing.T) {
84
78
},
85
79
},
86
80
{
87
- // Test description
88
- //
89
- // 1. goto /home and wait for the networkidle lifecycle event.
90
- // 2. use WaitForLoadState with networkidle.
91
- //
92
- // Success criteria: We want to ensure that the networkidle event is
93
- // persisted in memory, and we don't block on WaitForLoadState.
94
81
name : "networkidle" ,
95
82
pingSlowness : 0 ,
96
83
pingJSSlow : false ,
@@ -110,7 +97,7 @@ func TestLifecycleWaitForLoadState(t *testing.T) {
110
97
//
111
98
// Success criteria: We want to quickly move to calling WaitForLoadState
112
99
// so that we wait until networkidle is received from
113
- // the browser. So not relying on the persisted state in memory.
100
+ // the browser -- not relying on the persisted state in memory.
114
101
name : "domcontentloaded then networkidle" ,
115
102
pingSlowness : time .Millisecond * 100 ,
116
103
pingJSSlow : false ,
@@ -160,6 +147,14 @@ func TestLifecycleWaitForLoadState(t *testing.T) {
160
147
func TestLifecycleReload (t * testing.T ) {
161
148
t .Parallel ()
162
149
150
+ // Test description
151
+ //
152
+ // 1. goto /home and wait for the specified lifecycle event.
153
+ // 2. reload the page and wait for the specified lifecycle event.
154
+ //
155
+ // Success criteria: The resulting page after reload is the same as
156
+ // the initial navigation with goto.
157
+
163
158
tests := []struct {
164
159
name string
165
160
pingSlowness time.Duration
@@ -169,13 +164,6 @@ func TestLifecycleReload(t *testing.T) {
169
164
pingJSTextAssert func (result string )
170
165
}{
171
166
{
172
- // Test description
173
- //
174
- // 1. goto /home and wait for the load lifecycle event.
175
- // 2. reload the page and wait with for the load lifecycle event.
176
- //
177
- // Success criteria: The resulting page after reload is the same as
178
- // the initial navigation with goto.
179
167
name : "load" ,
180
168
pingSlowness : time .Millisecond * 100 ,
181
169
pingJSSlow : false ,
@@ -188,13 +176,6 @@ func TestLifecycleReload(t *testing.T) {
188
176
},
189
177
},
190
178
{
191
- // Test description
192
- //
193
- // 1. goto /home and wait for the domcontentloaded lifecycle event.
194
- // 2. reload the page and wait with for the domcontentloaded lifecycle event.
195
- //
196
- // Success criteria: The resulting page after reload is the same as
197
- // the initial navigation with goto.
198
179
name : "domcontentloaded" ,
199
180
pingSlowness : time .Millisecond * 100 ,
200
181
pingJSSlow : true ,
@@ -207,13 +188,6 @@ func TestLifecycleReload(t *testing.T) {
207
188
},
208
189
},
209
190
{
210
- // Test description
211
- //
212
- // 1. goto /home and wait for the networkidle lifecycle event.
213
- // 2. reload the page and wait with for the networkidle lifecycle event.
214
- //
215
- // Success criteria: The resulting page after reload is the same as
216
- // the initial navigation with goto.
217
191
name : "networkidle" ,
218
192
pingSlowness : 0 ,
219
193
pingJSSlow : false ,
0 commit comments