AEM 6.3 Junit with javascript | Community
Skip to main content
srinivas_chann1
New Participant
June 29, 2020
Solved

AEM 6.3 Junit with javascript

  • June 29, 2020
  • 2 replies
  • 1835 views

Hi ,

 

Wanted to know if there is any possibility to integrate javascript with junit  for writing test cases.

 

Thanks

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by BrianKasingli

Hi @srinivas_chann1, I think you are asking about JavaScript unit tests for your client library. If you want to write JavaScript Unit tests for your client libraries, you can follow the steps provided in this blog article, How to write Javascript Unit Tests for AEM Client Libraries with Jest

Provided in the steps from the blog, you can review an example of JavaScript unit tests being invoked as a part of the Maven build command; using the Maven front-end Plugin. The Jest test library is being utilised.

However, if you want to write Java Unit Tests using JavaScript, please explain your use case...

2 replies

BrianKasingli
BrianKasingliAccepted solution
New Participant
June 29, 2020

Hi @srinivas_chann1, I think you are asking about JavaScript unit tests for your client library. If you want to write JavaScript Unit tests for your client libraries, you can follow the steps provided in this blog article, How to write Javascript Unit Tests for AEM Client Libraries with Jest

Provided in the steps from the blog, you can review an example of JavaScript unit tests being invoked as a part of the Maven build command; using the Maven front-end Plugin. The Jest test library is being utilised.

However, if you want to write Java Unit Tests using JavaScript, please explain your use case...

srinivas_chann1
New Participant
June 29, 2020

Hi,

Thanks for the input .

I am looking for javascript testing .As you mentioned jest will be helpful.

I am using AEM6.3 version can i use jest also if there any more examples on jest with aem help.

I could not understand from the example assume i am having javascript located at /etc/clients/comoponent/abc/abc.js then how to write test case .

 

Does jest support even css testing??

 

Thanks 

VeenaVikraman
New Participant
June 29, 2020

@srinivas_chann1 What is your exact use case ? I don't understand your question clearly ? Do you want to write unit test for the FE components ? In 6.3 there is support for Hobbes testing framework , which was later deprecated in the other versions. You can find more details https://helpx.adobe.com/in/experience-manager/6-3/sites/developing/using/hobbes.html

http://keysandstrokes.info/aem-automating-front-end-testing-using-hobbes/

 

Thanks

Veena

srinivas_chann1
New Participant
June 29, 2020

Hi,

Thanks for the input.

I am looking any option where we could write test case for javascript file functions,It would be helpful  if the same is supported in upcoming versions of AEM.

 

Any git sample codes will be helpful

 

Thanks again