Run Hybris unit test in intellij Idea community edition - intellij-idea

i want to run hybris unit test using intellij community edition like how we do it on eclipse.
I don't want to use Hybris intergation plugin as it was failed to defect the unittest that are present in custom directory. when i try to run the test Intellij native build is triggering but not the ant build. and i am resolving the dependencies whenever intellij throws me build fail with those errors.
Can anyone help me to set this up or guide me through what all necessary steps to follow.
I am using latest version of community edition , Junit - 4 & Mockito for writing unit tests.
Thanks in advance.

I was able to Run the tests once i resolved all the errors that was throwing by intellij.
refer the Image here
Once you click on that run button, you get build errors, once you resolve those build errors then automatically that test will run. if it says shorten the command line then
Please refer this article by Intellij, hope this helps.

Related

Intellij error - test framework quit unexpectedly intellij

I have been trying to run junit test but facing this issue constantly. I tried to look for answers on the internet but nothing helped.
]1
If there is an error e.g.
"CommandLineWrapper is ill-suited for launching apps on Java 9+..."
Then, try the following workaround in IntelliJ IDEA:
Run -> Edit configurations -> select the failed running config -> Shorten command line: #argfile (Java 9+) -> OK
For IntelliJ 2019 and above go to :
Settings-> Build,Execution,Deployment -> Build Tools -> Maven -> Running Tests and
Uncheck argLine
I had same issue but it has been resolved by updating the Intellij latest version 2020.3. Now i am able to run the test without any error. Please check below link for latest Intellij versions
https://www.jetbrains.com/idea/download/
I had previously installed zulu and Oracle Java and then switched between the two quite a bit.
I ended up having many JDKs
Here's what helped me.
In intelliJ, go to Run, the Edit Configurations.
In the Run/Debug Configurations window, under Build and run section, select 'Java Bundled'.
To make sure this applies for all tests, click on the edit template icon (the spanner), select JUnit and then in the Build and run section select 'java Bundled'
Make sure all the configurations under JUnit has 'java Bundled' as well
Click Apply and Ok. Try to run the tests now and it should probably work.
For me the problem was that I had some incompatible/old dependencies in my SBT project.
I updated the versions of every 3rd party in the SBT config and running ZIO tests in IntelliJ started working.
For me also, the problem was that I made a change in the dependecies and the dependecy updated was incompatible in the SBT project.

How to debug an IntelliJ plugin in a different platform (eg. Pycharm)

I have a license for PyCharm Professional and am using IntelliJ IDEA Community Edition to develop a plugin for it. I need to run the plugin in PyCharm to test it out. I can't use the Python plugin for IntelliJ IDEA to test it as only the Community edition of the plugin appears to be available for me. If I manually download the professional version and try to install it I get Plugin 'Python' is incompatible with this installation. I assume I would need IntelliJ IDEA Ultimate to be able to use the professional version of the Python plugin.
I saw this question, which suggests it is possible to use PyCharm as the target for a "Plugin" run configuration, but I haven't had any luck following those steps. I set the JRE to /opt/pycharm-professional/jre64 but got Exception in thread "main" java.lang.ClassNotFoundException: com.intellij.idea.Main. I then grabbed the java command line args from a running instance of PyCharm and added those in (particularly the classpath) but got Error: Could not find or load main class com.intellij.rt.execution.application.AppMainV2. I haven't been able to find anything in the docs on how to set this up.

Play Framework with IntelliJ Community Edition 14

I have not managed to compile/debug etc. the current Play Framework (2.3.7) with the Community Edition 14 of IntelliJ. Neither by importing the project, nor by using gen-idea .
Is there any way to get it run or is there just no way to use it ?
Paying > 400 bucks for just this feature is simply too much.
Thanks.
Usually I compile and run through console: activator -> compile/run, but you can compile in Intellij too by running Build -> Make Project, but I never tried running Play in Intellij though.
And for debugging, I run command activator -jvm-debug 9999 run as said in documentation. Then I set up remote debug configuration in Intellij.

Skip tests in IntelliJ using Gradle

Does anyone know how I can skip JUnit tests in IntelliJ when doing a Gradle build like the following command line version? I have searched extensively for a solution but can't find one. I am in the process of converting an existing project to Gradle and need to support many developers that are not familiar with Gradle, some UX, some front end, and some Java. There are many broken Junit tests in the myriad modules and long-term we will fix them. Short term I need all other developers to use the tools they are familiar with to be able to do their job easily.
./gradlew build -x test
The Gradle-Android Compiler settings allow for command-line options but not non-android projects as shown in the IntelliJ settings dialog shown below.
You should be able to run a standard clean build from intellij if it's a gradle project (aka gradle integration in intellij). Then edit the configuration and add at the script parameters : -x test which will run the clean build (or any other task) without running tests.
I am using Intellij IDEA 2019.3 (Community Edition).
You can skip test using following settings.
You can get to this via Gradle panel located at right top corner.
Select task -> Run Configuration -> Right click -> Edit Run Configuration..
From intellij 2021.2 onwards, type the argument directly in Run text

Do we need to install JDK to run WebDriver's TestNG tests through command line?

I am new to Selenium/WebDriver and created a project which I can execute through Eclipse IDE successfully. Now, I plan to run the test through command prompt by creating the proper TestNG1.xml and making sure the testng-6.8.5.jar is correctly pointed in PATH. I even tried giving full path of the testng-6.8.5.jar. Unfortunately I keep getting the error,
Error: Could not find or load main class org.testng.TestNG
I don't have JDK installed (and I don't want to install) so wondering if JDK is mandatory to run TestNG tests from Command line? From above error it looks like it's not even trying to access the TestNG1.xml I have.
I plan to distribute these tests as group of files to my fellow Business Analyst who only have JRE installed on their machine.
Yes, you need JDK installed where you are going to run your Test Here is some documentation of TestNG
Having JRE is enough to run the TestNG tests, or no need to install JDK to run the TestNG tests through command line
the issue was with the testng-6.8.5.jar library as selenium-server-standalone-2.32.0.jar was allowing me to run the project with no errors.