does hobbes js used in aem 6.5 for testing or we prefer selenium? | Community
Skip to main content
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
ManviSharma
ManviSharmaAccepted solution
Employee
Jun 6, 2023 8:14 AM UTC

 

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);
});

 

5 replies

rawvarun
New Participant
Jun 6, 2023 10:40 PM UTC

In the future Selenium should be used as hobbes is deprecated.

https://experienceleague.adobe.com/docs/experience-manager-65/developing/components/hobbes.html?lang=en

Translate
Bhuwan_B
New Participant
Jun 6, 2023 11:33 AM UTC

@chiragta1The 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-features.html?lang=en

Translate
ManviSharma
Employee
Jun 6, 2023 7:57 AM UTC

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

Translate
ChiragTa1Author
Level 2
Jun 6, 2023 8:11 AM UTC

Hi @manvisharma ,

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

Translate
ManviSharma
ManviSharmaAccepted solution
Employee
Jun 6, 2023 8:14 AM UTC

 

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);
});

 

Translate