Unable to call utilities in another module of karate maven project - karate

I am getting following exception when trying to call feature file of another module from different module with logs as,
org.graalvm.polyglot.PolyglotException: TypeError: Access to host class utils.Utils is not allowed or does not exist.
Following is the file which I am trying to run as,
https://github.com/bipin-k/karate-automation/blob/master/sample-automation/src/main/java/sample.feature
https://github.com/bipin-k/karate-automation
karate error description

Please read this answer for hints on how to handle re-use across Java modules: https://stackoverflow.com/a/58339662/143475
Recommendation is to avoid it as far as possible. And things like call read('../../../../core-utilities/src/main/java/java-functions-calls.feature') lead to un-maintainable tests: https://stackoverflow.com/a/54126724/143475
Most likely the problem is because in the project where you make the call - the utils.Utils class is simply not on the Java "classpath". You should probably take the help of someone who knows Java well, or stick to a simpler "single module" Java project.

Related

Configuring UnetStack in Intellij IDEA

I'm trying to use IntelliJ IDEA for my UnetStack Project.
I'm following this blog
https://blog.unetstack.net/using-idea-with-unetstack
I get this error when done following this:
Error: Could not find or load main class org.codehaus.groovy.tools.GroovyStarter
I had the same issue.
This happened to you because you ran your simulation as a groovy script and not as the configured application. Run it as application and groovyStarter will not even be used.

ReferenceError: raygunUtilityFactory is not defined

I am trying to implement raygun for a react-native app. I am running into problems with jest and I am not sure of the best approach given the window does not exist. In my package.json I have already added the following:
"globals": {
"window": {}
}
I get the following error though and I am unable to resolve it as of yet:
ReferenceError: raygunUtilityFactory is not defined
This is a very basic implementation as per the docs:
https://raygun.com/docs/languages/javascript#reactnative
I presume this is something with jest but having searched on github, here and google I still have not been able to resolve this.
Raygun4JS does not currently work correctly in a non-browser environment. Your best bet would be to not include the Raygun4JS code inside of your test environment (which is what we do at Raygun) but that is a bit more complicated using the UMD module from NPM (we use the snippet approach to inject it dynamically).
I think the problem stems from window not being considered the global object in Jest vs the browser, we have an indirect call to the window object to call the raygunUtilityFactory. Are you using the jsdom test environment? We also have the same window definition in our jestconfig.json and export some variables onto window in our setupframework.js file that are accessed indirectly through the global object and it appears to work correctly.

How to add Gmagick class(Load library) to Codeception?

I'm trying to use Gmagick from codeception, and i get:
[Error] Class 'Helper\Gmagick' not found
or if i try calling Gmagick(); directly from the test:
[Error] Class 'Gmagick' not found
I've set up Gmagick and can use it i.e. if i create a standalone *.php file on my apache server, i can call Gmagick(); without ever declaring anything else.
If I try the same from within Codeception, I get aforementioned error. I suppose there's some simple fix to this but I can't get any useful info from Codeception's documentation, and i can't find any useful info on the internet/SO either.
Any help would be appreciated. Thank You :)

Yii CAssetManager.basePath is invalid on PHPUnit test

i have a problem to run test. My model use extension Yii mail and then i run test its fail with wrong assert path. Another test runs finaly (model dont use any extensions). Preloading is only log.
I had a similar error and I explicitly set the basePath in config/test.php.
'components'=>array(
...
'assetManager'=>array(
'basePath'=>dirname(__FILE__).'/../../assets',
)
)
Im solved problem
public function setUp(){
Yii::app()->assetManager->basePath = '../../asserts';
}
Im dont know why this error throw only in one model...
PhpUnit runs primary in CLI mode and therefore some of environmental variables are missing. Yii's AssetManager uses one of such variable to determine webroot and since the variable does not exist, it will either throw error or set up invalid assets path on first attempt.
In my opinion, this issue is (indirectly) caused by PHPUnit because it only supports CLI testing mode, which makes some things really more difficult to test than it would be in HTTP request mode. Some guys therefore wrote tools to run unit tests via standard web GUI with whole native HTTP environment (e.g. https://github.com/NSinopoli/VisualPHPUnit). Eventually, you may use HTTP clients like Selenium to run your tests as if clicking over the page (see http://phpunit.de/manual/3.7/en/selenium.html).
Nevertheless, it's a matter of subjective opinion - somebody may argue, that testing in CLI mode has advantages, some guys will hate it. But the fact is, that one has to bear in mind differences between HTTP and CLI mode.

Reflexil deobfustication error

I'm trying to modify a .net application and I'm new to this. First step is attempting to deobfuscate the code using reflexil and I get the following error:
Reflexil is unable to clean this assembly: Member 'System.RuntimeTypeHandle "bunch of obfustatcated jibberish"(System.Int32)' is declared in another module and needs to be imported
The application comes with a bunch of dll's that it certainly uses, so I assume the declaration is in one of those files. How do I import this module?
In case it's helpful, reflexil says it was obfuscated with .NET Reactor 4.1
I decided to try de4not to deobfuscate and it worked without this issue.