@@ -31,6 +31,12 @@ import 'fixtures/utilities.dart';
31
31
// See go/extension-identification.
32
32
33
33
final context = TestContext ();
34
+
35
+ // TODO(elliette): Instead of setting a time to load, check for element on page.
36
+ // See: https://github.com/dart-lang/webdev/issues/1512
37
+ // Time for Dart DevTools to load, in seconds.
38
+ final devToolsLoadTime = const Duration (seconds: 4 );
39
+
34
40
void main () async {
35
41
for (var useSse in [true , false ]) {
36
42
group (useSse ? 'SSE' : 'WebSockets' , () {
@@ -42,7 +48,7 @@ void main() async {
42
48
'expression' : 'fakeClick()' ,
43
49
});
44
50
// Wait for DevTools to actually open.
45
- await Future .delayed (const Duration (seconds : 2 ) );
51
+ await Future .delayed (devToolsLoadTime );
46
52
});
47
53
48
54
tearDown (() async {
@@ -70,7 +76,7 @@ void main() async {
70
76
await context.extensionConnection.sendCommand ('Runtime.evaluate' , {
71
77
'expression' : 'fakeClick()' ,
72
78
});
73
- await Future .delayed (const Duration (seconds : 4 ) );
79
+ await Future .delayed (devToolsLoadTime );
74
80
var windows = await context.webDriver.windows.toList ();
75
81
await context.webDriver.driver.switchTo.window (windows.last);
76
82
expect (await context.webDriver.title, 'Dart DevTools' );
@@ -122,7 +128,7 @@ void main() async {
122
128
'expression' : 'fakeClick()' ,
123
129
});
124
130
// Wait for DevTools to actually open.
125
- await Future .delayed (const Duration (seconds : 2 ) );
131
+ await Future .delayed (devToolsLoadTime );
126
132
});
127
133
128
134
tearDown (() async {
@@ -148,7 +154,7 @@ void main() async {
148
154
await context.extensionConnection.sendCommand ('Runtime.evaluate' , {
149
155
'expression' : 'fakeClick()' ,
150
156
});
151
- await Future .delayed (const Duration (seconds : 4 ) );
157
+ await Future .delayed (devToolsLoadTime );
152
158
var windows = await context.webDriver.windows.toList ();
153
159
await context.webDriver.driver.switchTo.window (windows.last);
154
160
expect (await context.webDriver.title, 'Dart DevTools' );
0 commit comments