0

I'm trying to debug a failing Nightwatch test. Specifically, the test suite reports:

Wait for graph column to be selected - expected "visible" but got: "not found" (60058ms)

The test is attempting to click on the 'graph column' element in the DOM so that it the selected class is added to it but as you can see here, the test is unable to find it.

Strangely, the test fails intermittently in Jenkins but the data isn't time sensitive or variable. To add, when it fails, Allure outputs a screenshot that shows the element in question to be plainly visible. We thought it might be a z-indexing issue but there's nothing obvious in the screenshot and it makes no sense as to why it would fail intermittently.

I should add that the test passes 100% of the time when running Nightwatch (and Chromium) locally and 100% of the time when running the Docker containers (used by Jenkins) locally.

I'm really confused by the test failure and wondered if it might be something relating to our configuration of Docker, Jenkins and Nightwatch?

John Peden
  • 657
  • 1
  • 10
  • 24
  • Possibly related? https://stackoverflow.com/questions/37681256/selenium-tests-work-locally-but-fail-in-jenkins – John Peden Jun 06 '22 at 19:19

1 Answers1

0

It appears that this is a known issue with Nightwatch: https://github.com/nightwatchjs/nightwatch/issues/1221

In my case, I solved the intermittent failure but clicking twice on the element in question:

browser.click(selector, function() {
   // assert something here
})   

became

browser.click(selector).click(selector, function() {
   // assert something here
}) 

Not entirely sure why it was breaking when running in Docker...perhaps some weirdness when running on headless Chrome?

John Peden
  • 657
  • 1
  • 10
  • 24