Skip to content

Instantly share code, notes, and snippets.

@alexd1971
Created December 13, 2017 12:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexd1971/622615aeefb23fbb44db0923c9c27635 to your computer and use it in GitHub Desktop.
Save alexd1971/622615aeefb23fbb44db0923c9c27635 to your computer and use it in GitHub Desktop.
Webdriver tests failing with dartdevc
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<script async type="application/dart" src="main.dart"></script>
<script async type="text/javascript" src="packages/browser/dart.js"></script>
<title>Hello Dart</title>
</head>
<body>
<h1></h1>
</body>
</html>
import 'dart:html';
void main() {
final Element h1 = querySelector('h1');
h1.text = 'Hello Dart';
}
import 'package:test/test.dart';
import 'dart:io';
import 'package:webdriver/io.dart';
void main() {
Process webDriverProcess;
WebDriver webDriver;
setUpAll(() async {
webDriverProcess = await Process.start('chromedriver', []);
webDriver = await createDriver(
uri: Uri.parse('http://127.0.0.1:9515'),
desired: Capabilities.chrome
);
});
tearDownAll(() async {
await webDriver.quit();
webDriverProcess.kill();
});
test('prints hello dart', () async {
await webDriver.get('http://localhost:8088');
final WebElement h1 = await webDriver.findElement(const By.tagName('h1'));
expect(await h1.text, 'Hello Dart');
});
}
name: hello_dart
version: 0.0.1
description: Hello Dart for web browser
dependencies:
dev_dependencies:
browser: ^0.10.0
test: ^0.12.29
webdriver: ^1.2.3
web:
compiler:
debug: dartdevc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment