Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.
SOLVED

does hobbes js used in aem 6.5 for testing or we prefer selenium?

Avatar

Level 2
 
1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

 

To test a component with Hobbes.js, define a test case with actions and assertions, set up the test scenario, and run the test using hobbes.runTest.

 

Example:

hobbes.testCase('MyComponent Test', function (browser, done) {
// Test scenario setup
browser.find('.my-component').click();

// Assertions
browser.assert.elementPresent('.my-component .title');
browser.assert.containsText('.my-component .title', 'Hello, World!');

// Run the test
browser.runTest(done);
});

 

View solution in original post

5 Replies

Avatar

Employee Advisor

Hi,

 

Hobbes.js and Selenium are both commonly used for testing in AEM 6.5, but they serve different purposes and have different features.

 

Hobbes.js is a JavaScript-based testing framework specifically designed for AEM. It provides a set of utilities and APIs that make it easier to write tests for AEM components and features. On the other hand, Selenium is a widely-used testing framework for web applications in general, including AEM.

 

If you are primarily testing AEM components and features, and want a framework that is tailored for AEM, Hobbes.js can be a good choice

Avatar

Level 2

Hi @ManviSharma ,

Can you explain a bit more about hobbes js and how its used to test a component using an example in aem?

Avatar

Correct answer by
Employee Advisor

 

To test a component with Hobbes.js, define a test case with actions and assertions, set up the test scenario, and run the test using hobbes.runTest.

 

Example:

hobbes.testCase('MyComponent Test', function (browser, done) {
// Test scenario setup
browser.find('.my-component').click();

// Assertions
browser.assert.elementPresent('.my-component .title');
browser.assert.containsText('.my-component .title', 'Hello, World!');

// Run the test
browser.runTest(done);
});

 

Avatar

Community Advisor

@chiragtakkar5The Hobbes.js framework comes with AEM, it doesn’t require additional license to use it. But noted that in AEM 6.5, Adobe’s deprecated Hobbes.js, and recommends customers to Selenium automation.

https://experienceleague.adobe.com/docs/experience-manager-65/release-notes/deprecated-removed-featu...

Bhuwan_B_0-1686051212284.png