In my Cypress script I want to run some JavaScript...
# help
l
In my Cypress script I want to run some JavaScript to expand/collapse an open group in the Cypress test runner's log. So I put a
.then()
after the command that results in an expandable group, then I run
document.getElementsByClassName('command-expander-column')[0].click()
. This works perfectly in the Chrome console, but when the test is running the resulting array is empty. Does anyone understand why it behaves this way?