testing

How to run all web tests by command line

浪子不回头ぞ 提交于 2020-01-05 15:19:51
问题 I have dedicated DLL project for webtests. I know how to run specified webtest C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE>mstest /testcont ainer:"MyPath\PostAccessToken.webtest" /resultsfile:MyResultPath\MyResults.trx But how can I run all webtests from this library by one command? If I give DLL path as testcontainer then I get message "no tests found" 回答1: Try this : MSTest /testcontainer:PostAccessToken.dll 来源: https://stackoverflow.com/questions/30575634/how-to-run-all

Ember Mocha tests fail when async (using ember-mocha-adapter)

久未见 提交于 2020-01-05 12:07:29
问题 I can't get mocha working with Ember due to the fact that it fails when a test of the following nature is executed: describe('Location Panel', function () { beforeEach(function () { App.reset(); visit('/map/41.76721,-72.66907'); }); it('Have proper address', function () { var $title = find('.panel-header h2'); expect($title).to.have.text('476 Columbus Blvd, Hartford'); }); }); Basically it can't find any of the DOM elements, because it runs the test before the route has finished loading.. The

Spring Data Neo4j 4.0.0.M1 Test Configuration

二次信任 提交于 2020-01-05 10:39:48
问题 I am very new to Spring Data and I am trying to configure my Spring Data Neo4j 4.0.0.M1 Test. It has taken me 2 days without any result and I can't seem to find any example on SDN4 to do this. Here is my simple test class : @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = MyConfigurationTest.class) @DirtiesContext public class ProjectRepositoryTests { @Autowired PlatformTransactionManager transactionManager; @Autowired ProjectRepository projectRepository; @Transactional

CakePHP core tests not working on IIS

北城以北 提交于 2020-01-05 10:31:31
问题 I'm following the steps (from http://book.cakephp.org/2.0/en/development/testing.html) to set up Testing on a CakePHP install. Viewing the core tests is supposed to be as simple as appending /test.php to my application's URL. But when I do that, I get an error page, saying... Missing Controller Error: Test.phpController could not be found. Error: Create the class Test.phpController below in file: my-app\Controller\Test.phpController.php Obviously, "test.php" is supposed to be a real file, not

CakePHP core tests not working on IIS

ぐ巨炮叔叔 提交于 2020-01-05 10:31:30
问题 I'm following the steps (from http://book.cakephp.org/2.0/en/development/testing.html) to set up Testing on a CakePHP install. Viewing the core tests is supposed to be as simple as appending /test.php to my application's URL. But when I do that, I get an error page, saying... Missing Controller Error: Test.phpController could not be found. Error: Create the class Test.phpController below in file: my-app\Controller\Test.phpController.php Obviously, "test.php" is supposed to be a real file, not

How to write integration test for complicated rails index (best practices)

僤鯓⒐⒋嵵緔 提交于 2020-01-05 10:14:28
问题 Let's say I have a page which lists articles. The code in the controller used to be # articles#index @articles = Article.paginate(page: params[:page], per_page: 10, order: :title) and my test was like # spec/requests/article_pages_spec Article.paginate(page: 1, per_page:10, order: :title).each do |a| a.should have_selector('h3', text: a.title) end Ok fine. Now my code changes a bunch. The index is like @articles = Article.find(:all, conditions: complicated_status_conditions) .sort_by { |a|

How should I unit test functions with many subfunctions?

随声附和 提交于 2020-01-05 09:36:18
问题 I'm looking to better understand I should test functions that have many substeps or subfunctions. Let's say I have the functions // Modify the state of class somehow public void DoSomething(){ DoSomethingA(); DoSomethingB(); DoSomethingC(); } Every function here is public. Each subfunction has 2 paths. So to test every path for DoSomething() I'd have 2*2*2 = 8 tests. By writing 8 tests for DoSomething() I will have indirectly tested the subfunctions too. So should I be testing like this, or

TEST-INJECTION and TEST-SEAM in ABAP code

泄露秘密 提交于 2020-01-05 09:22:15
问题 I’m trying to use TEST-INJECTION and TEST-SEAM in my code. I have following code: CLASS lcl_undertest DEFINITION. PUBLIC SECTION. CLASS-METHODS mymethod RETURNING VALUE(r) TYPE string. ENDCLASS. CLASS lcl_undertest IMPLEMENTATION. METHOD mymethod. TEST-SEAM vypis. r = 'abc'. END-TEST-SEAM. ENDMETHOD. ENDCLASS. CLASS ltc_testclass DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT FINAL. PRIVATE SECTION. METHODS test_method1 FOR TESTING. ENDCLASS. CLASS ltc_testclass IMPLEMENTATION.

TEST-INJECTION and TEST-SEAM in ABAP code

一笑奈何 提交于 2020-01-05 09:21:48
问题 I’m trying to use TEST-INJECTION and TEST-SEAM in my code. I have following code: CLASS lcl_undertest DEFINITION. PUBLIC SECTION. CLASS-METHODS mymethod RETURNING VALUE(r) TYPE string. ENDCLASS. CLASS lcl_undertest IMPLEMENTATION. METHOD mymethod. TEST-SEAM vypis. r = 'abc'. END-TEST-SEAM. ENDMETHOD. ENDCLASS. CLASS ltc_testclass DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT FINAL. PRIVATE SECTION. METHODS test_method1 FOR TESTING. ENDCLASS. CLASS ltc_testclass IMPLEMENTATION.

How to make APK that can launch my Robotium test?

房东的猫 提交于 2020-01-05 09:04:34
问题 (A) App to test (eg. Browser) (B) Test app. (extends ActivityInstrumentationTestCase2) (Robotium) (C) Launcher (like "devTools" -> Instrumentation) How can I create an APK(C) that can launch the Test app(B). 回答1: public class Main extends Activity { protected List<InstrumentationInfo> mList; protected ComponentName mBrowserTestComponent; protected final static String TARGET_PACKAGE = "com.android.browser"; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate