These are chat archives for Behat/Behat

23rd
Nov 2017
Abdul Wahhab Qureshi
@forceedge01
Nov 23 2017 08:35
@rafasellas_twitter Haven't used the built in extension - but the setup i have at the moment closely resembles page object pattern. Lets say It isn't a bad idea, good separation of concern to have context files for each page if thats what it is..
@tikolakin have not
@tikolakin what is it?
sredbull
@sredbull
Nov 23 2017 12:39
Can anyone point me to the right direction with a $this->getSession()->wait($time, $condition); condition:
this condition will check if a style element exists: document.querySelector('.__cov-progress').getAttribute('style').indexOf('width: 0%') > 0 the problem exists when the document.querySelector('.__cov-progress') does not exists on the page the getAttribute will brake the test. Unfortunately using if in a condition is not possible if(document.querySelector('.__cov-progress')){document.querySelector('.__cov-progress').getAttribute('style').indexOf('width: 0%') > 0}else{true} and results in nknown error: Runtime.evaluate threw exception: SyntaxError: Unexpected token if is there a solution for this?
sredbull
@sredbull
Nov 23 2017 13:13
((document.querySelector(".__cov-progress") == null) || document.querySelector(".__cov-progress").getAttribute("style").indexOf("width: 0%") > 0)
works