Skip to content

Commit d422eec

Browse files
committed
Look for actual stdout message indicating ChromeDriver started
1 parent 2e54440 commit d422eec

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/chromedriver_utils.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ Future<void> startChromeDriver() async {
1818
}
1919
});
2020

21-
// On windows this takes a while to boot up, wait for the first line
22-
// of stdout as a signal that it is ready.
21+
// On windows this takes a while to boot up, wait for a message on stdout
22+
// indicating ChromeDriver started successfully.
2323
final stdOutLines = chromeDriver.stdout
2424
.transform(utf8.decoder)
2525
.transform(LineSplitter())
@@ -33,7 +33,8 @@ Future<void> startChromeDriver() async {
3333
stdOutLines.listen((line) => print('ChromeDriver stdout: $line'));
3434
stdErrLines.listen((line) => print('ChromeDriver stderr: $line'));
3535

36-
await stdOutLines.first;
36+
await stdOutLines.firstWhere(
37+
(line) => line.contains('ChromeDriver was started successfully'));
3738
} catch (e) {
3839
throw StateError(
3940
'Could not start ChromeDriver. Is it installed?\nError: $e');

0 commit comments

Comments
 (0)