Expand my Community achievements bar.

SOLVED

Has anyone used Cypress to perform UI functional testing in AEM sites?

Avatar

Level 2

We are planning to Cypress instead of Selenium webdriver to do UI functionality testing in AEM sites. Wondering whether anyone has used it in their projects. Would be good if you can please share your insights with me. Thanks in advance.

1 Accepted Solution

Avatar

Correct answer by
Level 1

Can you please refer me to those workarounds, especially for multiple tabs. I have tried to use stubs, but was not successful. This is the code I have

 

 

const editWindowUrl = <yourUrl>
cy.window().then((win) => {
const stub = cy.stub(win, "open").as("windowOpen");
});
cy.contains("Edit").click();
cy.get("@windowOpen").should("be.called");
cy.window().then((win) => {
win.location.href = editWindowUrl;
});

 

 

Thanks in advance. 

View solution in original post

8 Replies

Avatar

Level 1

We currently using Cypress for UI Functional Automation for AEM sites and it is working fine.

iframe and multiple tab functionality wont work and but we can do workaround for that.

Avatar

Correct answer by
Level 1

Can you please refer me to those workarounds, especially for multiple tabs. I have tried to use stubs, but was not successful. This is the code I have

 

 

const editWindowUrl = <yourUrl>
cy.window().then((win) => {
const stub = cy.stub(win, "open").as("windowOpen");
});
cy.contains("Edit").click();
cy.get("@windowOpen").should("be.called");
cy.window().then((win) => {
win.location.href = editWindowUrl;
});

 

 

Thanks in advance. 

Avatar

Administrator

@Ritesh21 , Thank. you for sharing the solution with AEM community. Looking forward to more contribution from you here. Great to have AEM SMEs like you here. Keep it up



Kautuk Sahni

Hi @igopisrinivasan

 

I'm wondering whether you would be able to share the initial AEM project set up with ui.tests modules in Cypress? Thanks in advance.

 

 

Avatar

Administrator

@igopisrinivasan , Thank. you for sharing the solution with AEM community. Looking forward to more contribution from you here. Great to have AEM SMEs like you here. Keep it up



Kautuk Sahni

Avatar

Level 1

We are still struggling to make the Cypress tests execute in the pipeline. We adjusted the docker image but always run into the issue below. May you share how you build your setup to make it work?

 

Xvfb exited with a non zero exit code.

There was a problem spawning Xvfb.

This is likely a problem with your system, permissions, or installation of Xvfb.

----------

Error: _XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running
(EE) 
Fatal server error:
(EE) Cannot establish any listening sockets - Make sure an X server isn't already running(EE)

----------

Platform: linux-x64 (Debian - 11.1)
Cypress Version: 9.4.1

 

Avatar

Level 2

We are using cypress for end user automation testing which works fine, however as part of the platform we are building I want to also have a set of editorial automation tests, however with AEMaaCS we are struggling to get past the cloudmanager SSO login.

 

Has anyone done an AEMaaCS editorial test using cypress that should how to get past the SSO login,