testing

Assert an array reduces to true

无人久伴 提交于 2019-12-23 08:56:19
问题 In one of the tests, we need to assert that one of the 3 elements is present. Currently we are doing it using the protractor.promise.all() and Array.reduce(): var title = element(by.id("title")), summary = element(by.id("summary")), description = element(by.id("description")); protractor.promise.all([ title.isPresent(), summary.isPresent(), description.isPresent() ]).then(function (arrExists) { expect(arrExists.reduce(function(a,b) { return a || b; })).toBe(true); }); Is there a better way to

Are tests executed in parallel in Go or one by one?

大城市里の小女人 提交于 2019-12-23 08:48:35
问题 I have a Go file with unit tests and some of them use a common variable. Another global variable is used in the code that I'm testing. All of this can cause a problem. In Go when we execute tests that are located in the same file how does they run? In parallel or next one will not start before previous one is finished ? 回答1: It's really easy to test it: func Test1(t *testing.T) { fmt.Println("Test1 start") time.Sleep(time.Second * 2) fmt.Println("Test1 end") } func Test2(t *testing.T) { fmt

Example PHPUnit Test on Laravel 5.4 fails with 404

≯℡__Kan透↙ 提交于 2019-12-23 08:29:30
问题 I can my project on Laravel 5.4 from link: localhost:8888/streaming_statistic/public I have a test: <?php namespace Tests\Feature; use Tests\TestCase; use Illuminate\Foundation\Testing\WithoutMiddleware; use Illuminate\Foundation\Testing\DatabaseMigrations; use Illuminate\Foundation\Testing\DatabaseTransactions; class ApiTest extends TestCase { public function testBasicTest() { $response = $this->get('/'); $response->assertStatus(200); } } I run all tests with command ./vendor/bin/phpunit But

sqlite database table is locked on tests

可紊 提交于 2019-12-23 08:08:13
问题 I am trying to migrate an application from django 1.11.1 to django 2.0.1 Tests are set up to run with sqlite in memory database. But every test is failing, because sqlite3.OperationalError: database table is locked for every table. How can I find out why is it locked? Icreasing timeout setting does not help. I am using LiveServerTestCase , so I suppose the tests must be running in a different thread than the in memory database, and it for some reason does not get shared. 回答1: I hit this, too.

WSDL Testing

落花浮王杯 提交于 2019-12-23 07:53:08
问题 Has anybody worked on wsdl testing? Namely, Schema validation Semantic validation Regression testing of WSDL Interoperability Does anybody have an idea of how to implement the above? 回答1: I use SoapUI for all my SOAP/REST testing. It does all the things that you want and is probably one of the most widely used tools out there. It can also be integrated as an API. Integrating with SoapUI 回答2: For interoperability testing of WSDL 's the toolkit I would recommend is that which is published by

indexOf is not a function in Firefox, Opera but works in IE, indexOf alternative in javascript to test string contains?

ぐ巨炮叔叔 提交于 2019-12-23 07:51:44
问题 Getting an error using indexOf call in Javascript on Firefox and Opera. Works fine in IE. Following is the error message: Action function anonymous(Grid, Row, Col, Event) { return Grid.ActionShowPopupMenu(); } for event OnRightClick failed with exception: row.id.indexOf is not a function I'm testing that a string contains another string in Javascript and using the indexOf function of a string. The calls however are being made in JQuery functions. Perhaps that is the reason for the problem? Is

Element is not clickable at point - Protractor

风流意气都作罢 提交于 2019-12-23 07:49:27
问题 I'm getting an error that element I am trying to click on is not click able which I belieave is not true. My error looks: 1) Open VehiclePage and populate data Populate vehicle data Message: UnknownError: unknown error: Element is not clickable at point (1315, 371). Other element would receive the click: <div class="form-con rol combo-options ng-scope ng-animate ng-leave ng-leave-active" ng-if="comboBox.visible" on-click-outside="comboBox.hide">...</div> (Session info: chrome=39.0.2171.71)

Random error when testing with NHibernate on an in-Memory SQLite db

筅森魡賤 提交于 2019-12-23 07:47:43
问题 I have a system which after getting a message - enqueues it (write to a table), and another process polls the DB and dequeues it for processing. In my automatic tests I've merged the operations in the same process, but cannot (conceptually) merge the NH sessions from the two operations. Naturally - problems arise. I've read everything I could about getting the SQLite-InMemory-NHibernate combination to work in the testing world, but I've now ran into RANDOMLY failing tests, due to "no such

Akka actors unit testing with Scala

房东的猫 提交于 2019-12-23 07:40:16
问题 I'm fairly new to Scala so please be gentle. In the app I'm currently building, I'm using Akka actors and I want to write some unit tests. I came across this official documentation for writing unit tests for Akka actors but I couldn't understand exactly how it should work. In particular, val actorRef = TestActorRef(new MyActor) // hypothetical message stimulating a '42' answer val future = actorRef ? Say42 val Success(result: Int) = future.value.get result must be(42) When I try that, I get

Should failing tests make the continuous build fail?

瘦欲@ 提交于 2019-12-23 07:38:33
问题 If one has a project that has tests that are executed as part of the build procedure on a build machine, if a set tests fail, should the entire build fail? What are the things one should consider when answering that question? Does it matter which tests are failing? Background information that prompted this question: Currently I am working on a project that has NUnit tests that are done as part of the build procedure and are executed on our cruise control .net build machine. The project used