Problem is that my codeception test is actually passing and button is clicked, but for some reason it stops going further with error in title.
$I->click('onsomefield');
$I->fillField(['name' => 'password'], 'password');
$I->waitForJS("let buttons=document.querySelectorAll('button');buttons.forEach(function(button){button.style.disabled=false});return buttons[1].click()",10);
I expect my test to be passed but i get an error as in title
Full error text is:
[Facebook\WebDriver\Exception\UnexpectedJavascriptException] javascript error: Cannot read property 'click' of undefined (Session info: chrome=75.0.3770.142) (Driver info: chromedriver=75.0.3770.140 (2d9f97485c7b07dc18a74666574f19176731995c-refs/branch-heads/3770@{#1155}),platform=Windows NT 10.0.18362 x86_64)