Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Integrate Cypress in ui.tests for aem cloud

Avatar

Level 5

Hi Guys,

 

I am trying to integrate Cypress in AEM repo.

My local integration is working fine. But when deploying to cloud the build error comes up - 

19:25:04,735 [main] [INFO] --- frontend:1.12.0:npm (run-cypress-tests) @ com.adobe.cq.cloud.testing.ui.cypress.tests ---
19:25:04,736 [main] [INFO] Running 'npm run test' in /build_root/build/benz-pxxxyyy-uk121212/ui.tests
19:25:05,024 [Exec Stream Pumper] [INFO]
19:25:05,024 [Exec Stream Pumper] [INFO] > ui.tests@1.0.0 test
19:25:05,024 [Exec Stream Pumper] [INFO] > npm run cypress:run
19:25:05,024 [Exec Stream Pumper] [INFO]
19:25:05,629 [Exec Stream Pumper] [INFO]
19:25:05,629 [Exec Stream Pumper] [INFO] > ui.tests@1.0.0 cypress:run
19:25:05,629 [Exec Stream Pumper] [INFO] > CYPRESS_VERIFY_DISABLE=true cypress run --browser chrome --headless --config video=false,reporter=spec -- --no-sandbox --disable-gpu
19:25:05,629 [Exec Stream Pumper] [INFO]

19:25:05,946 [Exec Stream Pumper] [INFO] [FAILED] Error: spawn Xvfb ENOENT
19:25:05,946 [Exec Stream Pumper] [INFO] [FAILED] Platform: linux-x64 (Ubuntu - 22.04)
19:25:05,946 [Exec Stream Pumper] [INFO] [FAILED] Cypress Version: 14.5.4
19:25:05,947 [Exec Stream Pumper] [INFO] Your system is missing the dependency: Xvfb

19:25:05,918 [Exec Stream Pumper] [INFO] It looks like this is your first time using Cypress: 14.5.4

19:25:05,947 [Exec Stream Pumper] [INFO] Install Xvfb and run Cypress again.

 

How can I install Xvfb on cloud containers? @daniel-strmecki 

 

Thanks,

Nagesh

2 Replies

Avatar

Community Advisor and Adobe Champion

Are you running your Cypress tests during the Maven build process? In AEMaaCS, the right place to run Cypress is the Custom UI Testing step, which executes your tests inside a Docker image that already has the browsers/display stack.

 

Good luck,

Daniel

Avatar

Community Advisor

Try the following link - https://github.com/adobe/aem-test-samples/tree/aem-cloud/ui-cypress
There's a section towards the end which points to replacing the files in the ui.tests.

Integrate into your Cloud Manager repository

Follow these steps to use the Cypress tests:

  1. Remove all content in the ui.tests folder from your Cloud Manager repository.

  2. Copy all files located in this folder into the ui.tests folder.

  3. (Optionally) adjust the file pom.xml and set parent as well as artifact information to the desired naming.

  4. Commit and push the changes.

During the next pipeline execution, Cloud Manager will use the Cypress tests.

Hope this helps!

 

Rohan Garg