vendredi 6 octobre 2017

Testcafe .presskey for multiple presses

I'm trying to write TestCafe Javascript to test a webpage using the keyboard as sole navigation (i.e. 'tabbing through the options').

TestCafe runs these tests, but they run extremely fast (5 seconds max), and nothing happens on the screen. So I'm wondering if it's even actually working.

On top of that, I'm trying to find a way to DRY out my code. From what I read in the docs, each time I want a key pressed, I need to call .pressKey('tab'). If I need to hit 'tab' 5 times in a row, I have 5 lines of that in my code. Is there any way to eliminate this unnecessary repetition?

Thanks!

Aucun commentaire:

Enregistrer un commentaire