Search code examples
nightwatch.jse2e-testingzendesk

zendesk interfering with e2e test with nightwatch


I have been having issues with my Zendesk covering up some of the buttons while testing e2e. I cannot disable my Zendesk for each test case, because they are are the highest level.

Is there a way to set the browser size on Nightwatch to be bigger than my computer screen size?

I have args: ['window-size=4500,1170'], but it seems like the window for chorme will not get any larger than my own screen size.

Thanks


Solution

  • You can make the Zendesk widget hidden using the follow browser.execute() code.

    browser.execute(function(){
       const zenDeskWidget = document.querySelector('#contact-widget-launcher');
       zenDeskWidget.style.display = "none"
    },[]);
    

    You may need to tweak your locator and the property to modify in order to hide it.The page I derived the widget I used for my example is https://www.zendesk.com/. If for some reason you want to write an acceptance test with the Zendesk widget just don't hide it (it's tough with the nested iFrames, I would just test the api).