Closed asitishere closed 5 years ago
@KrishnB @sukesh15 Logging the defect in Optimus 3.0.
Looks like issue with Optimus 3.0 or related files which failed to clean the driver instance and keep the device engage , this results launch the application again and remaining test skipped . So the device in this time retained the last known configuration ( I can say that because when the test start skipping the screenshot in the after hook is always the same till the build FAILED and all test exit out.
To prove my logic I checked out my old code with Optimus 2.2.7 and 2.2.3 and executed the test suite , the result is perfect and all test pass or if failed it was for a specific condition. But NONE of the tests skipped .
Now with the same test , I only upgraded the build file with Optimus 3.0 , result 9% pass and remaining test skipped with the same error ( already shared with you).
Note: 3.0 works fine with small test suite with few tests and will see a 100% executed test , when the test suite size is big the failure starts. Without the fix 3.0 is not useful to work.
Optimus 2.x
compile 'com.testvagrant:optimus:2.2.3'
compile 'com.testvagrant.intents:intents:1.0.4'
compile 'com.testvagrant.stepdefs:stepdefs:1.0.5'
group 'au.com.woolworths.appAutomation'
version '1.0'
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'idea'
apply plugin: 'maven'
apply plugin: "com.testvagrant.optimus.plugin"
/*
IMPORTANT: Optimus extension is required to run optimus plugin.
*/
optimus {
testFeed = System.getProperty("testFeed");
tags = System.getProperty("tags");
devMode = System.getProperty("devMode");
classpath = sourceSets.test.runtimeClasspath
}
//Optimus Execution Rules
tasks.runFragmentation.dependsOn 'clean', 'build'
tasks.runDistribution.dependsOn 'clean', 'build'
tasks.build.mustRunAfter 'clean'
tasks.runFragmentation.finalizedBy 'fragmentationReport'
tasks.runDistribution.finalizedBy 'distributionReport'
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
mavenCentral()
}
dependencies {
classpath "gradle.plugin.com.testvagrant.optimus:OptimusGradle:2.2.7"
}
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
compile 'org.codehaus.groovy:groovy-all:2.2.0'
compile group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '3.6.0'
compile 'cglib:cglib:3.2.4'
compile 'com.testvagrant:optimus:2.2.3'
compile 'com.testvagrant.intents:intents:1.0.4'
compile 'com.testvagrant.stepdefs:stepdefs:1.0.5'
testCompile('com.google.inject:guice:3.0')
testCompile(group: 'com.googlecode.lambdaj', name: 'lambdaj', version: '2.3.3')
testCompile(group: 'org.json', name: 'json', version: '20131018')
compile group: 'com.google.guava', name: 'guava', version: '22.0'
}
Optimus 3.0
compile group: 'com.testvagrant', name: 'optimus', version: '3.0'
compile 'com.testvagrant.stepdefs:stepdefs:1.0.8'
compile 'com.testvagrant.intents:intents:1.0.6'
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'idea'
apply plugin: 'maven'
apply plugin: "com.testvagrant.optimus.plugin"
/*
IMPORTANT: Optimus extension is required to run optimus plugin.
*/
optimus {
testFeed = System.getProperty("testFeed");
tags = System.getProperty("tags");
devMode = System.getProperty("devMode");
regression = System.getProperty("regression");
env = System.getProperty("env", "integration");
classpath = sourceSets.test.runtimeClasspath
}
service {
database = System.getProperty("database", "optimus")
port = System.getProperty("port", "8090")
uri = System.getProperty("uri", "mongodb://localhost:27017")
}
//Optimus Execution Rules
tasks.runFragmentation.dependsOn 'clean', 'build','spinServices'
tasks.runDistribution.dependsOn 'clean', 'build','spinServices'
tasks.build.mustRunAfter 'clean'
tasks.runFragmentation.finalizedBy 'fragmentationReport'
tasks.runDistribution.finalizedBy 'distributionReport'
tasks.fragmentationReport.finalizedBy 'stopServices'
tasks.distributionReport.finalizedBy 'stopServices'
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
mavenCentral()
}
dependencies {
classpath "gradle.plugin.com.testvagrant.optimus:OptimusGradle:3.0"
}
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
compile 'org.codehaus.groovy:groovy-all:2.2.0'
compile group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '3.6.0'
compile 'cglib:cglib:3.2.4'
compile group: 'com.testvagrant', name: 'optimus', version: '3.0'
compile 'com.testvagrant.stepdefs:stepdefs:1.0.8'
compile 'com.testvagrant.intents:intents:1.0.6'
testCompile('com.google.inject:guice:3.0')
testCompile(group: 'com.googlecode.lambdaj', name: 'lambdaj', version: '2.3.3')
testCompile(group: 'org.json', name: 'json', version: '20131018')
compile group: 'com.google.guava', name: 'guava', version: '22.0'
}
@asitishere can you please confirm if its working fine for you after the fix was done in 3.0.1?
Hello @sukesh15 I am also facing the same issue with classpath "gradle.plugin.com.testvagrant.optimus:OptimusGradle:3.0.1"
The single scenario works fine, however if I run the tests in a suite it is failing in the 'Before' hook with error message: java.lang.IllegalStateException: Cannot parse content to class com.testvagrant.monitor.requests.Scenario because no content-type was present in the response and no default parser has been set. You can specify a default parser using e.g.: RestAssured.defaultParser = Parser.JSON;
The same suite works fine with
classpath "gradle.plugin.com.testvagrant.optimus:OptimusGradle:2.2.7"
Has this issue been resolved?
Can you please share your build.gradle
buildGradle.pdf Sure attached the build.gradle file as a pdf