Gradle: How to Display Test Results in the Console in Real Time?

Here is my fancy version: import org.gradle.api.tasks.testing.logging.TestExceptionFormat import org.gradle.api.tasks.testing.logging.TestLogEvent tasks.withType(Test) { testLogging { // set options for log level LIFECYCLE events TestLogEvent.FAILED, TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.STANDARD_OUT exceptionFormat TestExceptionFormat.FULL showExceptions true showCauses true showStackTraces true // set options for log level DEBUG and INFO debug { events TestLogEvent.STARTED, TestLogEvent.FAILED, TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.STANDARD_ERROR, TestLogEvent.STANDARD_OUT exceptionFormat TestExceptionFormat.FULL } … Read more

In Karate API mocking not working as expected for me

Karate cannot automatically intercept calls. The recommended approach is when you boot the application running at localhost:8080 you change the configuration so that instead of calling http://dev-stg/userservice/v1/findUser it calls something like http://localhost:8001/v1/findUser. This is what most teams do, and is easy because you should anyway be defining external URL-s as (or equivalent) as a … Read more

Order of execution of tests in TestNG

This will work. @Test(priority=1) public void Test1() { } @Test(priority=2) public void Test2() { } @Test(priority=3) public void Test3() { } priority encourages execution order but does not guarantee the previous priority level has completed. test3 could start before test2 completes. If a guarantee is needed, then declare a dependency. Unlike the solutions which declare … Read more

How to get Sikuli working in headless mode

I successfully got sikuli running in headless mode (no physical monitor connected) Ubuntu: check Xvfb. Windows: install display driver on the machine (to be headless) from virtualbox guest additions display drivers and use TightVNC to remotely set resolution from another machine. Detailed steps for windows 7 Assume that: Machine A: to be headless machine, windows … Read more

How do I control the order of execution of tests in Maven?

You can’t specify the run order of your tests. A workaround to do this is to set the runOrder parameter to alphabetical. <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <runOrder>alphabetical</runOrder> </configuration> </plugin> and then you need to have rename your tests to obtain the expected order. However it isn’t a good idea to have dependent tests. Unit tests … Read more

How to explain sorting (numerical, lexicographical and collation) with examples to non technical testers?

Here are some explanations: Lexicographical In this case, you sort text without considering numbers. In fact, numbers are just “letters”, they have no numeric combined meaning. This means that the text “ABC123” is sorted as the letters A, B, C, 1, 2 and 3, not as A, B, C and then the number 123. This … Read more

Gradle Test Dependency

You can expose the test classes via a ‘tests’ configuration and then define a testCompile dependency on that configuration. I have this block for all java projects, which jars all test code: task testJar(type: Jar, dependsOn: testClasses) { baseName = “test-${project.archivesBaseName}” from sourceSets.test.output } configurations { tests } artifacts { tests testJar } Then when … Read more