How to open the dropdown from the browser console? #1620
-
Hi there I'm trying to write the Behat (BDD) test of the application made in Vue. So far so good but I've got stuck on that v-select element. If you wondering what it is, it's all about the script from one machine trying to control the steps made by user on other machine (running tested application) using JavaScript. The problem is, when we take that https://vue-select.org/ as example, I am trying to trigger some click event action using the console in the browser but nothing seems to work in terms of opening the drop-down, The main goal is to open that dropdown and select one of the available options. I'd really appreciate if someone could enlighten me how to process this? I tried:
etc. and none of such attempt works or is acceptable. On my local folder I can access more methods using non production Vue environment but still it doesn't work either. Also attempts to trigger some events like Please advise how this could be achieved. Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
The dropdown state is controlled by the
That should do the trick for you in tests, but won't work in the console. When hit return to call the command in the console, focus is returned to the console, which means the dropdown will never open.
If you run the above, then quickly click anywhere in the browser window, you'll see the dropdown open. Best of luck! |
Beta Was this translation helpful? Give feedback.
The dropdown state is controlled by the
focus
of theinput[type=search]
within the component. When that element is focused, the dropdown is open. On blur, it closes.That should do the trick for you in tests, but won't work in the console. When hit return to call the command in the console, focus is returned to the console, which means the dropdown will never open.
If you run the above, then quickly click anywhere in the browser window, you'll see the dropdown open.
Best of luck!