John Cowen cfa4bc264e UI: Add ember steps:list command for listing available steps (#5255)
* ui: Add ember steps:list command for listing available steps

1. Adds `command` addon to house the new command
2. Start to organize out the steps themselves, bring a bit more order to
things ready to dedupe and cleanup
2019-05-01 18:22:08 +00:00

20 lines
655 B
JavaScript

export default function(scenario, pages, set) {
scenario
.when('I visit the $name page', function(name) {
return set(pages[name]).visit();
})
.when('I visit the $name page for the "$id" $model', function(name, id, model) {
return set(pages[name]).visit({
[model]: id,
});
})
.when(
['I visit the $name page for yaml\n$yaml', 'I visit the $name page for json\n$json'],
function(name, data) {
// TODO: Consider putting an assertion here for testing the current url
// do I absolutely definitely need that all the time?
return set(pages[name]).visit(data);
}
);
}