2

I have a Codeceptjs/Puppeteer test that runs locally on containers orchestrated by Kubernetes and using data coming from AWS.

Example code

...
I.waitForVisible('#§Brand§amazon + div', 30);
I.scrollTo('#§Brand§amazon + div', 30); // Jenkins stops here
...

I also tried

...
I.waitForVisible('#§Brand§amazon + div', 30);
I.click('#§Brand§amazon + div'); // Jenkins stops here
...

When I run the same test in a Jenkins pipeline (everything runs on AWS), always with K8S governing things, the steps "I.scrollTo" or "I.click" fails with the message: "Node is either not visible or not an HTMLElement".

The output screenshots show that the page is correctly loaded. These screenshots are identical both locally and on Jenkins pipeline.

What could it be that makes the tests run locally and fail on Jenkins?

gigiz
  • 56
  • 4

1 Answers1

1

At the end it came out that Jenkins had nothing to do with this problem.

It appears that Puppeteer can take some time before a new SVG DOM element becomes clickable. Putting a I.wait(3) before the click solved the issue.

A safer strategy is to systematically place an I.retry({retries: 3, maxTimeout: 1000 }).click(selector); before clicking anything.

see also

gigiz
  • 56
  • 4