How to fail a test case in Test if any js error is found by Test Rigor? - testrigor

I am running a test case in my Test Rigor suite.It is getting passed but I can see some errors in the Test steps that were executed.
Error: JS SEVERE: 52:61 Uncaught TypeError: Cannot read properties of undefined (reading 'toString')
Issue is that Test Rigor is passing all these test cases.I want it to fail the test case in case any such errors are found.Is there any way to do this?

The fail with "error" command will fail a script. To do it within javascript,
try:
testRigor.execute('fail with "error"');
For javascript errors detected on a page, testcases will note those errors by changing the color of the screenshot, however, they will not fail the test as they are exposed as "minor" errors. There is currently no way to detect these errors. You could put in an enhancement request.

Related

Production Code's General try-catch Eats nUnit Assertion Exceptions Causing the Failing Tests to Pass

I understand that nUnit failed Assert statements throw an exception, and that's how Test runners detect an error has occurred. My problem is that there is a general try-catch block in the production code that eats these Assert exceptions, and the Unity Test runner thinks the code is running without any issue. I've simplified the code to this:
[UnityTest]
public IEnumerator End2EndTests_Test_Foo()
{
try
{
Assert.Fail("Something is wrong.");
}
catch (Exception)
{
UnityEngine.Debug.Log("* Something went wrong. I ate this exception! yum yum *");
}
yield break;
}
As I mentioned, this test passes in Unity Test Runner. What's the remedy?
Note 1: I have not put any assertion inside the production code. The assertions are in callbacks that are invoked by the production code. If any exception happens in the callbacks, the production code catches them. That's how the failed assertion exceptions are caught by production code, not the Test runner.
Note 2: Some background: The production code sends a request to a server. When it receives a response, it invokes all subscribers (=callbacks). My test code has subscribed to the OnResponse event. The failed assertion is inside that callback. The general try-catch is inside the production code, embracing the invocation of the OnResponse event.
Note 3: I don't want to put a special catch statement for nUnit in the production code and re-throw the exception. That's a bad solution because the production code should not have any dependency on a testing framework.
It's OK for your test to subscribe to the callbacks, but you can't assert in the method that the callback invokes. All you can do is record information.
The test itself, after installing the callback should wait for it to be callback to complete and then assert on the saved information.

Fastlane script execution

I am trying to execute the lanes which are declared in the Fastfile.ios files, but i am getting below error. Could any one please help me out.
An error occurred while executing the error block:
Could not find action, lane or variable 'current_action'. Check out the documentation for more details: https://docs.fastlane.tools/actions

Commands invalid after 'import_board_preset' command

Currently I am trying to follow the MathWorks tutorial 1 to register a TE0720 with a TE0701-6 carrier board in Matlab. I followed the instructions, designed the block design and exported it as advised. Using the Matlab HDL Workflow Advisor I can follow unitl step 4.1 Create Project. Here, I get the following error message:
invalid command name "CONFIG.PCW_INCLUDE_ACP_TRANS_CHECK"
while executing
"CONFIG.PCW_INCLUDE_ACP_TRANS_CHECK {0} CONFIG.PCW_IOPLL_CTRL_FBDIV {30} CONFIG.PCW_IO_IO_PLL_FREQMHZ {1000.000} CONFIG.PCW_IRQ_F2P_INTR {1} CONFIG..."
(procedure "create_root_design" line 49)
invoked from within
"create_root_design """
(file "vivado_custom_block_design.tcl" line 986)
while executing
"source vivado_custom_block_design.tcl"
(file "vivado_create_prj.tcl" line 15)
This is regarding the exported block design in the corresponding *.tlc file.
After deleting the line mentioned in the error, the error persists, but for the following line. This holds true until I deleted all lines following
CONFIG.PCW_IMPORT_BOARD_PRESET {preset}
It seems to me that once the preset for the board is imported, all following commands are seen as invalid. If I put this line in the end of the list though, I get the error
ERROR [Common 17-69] Command failed: Missing name/value pair in -dict argument.
If I remove this line, I get the error
ERROR [BD 41-1811] The interconnect </axi_interconnect_0> is missing a valid master interface connection
ERROR [Common 17-39] 'validate_bd_design' failed due to earlier errors.
Is there a way to fix this or what is the problem here?
EDIT: I am using Vivado 2017.4 from the Vivado HL WebPACK. Could it be that there is a feature not available in this version for rebuilding the project as MATLAB intends to do?
EDIT 2: I started the complete tutorial fresh from scratch again and now I only get the error
ERROR: [BD 41-1811] The interconnect </axi_interconnect_0> is missing a valid master Interface connection
when going throught the HDL Workflow Advisor. As far as I understand the issue, Vivado searches for something to connect the axi_interconnect to. But isn't this the interface port (DUT) as described later in the tutorial (end of step 2 in Register the custom reference design in HDL Workflow Advisor, where the compiled simulink model should be connected?

Sails.js unit testing getting uncaught error

Being working with sails.js and i was writing test cases using MOCHA and grunt am getting Uncaught error. I searched over net but i didn't get clear solution. how to get started with sails.js unit testing?
1) "before all" hook:
Uncaught Error: listen EADDRINUSE
at exports._errnoException (util.js:746:11)
at Server._listen2 (net.js:1156:14)
at listen (net.js:1182:10)
at Server.listen (net.js:1267:5)
at Object.module.exports.bootstrap (config/bootstrap.js:16:3)
this above error am getting while running 'grunt test', thanks.
Update:
Actually there are two servers running so that created this issue. just kill one server it works fine.

Scala^Z3 kills running Thread on parser error

When I use Scala^Z3 (Z3 3.2 and according Scala^Z3 java library) and get a parser error like:
(error "line 21 column 41: invalid command, '(' expected")
Error: parser error
The executed Thread is killed and I cannot stop this by surrounding
the code with try/catch or anything.
Is there any way to stop this behaviour?
I am afraid there is not much to do: there is supposedly a call to exit in the Z3 library, and that is what causes this behavior.
As far as I understand the Java Native Interface, I cannot prevent the native function from terminating the process. The best I could do is add an exit hook to the JVM that could warn the user that the program is terminating due to external reasons, but that won't let you resume where you were in the control flow.
The ideal solution is of course that Z3 is updated so that no function in the public interface ever calls exit.