2019-05-01 18:09:29 +00:00
|
|
|
export default function(scenario, find, click) {
|
2019-02-21 13:05:05 +00:00
|
|
|
scenario
|
|
|
|
.when('I click "$selector"', function(selector) {
|
|
|
|
return click(selector);
|
|
|
|
})
|
|
|
|
// TODO: Probably nicer to think of better vocab than having the 'without " rule'
|
2020-11-11 16:59:15 +00:00
|
|
|
.when(
|
|
|
|
[
|
|
|
|
'I click (?!")$property(?!")',
|
|
|
|
'I click $property on the $component',
|
|
|
|
'I click $property on the $component component',
|
|
|
|
],
|
|
|
|
function(property, component, next) {
|
2020-12-14 15:28:35 +00:00
|
|
|
if (typeof component === 'string') {
|
|
|
|
property = `${component}.${property}`;
|
2019-05-01 18:09:29 +00:00
|
|
|
}
|
2020-12-14 15:28:35 +00:00
|
|
|
return find(property)();
|
2019-02-21 13:05:05 +00:00
|
|
|
}
|
2020-11-11 16:59:15 +00:00
|
|
|
);
|
2019-02-21 13:05:05 +00:00
|
|
|
}
|