testing

Running multiple browser instances in the same test spec

﹥>﹥吖頭↗ 提交于 2019-12-22 11:34:12
问题 If I have a single spec that is using page object model, how do I run multiple browser instance for that same spec? For example I have spec: it('should run multi browser', function() { browser.get('http://example.com/searchPage'); var b2 = browser.forkNewDriverInstance(); b2.get('http://example.com/searchPage'); var b3 = browser.forkNewDriverInstance(); b3.get('http://example.com/searchPage'); SearchPage.searchButton.click(); b2.SearchPage.searchButton.click(); //fails here b3.SearchPage

Android Test Frameworks

不羁岁月 提交于 2019-12-22 11:29:33
问题 I am new to Android test frameworks ,Would like to know the differences between existing test frameworks : Monkey , CTS ,Instrumentation Framework & Robotium ? 回答1: Instrumentation is a category of testing, opposite to Unit-testing. The framework provides hooks for instrumentation testing, but you are going to need an additional third-party framework to really get going. Robotium is such a framework. It allows you to write "scripts" that run through the user interface, saying "click this",

Mock Y of (from X import Y) in doctest (python)

混江龙づ霸主 提交于 2019-12-22 10:59:49
问题 I'm trying to create a doctest with mock of function that resides in a separate module and that is imported as bellow from foomodule import foo def bar(): """ >>> from minimock import mock >>> mock('foo', nsdicts=(bar.func_globals,), returns=5) >>> bar() Called foo() 10 """ return foo() * 2 import doctest doctest.testmod() foomodule.py: def foo(): raise ValueError, "Don't call me during testing!" This fails. If I change import to import foomodule and use foomodule.foo everywhere Then it works

Run Unittest On Main Django Database

不羁岁月 提交于 2019-12-22 10:56:53
问题 I'm looking for a way to run a full celery setup during django tests, asked in this other SO question After thinking about it, I think I could settle for running a unittest (it's more of an integration test) in which I run the test script against the main Django (development) database. Is there a way to write unittests, run them with Nose and do so against the main database? I imagine it would be a matter of telling Nose (or whatever other framework) about the django settings. I've looked at

Testing Android Room with LiveData, Coroutines and Transactions

血红的双手。 提交于 2019-12-22 10:49:07
问题 I want to test my database layer and I have caught myself in a catch-22 type of a situation. The test case consists of two things: Save some entities Load the entities and assert the database mapping works as expected The problem, in short, is that: Insert is a suspend method, which means it needs to be run in runBlocking{} Query returns a LiveData of the result, which is also asynchronous. Therefore it needs to be observed. There's this SO question that explains how to do that. In order to

WPF, Project White and Infragistics

你离开我真会死。 提交于 2019-12-22 10:46:02
问题 I am trying to use Project White to write automated tests for my WPF application. It is all going well until I try to interact with Infragistics controls. Has anyone had any experience of this set up and would you be able to post an example of how I can (for example) interact with the XamRibbon or XamOutlookBar? 回答1: Bit of a generic answer I'm afraid, but if White isn't helping you, you can use Microsoft UI Automation directly. First, find your control. If it's got a WPF "Name" then it

Jenkins test result parsing

馋奶兔 提交于 2019-12-22 10:30:56
问题 I've got a Jenkins with a lot of jobs. These jobs do tests and produce test outputs in XML. Those XML test results look - pretty standard - like this: <testsuites name="testsuitesname"> <testsuite name="testsuitename"> <testcase classname="classname" name="testcasename"> blabla </testcase> </testsuite> </testsuites> When you use the Post-build action Publish JUnit test result report (found on the configuration page of a job) the structure of those published results of a build (in Jenkins)

How to pass string and dictionary in NUnit test cases?

时光毁灭记忆、已成空白 提交于 2019-12-22 10:19:02
问题 I want to make test for my method and I can pass 2 string variables, but I don't know how to pass the Dictionary<,> . It looks like this: [Test] [TestCase("agr1", "askdwskdls", Dictionary<TypeMeasurement,double>)] public void SendDataToAgregator_GoodVariables_ReturnsOn(string agrID,string devID, Dictionary<TypeMeasurement, double> measurement) { } TypeMeasurement is enum and I know that this is not how you pass dictionary, but I don't know how, so I place it there so that you know what I want

Creating a TestActorRef results in NullPointerException

喜欢而已 提交于 2019-12-22 10:11:54
问题 I am trying to get a TestActorRef like that class NotifySenderTest(_system: ActorSystem) extends TestKit(_system) with ImplicitSender with WordSpecLike with Matchers with BeforeAndAfterAll with BeforeAndAfter { def this() = this(ActorSystem("NotifySenderTest")) override def afterAll { TestKit.shutdownActorSystem(system) } "A NotifySender" must { "be able to process the required messages" in { val actorRef = TestActorRef[NotifySender] //Line 92 } } the this actor class NotifySender extends

How to be sure that Android application will work on every device

眉间皱痕 提交于 2019-12-22 10:06:22
问题 I have a beta application, which runs successfully on three Android powered devices: Google Nexus One, Nexus S, and Motorola Defy+. How can I be sure that it will work on every single Android device with android 2.3+? Thanks! 回答1: Own testing You can be 100% sure when you have tested it on each phone. Of course that is very impractical in reality. So, I would follow these steps to make sure app works with different resolutions, manufactures, and phones vs tablets: Test with phones with