Message from JavaScript discussions

August 2018

— Https://www.npmjs.com/package/webdriverio-cucumber-js

— 

But I need to define a step that goes like this:
When a "<time>" reminder is set
Examples:
|time |
|15 Minutes |
|1 hour |
|3 hours |
|Tomorrow |

— The step defintion is:

this.When(/^a "([^"]*)" reminder is set$/, function (time) {
cardsHelper.findRemindMeButton();
client.waitForExist(cardPO.REMINDER);
client.click(cardPO.REMINDER);
client.click(cardPO.REMINDER_OPTIONS.);
client.click(cardPO.REMINDER);

Message permanent page

— The thing is, REMINDER OPTIONS should be the same as “<time>”

— The question would be, how to loop through it

— Ah no, reminder.options is given by this array:

REMINDER_OPTIONS: {
FIFTEEN_MINUTES:'~15 minutes',
ONE_HOUR:'~1 hour',
THREE_HOURS:'~3 hours',
TOMORROW:'~tomorrow',
REMIND_ME: '~Remind Me',
CANCEL: '~Cancel'
}

Message permanent page

— How would I loop through this in the step definition?

— For (const time of REMINDER_OPTIONS) {

— Is this what you mean?

— Maybe, i can try

— Nope not working

— Thanks tho