When I run/debug each testcases individually the application get closed.Even after CloseOnPlaybackCleanup set to false - coded-ui-tests

I'm trying to prevent the application from getting closed after a test run. My case I'm running each test case individually but I need my application to open even after the test case run. I tried declaring the application under test CloseOnPlaybackCleanup to false in [TestIntialize] and [ClassIntialize] but nothing worked. Can someone please suggest to me how can we handle this?

Related

Forge design automation for Revit fail after our code finish

We are experimenting with Design automation for Revit and have gotten stuck on a failure that is hard to debug:
basically our code finish and then forge takes over and fails.
Here is part of the log: I have marked in green what part are "our" logs:
Basically the app takes an rfa and should output a json.
I have defined the activity like this:
What can I do to investigate what is causing this issue?
I found the issue:
you need to explicitly set the Succeeded property to true on the DesignAutomationReadyEventArgs. Otherwise it will report as failed.

Mock test case get failed unexpectedly

When I locally execute my mock test in c# then my test case gets passed but when I queue my build to azure then some of the random test cases fail which was getting passed locally? Any solution on this?
I got to know this was getting failed because my mock object was static. Check my another question Why my few test case get failed after "Running all" controller and pass individually?

MongoError: Cannot create collection users - database is in the process of being dropped

I have a REST API and I'm writing TDD for this project. My TDD is consisted of two parts: route and service. I chose to use Jest. I have a MongoDB database that I use for testing. When each test is completed, I reset my database using the afterAll() method. In this method, I run the mongoose.connection.dropDatabase function.
There is no error when I ran only one test file but when I run multiple test files, I get an error. The error message:
MongoError: Cannot create collection auth-db.users - database is in
the process of being dropped.
I share sample codes with you:
users.route.test.ts:
https://gist.github.com/mksglu/8c4c4a3ddcb0e56782725d6457d97a0e
users.service.test.ts:
https://gist.github.com/mksglu/837202c1048687ad33b4d1dee01bd29c
When all my tests run, "sometimes" gives errors. I wrote the above error message. The reason for this error is that the reset process still continues. I can't solve this problem. I'd appreciate it if you could help.
Thanks.
https://jestjs.io/docs/en/cli.html#runinband
What you are looking for is --runInBand command. Which makes jest to run serially instead of creating a worker pool of child processes that run tests

Fail/terminate node.js process if Mithril Ospec tests fail

When I run unit tests via Ospec for Mithril, I can see if tests fail locally in the console.
What I'm looking for is a solution that will not allow a following Node.js build script to execute if one or more of the tests fail.
I don't want code to be pushed up to another environment/lane if the unit tests aren't passing.
I don't see how to accomplish this in the docs.
In Node, I'm running ospec && someBuildProcess.
The answer might be a Node.js thing, but I'm at a loss for what to look for now.
ospec calls process.exit(1) if any tests fail, and the command string you posted should work. I just verified it locally with the following setup:
https://gist.github.com/tivac/d90c07592e70395639c63dd5100b50a6
ospec runs, fails, and the echo command never gets called.
Can you post some more details about your setup?

Intermittent IE timeouts and COMExceptions when running Watin tests with Nant and CruiseControl

We’ve been using Watin and CruiseControl.net for a few weeks now and most of the time they work together well. We have not had any problems running the tests on our developer machines. We are also able to run the tests interactively without problems when logged into the CI server.
Most of the time there are also no problems when the tests are executed under CruiseControl but this is not always the case as we’ve recently been seeing intermittent errors. The errors seem to come and go somewhat randomly but when an error does occur, it’s always one of the following:
WatiN.Core.Exceptions.TimeoutException: Timeout while Internet Explorer busy
System.Runtime.InteropServices.COMException: Creating an instance of the COM component with CLSID {0002DF01-0000-0000-C000-000000000046} from the IClassFactory failed due to the following error: 800704a6
Our CI server environment is:
Windows Server 2008 R2
IIS 7.5
IE 8
Watin 2.0
CruiseControl 1.6.7981.1. This is running as a service which logs in as a user on our domain because the tests need to access resources on the domain.
The 'randomly' failing tests create their IE instances as follows:
[TestMethod]
public void SomeTest()
{
using (var browser = new IE())
{
// run tests here
}
}
I also tried creating the IE in a new process as follows:
[TestMethod]
public void SomeTest()
{
using (var browser = new IE( true))
{
// run tests here
}
}
But when I did that, all of our tests failed with a “WatiN.Core.Exceptions.BrowserNotFoundException: Could not find an IE window matching constraint: Timeout while waiting to attach to newly created instance of IE.. Search expired after '30' seconds”
So, I have two questions:
Can anyone tell me how I can stop the timeouts and com exceptions?
Can anyone explain why IE(true) didn’t work at all?
TIA,
Mike
See this answer by Carl Hörberg:
Running Watin on TeamCity
CruiseControl.Net and TeamCity have the same problem when running as a service and the work-around should work for both environments.
By default, the ccservice runs as Local System, does not have access to interact with the desktop UI, and the Local System account privileges are limited and that's most probably what is causing the TimeoutException, COMException, and BrowserNotFoundException from being thrown.

Resources