functional-testing

Symfony2 functional testing InvalidArgumentException: The current node list is empty

杀马特。学长 韩版系。学妹 提交于 2019-12-29 07:28:19
问题 I get "InvalidArgumentException: The current node list is empty." running functional tests through PHPUnit. Here is test i wrote: public function testAdd() { $client = static::createClientWithAuthentication('main'); $crawler = $client->request('GET', 'en/manage'); $send_button = $crawler->selectButton('submit'); $form = $send_button->form(array( 'PrCompany[email]' => 'test@example.ua', 'PrCompany[first_name]' => 'Anton', 'PrCompany[last_name]' => 'Tverdiuh', 'PrCompany[timezone]' => 'Europe

Grails Functional Testing - grailsApplication.config is null within controllers and services

时光毁灭记忆、已成空白 提交于 2019-12-29 06:31:08
问题 Grails 1.3.5 I've written a handful of functional tests and I'm running into issues when my controllers and services reference configuration data via grailsApplication.config. It is always coming back null, so it errors out. I know there is a mockConfig for unit tests. But how do I get the config to get wired up for functional tests? 回答1: This is the hack that I have done for a while, there might be a better way though def filePath = new File('grails-app/conf/Config.groovy').toURL() def

Does Unit Tests still matter if Functional Tests is satisfied?

偶尔善良 提交于 2019-12-25 16:44:04
问题 For a short summary: Unit tests are the smaller ones that expects something to do it right in dev's view. Functional tests are those that expects things are right in user's view If Functional Tests are already satisfied, do we still need to do Unit Tests? Most likely (let's use web development as context), this is common by using the browser to see if things are right by letting other users/people try the system/application. Let us put out other tests like for edge cases. 回答1: Are there any

Android test for Launching activity of Another app

纵饮孤独 提交于 2019-12-25 04:42:50
问题 In my App, I have a list view that shows all the currently installed apps in the system. Clicking on an item will select the next activity (one of the installed apps) to be launched. I am trying to add a Activity Test for testing that this happens. I have an expandable list view that holds the list of installed apps. // Get the child view of the list item that we want to launch final View v = mExpListData.getChildView(0, launched_app_pos, false, null, null); assertNotNull("Child List View

File upload in Intern.js

怎甘沉沦 提交于 2019-12-25 04:28:27
问题 It is written in documentation that it is possible to do things like file upload using intern. Can anyone provide an example of how this can be done? I searched through examples and through LeadFoot documentation and I can't find anything. Thanks. 回答1: You interact with a file input form field, just like an end-user would, with the exception that you simply “type” the absolute path to the file you want to upload from the test machine. return this.remote.findById('fileInput').type('/path/to

What to call test cases that are test integration with third-party services?

心已入冬 提交于 2019-12-25 04:25:19
问题 I have test cases, which make requests to real, not mocked, third-party services and verify that functions that handle responses are doing it correctly. I can't call them "functional", because they test only small pieces of code, that responsible to communication with third-party services. And I can't call them "unit" - because they hit real external services. What is correct name for them? 回答1: Those are called integration tests. Basically you have three types of tests: Unit tests, no

Yii2: loading fixtures for specific functional tests

不羁的心 提交于 2019-12-24 13:19:34
问题 Short version: Using Yii2 Advanced Application Template and Codeception functional tests, is there a way to load a specific fixture only before a particular scenario (Cest class)? (Background / side note: I have a vague feeling I might be approaching this wrong, since arguably, if tests should be completely isolated with regards to db, they should be unit tests and not functional ones. However, due to time constraints on the project I started with functional tests while postponing unit

Rails Can't find route in Functional Test

こ雲淡風輕ζ 提交于 2019-12-24 08:51:30
问题 Rails version 3.0.4 and Ruby 1.9.2 I'm using the devise gem, and have my application set up so that a user must sign in to perform any action. While writing my functional tests, I found that all of the test threw the same error. `method_missing': undefined method `new_user_session_path' This is strange as, if I rake routes I can see new_user_session GET /devise/login(.:format) {:action=>"new", :controller=>"devise/sessions"} I can also confirm that when I run the application, all of the link

c++ boost calculate time spent in function

天大地大妈咪最大 提交于 2019-12-24 07:40:44
问题 Hi again with a boost question: I need to calculate the time spent in my function in my boost thread: here is the code: boost::posix_time::microseconds tes( 12 ); int i = 0; while( true ) { boost::posix_time::ptime start = boost::posix_time::microsec_clock::local_time( ); myFunction( ); boost::this_thread::sleep( tes ); boost::posix_time::ptime end = boost::posix_time::microsec_clock::local_time( ); boost::posix_time::time_duration elapsed = end - start; } so I tried many times but the

Rails 3.2 Engines - routes not working in test cases

我的未来我决定 提交于 2019-12-24 06:00:57
问题 I mounted in my app the RailsAdmin engine ( according to the instructions from the wiki ) using mount RailsAdmin::Engine => '/backend', :as => 'rails_admin' I had to extend one controller from the engine to add a before_filter. When running my app in development, my extension and the other engine features are working perfectly. However I have an issue in writing functional tests using Test::Unit for my before_filter. The filter kicks in at the right moment and works as expected, but once the