Dusk: can ->keys() simulate down arrow key?

Created on 6 Oct 2017  路  2Comments  路  Source: laravel/dusk

Most helpful comment

It's arrow_down
you will find the list here vendor/facebook/webdriver/lib/WebDriverKeys.php

All 2 comments

It's arrow_down
you will find the list here vendor/facebook/webdriver/lib/WebDriverKeys.php

@unglud from your answer alone it's unclear whether one's supposed to pass the arrow_down string to the keys method or the value of DOWN constant declared in WebDriverKeys.

Of course neither of those is the right way to press a key in Dusk. This person on Stackoverflow does much a better job answering this very same question in a clearer and more concise way.

I think there's something that can be done to improve the current situation and avoid reports like this in the future.

The current Dusk documentation has an aside in the section "Using the Keyboard" stating:

All modifier keys are wrapped in {} characters, and match the constants defined in the Facebook\WebDriver\WebDriverKeys class, which can be found on GitHub.

As a non-native speaker I have found that sentence quite misleading as it suggests the { key name } syntax applies only to modifier keys (which are some subset of the constants defined that class).

Navigation keys aren't key modifiers. Going on what the manual says alone I'd have excluded {arrow_down} as the valid syntax.

Granted that part of this problem comes with the language barrier we can't hide Laravel has always had a problem sticking to the proper nomenclature.

I believe it'll be beneficial to paraphrase that aside to make it clearer it can be used to refer to any key defined as a constant in the WebDriverKeys class.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

subathanikaikumaran picture subathanikaikumaran  路  3Comments

ahtinurme picture ahtinurme  路  6Comments

hackel picture hackel  路  6Comments

alex-LE picture alex-LE  路  7Comments

susanBuck picture susanBuck  路  6Comments