Karate afterFeature function execution works fine when run locally but fails when run through Jenkins, I get assertion failed: assert evaluated to false: responseStatus == 200 || responseStatus == 404. Whereas the responseStatus should either be 200 or 404.
Code Snippet
main.feature snippet
Background:
...
* def myName1 = 'karate-test-name'
* configure afterFeature = function(){ karate.call('cleanup.feature'); }
...
...
cleanup.feature
#ignore
Feature: To cleanup after main.feature execution. This Feature is not supposed to be run individually.
Background:
* url myUrl
Scenario: Delete
* print 'In "cleanup.feature", If exists delete: ' + myName1
Given path 'v1/myapi/',myName1,''
And header Content-Type = 'application/json; charset=utf-8'
And request {}
When method delete
Then assert responseStatus == 200 || responseStatus == 404
Logs from Jenkins:
The assertion for the responseStatus fails, but it does not log the actual value of the responseStatus.
23:03:15.448 [pool-1-thread-4] ERROR com.intuit.karate - assertion failed: assert evaluated to false: responseStatus == 200 || responseStatus == 404
23:03:15.450 [pool-1-thread-4] ERROR com.intuit.karate - feature call failed: cleanup.feature
arg: null
cleanup.feature:16 - assert evaluated to false: responseStatus == 200 || responseStatus == 404
23:03:15.451 [pool-1-thread-4] ERROR com.intuit.karate - javascript function call failed:
cleanup.feature:16 - assert evaluated to false: responseStatus == 200 || responseStatus == 404
23:03:15.451 [pool-1-thread-4] ERROR com.intuit.karate - failed function body: function(){ karate.call('cleanup.feature'); }
Moreover, I do not see the logs for execution of afterFeature in Jenkins, neither it is part of the Cucumber report for me to do further analysis.
Most likely an old version of Karate. Try 0.9.5
If you still can't solve this - please follow this process: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue
And also, please read this for other options: https://stackoverflow.com/a/60944060/143475
Gatling senario is
val scn = scenario("First Test Scenario").exec( Login.login )
setUp(
scn.inject(constantUsersPerSec(100) during(20 seconds) )
.protocols(httpConf)
)
object Login{
val login = exec(http("Login")
.get("/auth/login")
)
}
It give me that error message:
21:24:23.863 [WARN ] i.g.h.a.ResponseProcessor - Request 'Login' failed: j.n.ConnectException: Failed to open a socket. what does that mean?
I'm really stuck with the cordova in app plugin..
I get the following error when i build the iOS app:
** BUILD FAILED **
The following build commands failed:
CompileC build/roma16.build/Debug-iphonesimulator/roma16.build/Objects-normal/i386/InAppPurchase.o roma16/Plugins/cc.fovea.cord
ova.purchase/InAppPurchase.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
ERROR building one of the platforms: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/patrickhofer/Documents/Apps/roma
16/platforms/ios/cordova/build-debug.xcconfig,-project,roma16.xcodeproj,ARCHS=i386,-target,roma16,-configuration,Debug,-sdk,iphonesimul
ator,build,VALID_ARCHS=i386,CONFIGURATION_BUILD_DIR=/Users/patrickhofer/Documents/Apps/roma16/platforms/ios/build/emulator,SHARED_PRECO
MPS_DIR=/Users/patrickhofer/Documents/Apps/roma16/platforms/ios/build/sharedpch
You may not have the required environment or OS to build this project
Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/patrickhofer/Documents/Apps/roma16/platforms/ios/cordova/build
-debug.xcconfig,-project,roma16.xcodeproj,ARCHS=i386,-target,roma16,-configuration,Debug,-sdk,iphonesimulator,build,VALID_ARCHS=i386,CO
NFIGURATION_BUILD_DIR=/Users/patrickhofer/Documents/Apps/roma16/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/patrickhofer/Do
cuments/Apps/roma16/platforms/ios/build/sharedpch
I also got this one before:
In file included from /Users/patrickhofer/Documents/Apps/roma16/platforms/ios/roma16/Plugins/cc.fovea.cordova.purchase/InAppPurchase.m:
9:
/Users/patrickhofer/Documents/Apps/roma16/platforms/ios/roma16/Plugins/cc.fovea.cordova.purchase/InAppPurchase.h:13:9: fatal error: 'Co
rdova/NSData+Base64.h' file not found
#import <Cordova/NSData+Base64.h>
^
1 error generated.
And i think this is strange as well:
In module 'Foundation' imported from /Users/patrickhofer/Documents/Apps/roma16/platforms/ios/roma16/Plugins/cordova-plugin-globalizatio
n/CDVGlobalization.h:20:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk/System/Library/Fram
eworks/Foundation.framework/Headers/NSCalendar.h:69:2: note: 'NSMinuteCalendarUnit' has been explicitly marked deprecated here
NSMinuteCalendarUnit NS_CALENDAR_ENUM_DEPRECATED(10_4, 10_10, 2_0, 8_0, "Use NSCalendarUnitMinute instead") = NSCalendarUnitMin
ute,
^
Here is what i did before:
ionic plugin add cc.fovea.cordova.purchase --variable BILLING_KEY="XXX"
and i added the logic in my app:
var app = angular.module('starter', ['ionic', 'pascalprecht.translate']);
app.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
if((window.device && device.platform == "iOS") && window.storekit) {
storekit.init({
debug: true,
ready: onReady,
purchase: onPurchase,
restore: onRestore,
error: onError
});
}
var onReady = function() { }
var onPurchase = function(transactionId, productId, receipt) { }
var onRestore = function(transactionId, productId, transactionReceipt) { }
var onError = function(errorCode, errorMessage) { }
if((window.device && device.platform == "iOS") && window.storekit) {
storekit.init({
debug: true,
ready: function() {
storekit.load(["unlockall"], function (products, invalidIds) {
console.log("In-app purchases are ready to go");
});
},
purchase: function(transactionId, productId, receipt) {
if(productId === 'unlockall') {
console.log("Purchased product id 1");
}
},
restore: function(transactionId, productId, transactionReceipt) {
if(productId === 'unlockall') {
console.log("Restored product id 1 purchase")
}
},
error: function(errorCode, errorMessage) {
console.log("ERROR: " + errorMessage);
}
});
}
if (window.cordova && window.cordova.plugins.Keyboard) {
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
// for form inputs)
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
// Don't remove this line unless you know what you are doing. It stops the viewport
// from snapping when text inputs are focused. Ionic handles this internally for
// a much nicer keyboard experience.
cordova.plugins.Keyboard.disableScroll(true);
}
if (window.StatusBar) {
StatusBar.styleDefault();
}
});
});
Any help much appreciated! I'm going crazy...
I struggled with this for a long time as well. This solution worked for me:
remove your cordova-plugin-purchase plugin
reinstall, cordova plugin
add https://github.com/j3k0/cordova-plugin-purchase.git
https://github.com/j3k0/cordova-plugin-purchase/issues/403
I am trying the following code:
if (sem_post(sem) == -1)
{
printf("syncr_release error %d\n", errno);
perror("Error:");
return ERROR;
}
and it's giving the following output:
syncr_release error 9
Error:: Bad file descriptor
I cannot find anything about that error code in the documentation about sem_post(). How can I solve this?
I do not understand clearly the code behind the "assert". Please tell me what does those mean.
I already put the params attribute above my code . I did not describe detail.
void testSave() {
controller.save()
println 'testSave() from Controller'
assert model.serviceAccountInstance != null
assert view == '/serviceAccount/create'
response.reset()
populateValidParams(params)
controller.save()
println params.passWord
assert response.redirectedUrl == '/serviceAccount/show/1'
assert controller.flash.message != null
assert ServiceAccount.count() == 1
}
Than you for your answer.