How testng.xml redo for junit 5 - junit

I am currently transferring the project from testNG to junit 5 and I have a problem with the replacement testng.xml to a similar implementation on junit 5. I'm new to this, so I can't figure it out yet. during test execution, the testng org.testng.internal classes are accessed and then the file is accessed testng.xml. Is there an alternative to this in junit 5 ? I am grateful in advance to all those who answered.

Related

Running ST's in parallel with SPOCK

I am trying to run CT's in parallel with SPOCK, currently using Junit4.
I have tried migrating to JUnit 5 but none of the config for Parallelizing the tests seems to work.
I am working from this
guide https://spockframework.org/spock/docs/2.0-M4/parallel_execution.html#parallel-execution
I am looking to find out is this even possible yet, there does not seem to be much resources on the topic.

Testing CodenameOne business logic using JUnit

I want to write the business logic of my CodenameOne application using JUnit 5. But when I try to run any unit test in Intellij, the simulator is started with the app instead of the unit tests.
Did anybody figure out how to setup Intellij such that the unit tests can be run without triggering the Ant build?
Codename One has its own unit test API and test recorder, generally you should use that for your testing as it allows you to test everything including the GUI.
See this for further details on using the testing framework.
You could probably use JUnit for the pure business logic but I'm not sure what benefit it would provide.

JUnit 5 vs TestNG

We were using JUnit 4, but we had some problems with test grouping. For integration tests we had problems with running order. We had migrated to TestNG in February 2016.
Now we are starting a new independent module for our project and part of our team players wants JUnit 5. I believe it is much better than 4th (there are some new important features, but I see some problems too).
I do not want to use JUnit 5 because of fear of possible problems in our new application, because I have experience with 4th. But I have to be more flexible for the team, so before making a decision I need recommendations from users who have experience with JUnit 5.
TestNG objective is beyond unit test so it covers wider testing needs like Scenario Tests, Integration Test, Dependency Test, Ordering, Parallel Execution etc, but these feature are not supported in JUnit 5.
The JUnit 5 team have these above items in their road map, but they are extending a unit testing framework to support wider range of testing needs. Lets see how the new subsequent release of Junit 5 is able to address the wider testing need in comparison with TestNG
For Spring based application Junit fits best for doing the Unit and Integration Testing as it the default testing framework and Spring Provides lots of Test API with Mockito.
For general testing and Web Automation (Selenium) - TestNG is the de facto.
JUnit 5 introduced a lot of new features. Currently Intellij IDEA supports JUnit 5.
Take a look at article about integrating: Using JUnit 5 in IntelliJ IDEA.
There are some useful annotations now, like:
#Tag Used to declare tags for filtering tests, either at the class
or method level; analogous to test groups in TestNG or Categories in
JUnit 4
#DisplayName Declares a custom display name for the test class or test method
See more: JUnit 5 User Guide

Integrating Selenium Junit tests with silk central efficently

I'm able to run simple Selenium Junit Test case from Silk Central test management tool. Now I want to design selenium framework to work with Silk Central. Please let me know if any one is using silk central to run their selenium scripts designed in junit.
Please find my questions below:
1.How to automatically add the captured screenshot via Selenium webdriver to Run details section of Silk central Junit Test case.
2.How to automatically add my own custom defined log4j file to Run details section of Silk central Junit Test case.
Please help me guys i'm unable to find the answers.
Silk Central provides several parameters and information as a Java System property.
In your case, you need the value of the system property #sctm_test_results_dir in your JUnit test. The system property provides the path information of the folder, where all result files are collected after the run was finished.
With this folder information available in your JUnit test, you can place all your files there and they are automatically collected by Silk Central and are available in your test results.
(There are more parameters available for tests, just check the documentation topic 'Accessing Silk Central Parameters through Java System Properties')
BTW, we have releases a blog post on Selenium and Silk Central this week, just for your information: https://community.microfocus.com/borland/test/silk_central/b/weblog/archive/2015/06/10/test-management-for-selenium-tests-with-silk-central.aspx

Running TestNg tests via JUnit TestSuite

Is it possible to execute TestNg tests in a JUnit TestSuite. I see a lot of web pages describing how to use TestNg to run JUnit but none the other way around.
No, only JUnit tests can be run in TestNG.
TestNG was initially developed as a replacement for JUnit with additional functionality and an emphasis on smooth migration. An ability to run JUnit tests was one of the tools for that smooth migration.
TestNG fully covers the functionality of JUnit and adds something new. And JUnit can not (currently?) emulate that difference in functionality.
You may check the comparison of these two libraries here.