Is Serenity compatible with Junit 5? - junit5

I have been working on a Spring boot project and started testing it using Serenity but I can't seem to use it with Junit 5.Can someone please help me? Thanks in advance.

Well, the day after I posted the question, there was an update that became available which makes Serenity compatible with Junit 5.Just add the following dependency:
<dependency>
<groupId>io.github.fabianlinz</groupId>
<artifactId>serenity-junit5</artifactId>
<version>1.2.1</version>
</dependency>
To run a JUnit5 test with Serenity BDD, simply add the annotation #net.serenitybdd.junit5.SerenityTest (instead of #org.junit.runner.RunWith(net.serenitybdd.junit.runners.SerenityRunner.class) for JUnit4)
For more details refer to: https://github.com/fabianlinz/serenity-junit5

Serenity 2.6.0 added beta support for JUnit 5
https://github.com/serenity-bdd/serenity-core/releases/tag/2.6.0

Related

SpringBoot Selenium Automation

I have created Spring Boot web app and its working fine. Now I am writing selenium automation for my web app. I have written some test case. But when I am executing the test cases by using mvn test its giving following exception.
java.lang.NoClassDefFoundError: org/apache/http/auth/Credentials
Can someone tell me why this is error?
You might missing the jar
make sure you have httpclient 4.5.2 or higher in your class path.
refresh eclipse
Close Eclipse.
clean .m2/repository folder
Open Eclipse and Alt+F5 on project;
check option Force Update of Snapshots
Use
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.+</version>
</dependency>
and check

How to install Sikuli in IntelliJ Idea?

I want to automate a Windows app which will also become a mobile app. I am thinking of creating a test automation framework from scratch using IntelliJ.
Since the older tests are already written in Sikuli, I would like to keep them too. What are the steps for setting up Selenium and Sikuli in IntelliJ?
I would recomend you use Maven. In this case you just need to add next dependency to POM.xml
<!-- https://mvnrepository.com/artifact/com.sikulix/sikulixapi -->
<dependency>
<groupId>com.sikulix</groupId>
<artifactId>sikulixapi</artifactId>
<version>1.1.999</version>
</dependency>

Is TestNG eclipse plugin version workability dependent on TestNG jar version in pom.xml?

Do the version have to be compatible? How do I find the compatibles?
since testng-eclipse 6.9.10, testng versions below 6.5.1 are not supported any more, please see more details in the change log: https://github.com/cbeust/testng-eclipse/blob/master/CHANGES.md#6910
I hope below link helps you..
http://testng.org/doc/download.html
Now a days all are Eclipse 3.4 and more.. you can happily use latest testng dependent in pom.xml
Thanks

How do I install Robot framework and selenium 2 library with Jython?

I searched a lot regarding this. Still I didn't get any definite answer for this. Someone Please explain me on how to do this. Please mention the compatible versions also.
You can use the Selenium 2 java robot framework.
Just add the following dependency to the pom file (if you use maven)
<dependency>
<groupId>com.github.markusbernhardt</groupId>
<artifactId>robotframework-selenium2library-java</artifactId>
<version>1.4.0.6</version>
</dependency>
If you don't use maven, just download the jar from
https://github.com/MarkusBernhardt/robotframework-selenium2library-java
(You can find a link there to the jar with the dependencies in it)
This is compatible with all jython versions (since it's java based)

Using different eclipselink than bundled in glassfish-embedded-web

I use glassfish-embedded-web for integration tests inside a maven project:
<dependency>
<groupId>org.glassfish.extras</groupId>
<artifactId>glassfish-embedded-web</artifactId>
<version>3.2-b06</version>
<scope>test</scope>
</dependency>
glassfish-embedded-web comes with Eclipselink 2.2.0, but the project requires features of 2.4. For regular deployment, this is solved by adding je required jars to glassfish's modules directory and this dependency:
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.core</artifactId>
<version>2.4.1</version>
<scope>provided</scope>
</dependency>
I tried also compile scope, still the embedded EL 2.2.0 is used. Adding a test scope dependency on EL 2.4.1 doesn't help. Is there any way to solve this?
Did you try to specify the maven scope test? Otherwise it will not be available while testing! To only provide this version for testing you could use maven profiles.
I see two possible solutions to this problem: either you build your own glassfish-embedded or you just use a brute force approach and modify the jar.
On the 1st approach:
After spending some time building GF I figured that even with my dilettante shell scripting skills its easier to just use the second approach instead of figuring GF code. However, if you're up for this one I'd suggest to start at oracle wiki.
On the 2nd approach: As I've mentioned above, automating this task is the best approach in my opinion (at least if you're dealing with numerous libs and continuous changes), so I wrote this script with all the necessary instructions on how to use it. After you get the new jar just install it in your local repo. I'm using Nexus so for me it was a matter of couple buttons getting pressed.
P.S.: Any comments/advices/improvements on the script are welcome.