chore: rename modules/examples to modules/playground
The directory contains code authored in a style that makes it transpilable to dart. As such, these are not idiomatic examples of Angular 2 usage. The main purpose of this directory is to enable experimentation with Angular within the angular/angular repository. Closes #4342 Closes #4639
This commit is contained in:

committed by
Flavio Corpa Ríos

parent
c3ab20cc87
commit
e4e74ae65c
@ -0,0 +1,55 @@
|
||||
import 'dart:async';
|
||||
import 'dart:io' show Platform;
|
||||
import 'package:guinness/guinness.dart';
|
||||
import 'package:benchpress/benchpress.dart';
|
||||
import 'package:webdriver/webdriver.dart'
|
||||
show WebDriver, Capabilities, LogType, LogLevel, By;
|
||||
|
||||
main() {
|
||||
describe('benchpress', () {
|
||||
WebDriver driver;
|
||||
Runner runner;
|
||||
|
||||
beforeEach(() async {
|
||||
driver = await createTestDriver();
|
||||
await driver
|
||||
.get('http://localhost:8002/playground/src/benchpress/index.html');
|
||||
|
||||
var bindings = [
|
||||
bind(WebDriverAdapter)
|
||||
.toFactory(() => new AsyncWebDriverAdapter(driver), [])
|
||||
];
|
||||
runner = new Runner(bindings);
|
||||
});
|
||||
|
||||
afterEach(() async {
|
||||
await driver.close();
|
||||
});
|
||||
|
||||
it('should work', () {
|
||||
return runner.sample(id: 'benchpress smoke test', execute: () async {
|
||||
var button = await driver.findElement(const By.tagName('button'));
|
||||
await button.click();
|
||||
var logText = await (await driver.findElement(const By.id('log'))).text;
|
||||
expect(logText, 'hi');
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Future<WebDriver> createTestDriver() {
|
||||
Map env = Platform.environment;
|
||||
return WebDriver.createDriver(desiredCapabilities: {
|
||||
'name': 'Dartium',
|
||||
'browserName': 'chrome',
|
||||
'chromeOptions': {
|
||||
'binary': env['DARTIUM_BIN'],
|
||||
'args': ['--js-flags=--expose-gc'],
|
||||
'perfLoggingPrefs': {
|
||||
'traceCategories':
|
||||
'v8,blink.console,disabled-by-default-devtools.timeline'
|
||||
},
|
||||
},
|
||||
'loggingPrefs': {'performance': 'ALL', 'browser': 'ALL',}
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user