Testing patterns with AEMaaCS

When you start from the AEM project archetype, you already have a foundational setup for testing your AEM application. Cloud Manager enhances this by offering essential features that facilitate testing on multiple levels.

In this talk, we will outline best practices and project setup guidelines to help you build a robust setup that addresses various aspects of application testing.

Jesse Pinkman

Is there a way to easy tests components that extend core components. A lot of code is difficult to test in our custom unit tests and actually is already being tested by Adobe. As this bring down our unit testing score

Barry

we only create unit tests for java code we write, if we start from the AEM core components we write a unit test for the changed methods because we are not duplicating code from Adobe that indeed is already tested. If we do have to copy vendor code which sometimes is the only option we use a @Generated annotation to ignore that method or class from code coverage. Sadly this will only work in the local quality gates and that's why we use 80% for example as threshold and not 50%. If we need to overlay the html, which we also try to avoid, we create playwright tests to check the behaviour when rendered in the it.content pages.

Michael

How long does it take to spin up RDE and get it ready for testing on average (including all dependencies, dispatcher, package installation, etc)? A ballpark figure in minutes.

(see answer in talk video)
Is there a way to ensure compatibilty between environments for UI tests? (ex. Simple Cypress tests failing on one environment but passing on another)

Barry

we try to avoid this by limiting configuration and content drift between our environments. For example dispatcher config is using the same config across all environments with ServerAliases, sanity content is automated and aligned between environments with code, we avoid creating environment specific OSGi configs where possible (so avoid to bind them to a runconfig)

Michael

Can you leverage Health Checks to verify the readiness of the RDE before running test automation?

(see answer in talk video)

Yegor Kozlov

How do you test author-publish scenarios, e.g. change a page, replicate and vaidate the change on the publish instance?

(see answer in talk video)

ben-zahler

How long does it take for you to execute a full test cycle including integration tests?

Michael

That depends on the test suite, the overal complexity of the application and the actual coverage. It could span from seconds to hours project-to-project. Please mind that getting an answer from the presenters is unlikely to be representative to you.

Can you share more about „Evergreen as a Service”? If it is a beta with Adobe, where can one join?

Barry

in the talk a name was mentioned but you should reach out to an Adobe representative who can give you more details ;)

Remo Liechti

You mentioned non reliable aio aem rde status command, can you please share the details with us so we can follow up? Thank you

Barry

Roy will inform you with the details on slack ;)

Diego

How do you handle hotfixes if you only run the unit tests on RDE and DEV? You just check it locally?

Barry

we don't only run the unit tests on RDE, we run all test suites that also run on the development pipeline in cloud manager. So if you need a hotfix you can start from your production banch, open a merge request, the RDE deploy will kick in and all test suites are ran, the code quality pipeline will also run and if all succeeds you should be able to deploy your code confidently to production. The same test suites (expect those relying on it.content) are also being run on the stage environment before going to production

how much time it takes to run all tests?

Barry

total time is 15 to 20 minutes and they usually take about 5 to 10 minutes, RDE setup (reset, dispatcher, frameworks and custom code install) takes about 10 minutes