Message from JavaScript discussions

August 2018

— I never heard of this software before, I will Google and find out what you would need

— 

Ahhh, it is like puppeteer, and touches DOM, okay that is perfect because I live in the DOM and know puppeteer

— Docs will reveal the methods you need

— Actually im reading a tutorial atm

— 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 |

Message permanent page

— 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) {