Instrumentation testing in Android Studio - testing

I'm new to testing and currently trying to write some tests in Android Studio. I have a sample application module and now trying to figure out, whether the instrumentation test needs to be a module of its own or whether the tests should go inside the src folder... I have read contradicting information on the web. If anyone had a sample, that would be great!

With eclipse ADT plugin and older version of the SDK it was a requirement to put the integration tests in a separate module.
With the gradle build system and android-studio you should be able to put your integration tests in src/test/java and running them from the IDE or gradle command line without pain.
That's why you find contradicting information on the web.
Here is the reference

This post contains a very good explanantion on how to do the integration testing in Android Studio:
How can I create tests in Android Studio?

Related

How to set up JetBrains IDE to run Stencil e2e tests?

We're developing a design system with Stencil. We are now writing e2e tests as described in Stencil docs.
There is shared VS Code config which allows to run the tests with Visual Studio Code, but we're using JetBrains IDEs (IntelliJ IDEA and WebStorm) and it is not obvious how to set up tests to run them with IDE interface.
Did anyone managed to set up them in JetBrains IDEs?
You can try using the Node.js run configuration with similar setup: specify the project root folder as a Working directory, path/to/node_modules/.bin/stencil as JavaScript file, add test --e2e $FilePath$ to Application parameters

How to do code coverage for a remote repository deployed in Jboss server using Emma?

Here is my scenario.
I have a code base, which is built and deployed as EAR on jBoss server.
I have a separate testing framework.
Now I want to run the classes of that EAR using my testing framework.
The test cases are written in TestNG.
Also I want to know the code coverage of the EAR.
I have used eclEmma to do code coverage for Junits, it was simple as the code and tests are at same place.
How can I use Emma in the case of remote code base. Please help.
EclEmma is Eclipse plugin based on JaCoCo - Java Code Coverage Library. JaCoCo provides various ways for collection of code coverage. In particular you can attach it to the server as a Java agent and request information about coverage remotely. And even import and show it in Eclipse using EclEmma.

Source Control for Selenium Tests written in Java

In my company, I have plans to introduce Web Automation using Selenium WebDriver and Cucumber JVM using Maven builds.
Since the developers write their code in C#, they are all using TFS for source code repository and recommending the QA team also to use TFS to maintain my tests written in JAVA.
These are the questions I have got in my mind:
QA team will use IntelliJ IDE for writing Selenium tests in JAVA. Is IntelliJ compatible with TFS? Or is it a pain to configure it to work with TFS?
As we will move towards TDD very soon, we have to setup CI server as well.
Is it possible for me to run Selenium Tests triggered from TFS or do I need to use a separate CI server like Jenkins or Teamcity?
Does maven build work smoothly with TFS?
We have to adhere to stringent ISO guidelines for maintaining the source code. If I were to recommend source code repositories like github, can I ensure that the code is still secure? Is it difficult to setup the security in github?
Answering your questions regarding TFS:
IntelliJ IDEA supports TFS up to TFS 2015. Check:
Visual Studio Team Foundation Plugin for IntelliJ and Android Studio
Using TFS Integration
TFS supports CI build. After you've deployed a Windows build agent or an Xplat build agent, you are ready to define a CI build that compiles your Java app with Maven whenever your team checks in code.
Yes. Check:
Build your Java app with Maven

How can I check the build command for my JavafX app in IntelliJ IDEA

Im creating a JavaFX application in IntelliJ IDEA, and I am new to IntelliJ.
I would like to be able to compile my JavaFX application on a Raspberry Pi, but my app is quite complex and relies on 3rd party libraries, etc.
I would like to be able to see what exactly is going on in IntelliJ when I run "Make Project"
Is there a command line output screen that Im simply missing? I want the exact command that IntelliJ uses to compile the application.
Essentially, on the Pi, I want to get the code from my repo, run the compilation command and produce an executable JAR on demand.
I have of course read the doco on how to compile a JavaFX application, but if I could see what IntelliJ does, that would be fantastic.
So far I haven't found such an option but the process is most likely some sort of flow based on IntelliJ plugins and the documentation seems to support this theory.
Perhaps you'd consider using a software management and build tool such as maven or ant or something similar. This should give you (almost) unlimited options to configure your desired build sequence and 3rd party dependencies.

Play framework 2.0 continuous integration setup

I am looking for ideas for a Play 2.0 continuous integration setup. It would contain typical jobs like build after a git push, nightly builds with deployment to a test Heroku instance etc. Also code quality and test coverage metrics generation would be handy.
At the moment the stack looks like Play 2.0 with Java but that might change to Scala.
For "traditional" Java web app I would use Hudson/Jenkins. I found a Hudson plugin for Play but it doesn't seem to support Play 2.0. Is Hudson suitable tool here in general or what is your setup for Play 2.0 applications?
Play 2.0's build tool is just a thin wrapper around SBT. You should be able to use Hudson's sbt plugin to execute SBT build commands that are the equivalent of the Play commands you would execute from the console.
We execute the following under Bamboo for our builds:
SBT_OPTS="-Dsbt.log.noformat=true"
sbt clean compile test
(The SBT_OPTS variable turns off the colour formatting, making test output legible in log files.)
I found useful to add JUnit reporting plugin as I couldn't get test results to be displayed otherwise.
https://github.com/bseibel/sbt-simple-junit-xml-reporter-plugin
For PMD and Checkstyle I used this:
https://github.com/ymasory/sbt-code-quality.g8
For test coverage I am using JaCoCo at the moment:
http://ronalleva.com/2012/04/25/jacoco-and-play.html
Scct could be other option for coverage: http://mtkopone.github.com/scct/
With those and PMD, CheckStyle and JaCoCo plugins for Jenkins I have now quite ok setup for a Play 2 Java project.
here Is some detailed tutorial about doing It
http://wiki.cloudbees.com/bin/view/DEV/Playframework
It based on cloudbees but it would work fro any Jenkins Installation
You actually don't even need to use the SBT Plugin. I am running Play 2.1.1 on Jenkins and simply use the Execute Shell. I run something like the following:
cd ./your-play-project-root
play clean compile test stage
exit
This works quite well. "play" is simply just a thin wrapper around sbt.
"stage" will create a runnable in your target/server directory. Then, you can simply shell again to actually start your play application!