Closed sarathsp23 closed 6 years ago
Thanks for pointing this out @sarathsp23 will look into this and update you. As you said we might be missing out on processing arrays.
@sarathsp23 this is resolved with the latest version of optimus. Please update your project optimus dependencies to below
repositories {
mavenCentral()
jcenter()
}
dependencies {
compile group: 'com.testvagrant', name: 'optimus', version: '3.0'
}
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
mavenCentral()
}
dependencies {
classpath "gradle.plugin.com.testvagrant.optimus:OptimusGradle:3.0"
}
}
@KrishnB Hi Krishna, thanks for the fix, but unfortunately I have not been able to upgrade to the latest version due to the exceptions which I believe Asit has already raised.
Hi @sarathsp23 the issue was with duplicate scenario names in multiple feature files, this is resolved with the latest version 3.0.1
can you give it a try, below are the steps to update to latest version
1. Update optimusGradle version ==> 3.0.1
2. Optimus Dependency version ==> 3.0.1
3. Optimus services from 1.0 to ==> 2.0 ( this can be downloaded from here https://github.com/testvagrant/optimus-services/releases/tag/v2.0)
4. Kill running optimus services if any
5. Run it on a clean db state
Changes in this version
1. Added support for duplicate scenarios in multiple feature files which was causing build issues (but as a practice its good to avoid duplicate scenarios)
@KrishnB Hey , I updated the optimus and did not see an error, I will verify this bug and keep u update. Thanks Sarath
@KrishnB Hi, I tried with scenario which was present two seperate feature file, the tests in the original feature file got executed alright, but the second feature did not get executed at all. It threw the below error java.lang.IllegalStateException: Cannot parse content to class com.testvagrant.monitor.requests.Device 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;
or you can specify an explicit ObjectMapper using as(class com.testvagrant.monitor.requests.Device,
Hi @sarathsp23 can you please verify if your scenarios collection in db is updated with the field featureFileName
. If not you can try on a clean db state with optimus-services 2.0
@KrishnB I am not sure if I did correctly, but I tried by dropping the db . If that is not how it is supposed to be done. Can you please let me know the steps to following to clean the db state wth optimus 2.0?
Hi @sarathsp23 these are the below steps as I mentioned before
1. Update optimusGradle version ==> 3.0.1
2. Optimus Dependency version ==> 3.0.1
3. Optimus services from 1.0 to ==> 2.0 ( this can be downloaded from here https://github.com/testvagrant/optimus-services/releases/tag/v2.0)
4. Kill running optimus services if any
5. Run it on a clean db state
I guess you will have to recheck on step4 I think there are old services running on 8090 or 8080 you can check it using lsof -i:<portnumber>
and kill the existing services
I keep getting this exception below Exception in thread "main" com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "timestamp" (class com.testvagrant.monitor.responses.BuildsResponse), not marked as ignorable (2 known properties: "links", "content"]) at [Source: (String)"{ "timestamp" : "2018-07-23T23:36:24.058+0000", "status" : 500, "error" : "Internal Server Error", "message" : "Timed out after 30000 ms while waiting to connect. Client view of cluster state is {type=UNKNOWN, servers=[{address=localhost:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.ConnectException: Connection refused (Connection refused)}}]; nested exception is com.mongodb.MongoTimeoutException: Ti"[truncated 395 chars]; line: 2, column: 18] (through reference chain: com.testvagrant.monitor.responses.BuildsResponse["timestamp"]) at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:60) at com.fasterxml.jackson.databind.DeserializationContext.handleUnknownProperty(DeserializationContext.java:822) at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:1152) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:1567) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownVanilla(BeanDeserializerBase.java:1545) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:293) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151) at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4001) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3030) at com.fasterxml.jackson.databind.ObjectMapper$readValue$2.call(Unknown Source) at io.restassured.internal.path.json.mapping.JsonPathJackson2ObjectDeserializer.deserialize(JsonPathJackson2ObjectDeserializer.groovy:45) at io.restassured.path.json.mapping.JsonPathObjectDeserializer$deserialize.call(Unknown Source) at io.restassured.internal.mapping.Jackson2Mapper.deserialize(Jackson2Mapper.groovy:58) at io.restassured.mapper.ObjectMapper$deserialize$0.call(Unknown Source) at io.restassured.internal.mapping.ObjectMapping.parseWithJackson2(ObjectMapping.groovy:202) at io.restassured.internal.mapping.ObjectMapping$parseWithJackson2$1.callStatic(Unknown Source) at io.restassured.internal.mapping.ObjectMapping.deserialize(ObjectMapping.groovy:55) at io.restassured.internal.mapping.ObjectMapping$deserialize$0.call(Unknown Source) at io.restassured.internal.RestAssuredResponseOptionsGroovyImpl.as(RestAssuredResponseOptionsGroovyImpl.groovy:222) at io.restassured.internal.RestAssuredResponseOptionsImpl.as(RestAssuredResponseOptionsImpl.java:164) at com.testvagrant.monitor.clients.BuildsClient.getLatestBuildId(BuildsClient.java:40) at com.testvagrant.monitor.services.OptimusServiceImpl.getLatestBuild(OptimusServiceImpl.java:10) at com.testvagrant.monitor.services.DevicesServiceImpl.insertDeviceList(DevicesServiceImpl.java:30) at com.testvagrant.optimus.register.DeviceRegistrar.setUpDevices(DeviceRegistrar.java:31) at com.testvagrant.optimus.OptimusMain.setup(OptimusMain.java:38) at com.testvagrant.optimus.OptimusMain.main(OptimusMain.java:33)
Hi @sarathsp23, log says mongodb is not running. You will have to start manually if you are running it locally using mongod
.
When I pass processArguments with an array of argument, the same is not accepted as capability. Even though there is no exception thrown, but the process arguments are not passed to the application. Looking at the code ,seems like the only capabilities that are being set are either Boolean, String or Integer Below is how I am passing the processArguments
"appiumServerCapabilities": { "app": "OpalTravel.ipa", "platformName": "iOS", "platformVersion": "11.1.2", "deviceName": "iPhone 6", "noReset":true, "bundleID":"au.com.opal.travel", "autoDismissAlerts": true, "fullReset": false, "newCommandTimeout":60, "processArguments": { "args": [ "__OTA_VAR_ENVIRONMENT=TEST" ] } }