| library webdriver_test_util; |
| |
| import 'dart:io'; |
| import 'package:path/path.dart' as path; |
| import 'package:unittest/unittest.dart'; |
| import 'package:webdriver/webdriver.dart'; |
| |
| final Matcher isWebDriverError = new isInstanceOf<WebDriverError>(); |
| final Matcher isWebElement = new isInstanceOf<WebElement>(); |
| final Matcher isSize = new isInstanceOf<Size>(); |
| final Matcher isPoint = new isInstanceOf<Point>(); |
| |
| String get testPagePath { |
| if (_testPagePath == null) { |
| _testPagePath = _getTestPagePath(); |
| } |
| return _testPagePath; |
| } |
| |
| String _getTestPagePath() { |
| var testPagePath = path.join(path.current, 'test', 'test_page.html'); |
| testPagePath = path.absolute(testPagePath); |
| if (!FileSystemEntity.isFileSync(testPagePath)) { |
| throw new Exception('Could not find the test file at "$testPagePath".' |
| ' Make sure you are running tests from the root of the project.'); |
| } |
| return path.toUri(testPagePath).toString(); |
| } |
| |
| String _testPagePath; |