Skip to content

Instantly share code, notes, and snippets.

@ryanhanks-wf
Created February 26, 2015 16:50
Show Gist options
  • Select an option

  • Save ryanhanks-wf/5845bc93e27064489e34 to your computer and use it in GitHub Desktop.

Select an option

Save ryanhanks-wf/5845bc93e27064489e34 to your computer and use it in GitHub Desktop.
gwt syntax
library w_webdriver_utils.gwt_syntax;
import 'functional_test_helper.dart';
List<Function> _scenarioSteps;
String _scenarioDescription;
step(String description, void body()) {
_scenarioDescription += "\n$description";
_scenarioSteps.add(body);
}
given(String description, void body()) {
step("Given $description", body);
}
when(String description, void body()) {
step("Given $description", body);
}
then(String description, void body()) {
step("Given $description", body);
}
and(String description, void body()) {
step("Given $description", body);
}
scenario(String description, void body(WebDriver)){
_scenarioDescription = '';
_scenarioSteps = [];
body(_driver);
unittest.test(_scenarioDescription, () async {
_scenarioSteps.forEach((void scenarioStep()) async {
await scenarioStep();
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment