I updated Chrome from 81 to 83. Prior to that update all of my Karma unit tests were passing successfully. Now, my HeadlessChrome unit tests are failing because Chrome never connects. Has anyone ran into this issue?
I am currently on a Windows 10 machine, if that makes any difference.
Related
I am very new to TeamCity and I was asked to upgrade JUnit to the newest version in our project. During my upgrade I had to update some tests, because JUnit API has changed. Now I would like to run all the tests, to be sure that I haven't damaged anything. We have set up CI using TeamCity, where all the tests should be run during the build, but what is happening is that only one test is triggered (normally it is over 200). I am not sure if it is because I have changed only the unit tests and there was no change in the code, but I would like to force trigger all the tests. Could someone please help me to achieve this. Thanks a lot.
We use Jenkins as our CI, and im looking to have Jenkins run visual studio tests. Ive figured out how to have Jenkins use vstest.console.exe for desktop applications, but im not sure how to get that to work for windows phone 8.1 tests. I'm running vstest.console.exe against my unit test project's appx file, but im getting:
Error: App package ...appx does not has test executor entry point. For
running unit tests for Windows Store apps, create app package using
Windows Store app Unit Test Library project.
Any help getting the program to work thorugh command line would be of big help, but if there is a short cut to run it through jenkins that would be even better.
I found an answer to my problem. Make sure to use /InIsolation, and use /Settings:{settingsFile}. For some reason vstest.console.exe cant run the unit tests for windows phone without specifically setting a settingsfile. In jenkins/vsTestrunner there is an option to set the settings file. You will likley still get an error regarding running the test in non-interactive way on jenkins, but there are a few stackoverflow posts about this already.
I have a project that I am usually debugging/running using the grails run-app command. I would like to run a test but without having the server run again only for the specific test.
I usually run the server in debug mode all the time in the background.
I've tried playing around with the run configurations in iteli-j, with latest try being grails test-app functional: className
In Grails 2.4.4 if you override the baseUrl you can run your tests against a server other than localhost. For example, we have a pre-production server hosted on AWS and we run a subset of our functional tests against it from Jenkins, post-deploy, as a smoke test.
grails -plain-output test-app -baseUrl=https://foo.bar.org/ -echoOut -echoErr functional:
That works, but test-app still starts the embedded tomcat server. However, with a bit of digging, I found that overriding the server host to point to a running instance will cause the tests to run without starting the embedded tomcat. There are a couple of ways to accomplish this:
Pass the value on the command line:
grails -plain-output test-app -Dgrails.server.host=foo.bar.org -baseUrl=https://foo.bar.org/ -echoOut -echoErr functional:
Or, overriding the value in Config.groovy for the specific environment should also work:
...
preProd {
...
grails.server.host = 'foo.bar.org'
...
}
...
It isn't documented under test-app, but it is mentioned under run-app and it turns out it works for test-app too.
This works because Grails determines if the embedded server should be started by trying to open a connection to the server host/port, and if successful skips the startup.
From trial and error I have discovered that I have the best results when I specify both grails.server.host and -baseUrl even though the base url becomes redundant information. Possibly this is because my case involves an ssl connection, but I tried running with -https instead of -baseUrl=... and the tests just hung.
This plugin maybe helps you.
Grails functional-test-development Plugin
This plugin aims to make developing functional tests for Grails more convenient by facilitating running your tests against an already running application. It utilises the improved functional testing support added in Grails 1.3.5 and does not work with earlier versions.
I'm using the example project at https://github.com/geb/geb-example-grails
For some reason, when I run grails test-app functional: it doesn't pick up any tests. It says...
|Loading Grails 2.3.1
|Configuring classpath
.
|Environment set to test
........................................................
|Tests PASSED - view reports in C:\Users\user\src\geb-example-grails\target\test-reports
No browser is opened (what I'm used to with webdriver) and when I view target\test-reports\html\all.html I get...
Unit Test Results - All tests
No tests executed.
I've tried executing with
grails test-app functional:
grails test-app -functional
grails test-app
None appear to run any tests. I've also upgraded the project to grails 2.3.6 with the same result. Am I running the tests incorrectly? Has anyone else had this issue?
Update
I was able to reproduce this problem on my Mac in addition to the Windows 7 machine. When I run on the Mac with...
grails test-app -Dwebdriver.chrome.driver=/Applications/Google\ Chrome.app/Contents/MacOS/chromedriver
Then no tests are run and it reports that all tests pass. (same as the windows machine)
However, when I run via
grails test-app
The tests are run, Google Chrome is launched but no navigation takes place (I suspect I have an outdated chromedriver somewhere in the PATH on the Mac.)
Update 2
After running with...
grails test-app -Dgeb.env=firefox
The tests are found and executed. No nagivation takes place until updating the BuildConfig.groovy with the latest selenium (2.40.0, a webdriver issue I'm familiar with).
With this in mind, I decided to check that the chromedriver was installed properly. While I had placed the chromedriver.exe in the same location as google chrome. I hadn't added that location to my PATH. After doing so... Eureka! Tests run and execute with 100% Passed! Thanks #spikeheap for your suggestion! It appears that tests won't run unless you have the webdriver for your browser setup properly (strange to me, but ok).
I can't reproduce that error. Using 2.3.1 the tests are executed. Have you got the ChromeDriver present? If not I'd expect to see a load of errors...
You could try grails test-app functional: -Dgeb.env=firefox which will attempt to use the FirefoxDriver. If you've got Firefox installed this should work without any additional configuration.
If that doesn't give you anything, try grails test-app functional: PersonCRUDSpec, which will explicitly try to run that test.
I'd like to run Selenium tests on CI server so I need running live server before run tests. I subclass HttpTestCase, write some tests using Selenium, then I do like here http://devel.almad.net/docs/django-sane-testing/usage.html#running-tests:
set DJANGO_SETTINGS_MODULE=settings_test
set PYTHONPATH=.
nosetests myapp.tests:MyHttpTestCase --with-django
Seems it's creating DB, then it connects to Selenium and run FF (I see that two FF windows). But then it fails, saying it can't connect. I suppose this is because of it didn't start developer server.
Don't know where I'm wrong, seems I was doing it by instruction...
Pass --with-djangoliveserver to nosetests:
nosetests myapp.tests:MyHttpTestCase --with-django --with-djangoliveserver