integration-testing

Can I change junit test execution order?

我的梦境 提交于 2019-12-11 02:37:14
问题 I am configuring my own Spring test runner and I try to define test execution order. But I want to change it in the process depending on failure of some test cases. Each test case configuration has it's own id and onFailId that indicates id of the next test to be executed in case of failure. If the test pass, simply the test with the next id is executed. There might be some scenarios when I want to rerun or execute earlier test again. How can I force this logic, e.g. in test failure listener?

Include helper not works

不羁的心 提交于 2019-12-11 02:35:49
问题 I'm trying to include some helpers to my test but I can't make that it works. I got the following error: /home/edu/.rvm/rubies/ruby-1.9.3-p392/bin/ruby -S rspec ./spec/features/customers_spec.rb ./spec/features/login_spec.rb ./spec/features/products_spec.rb ./spec/features/suppliers_spec.rb /home/edu/Desktop/rails_proyects/gg/spec/support/features.rb:2:in `block in <top (required)>': uninitialized constant MyHelp (NameError) from /home/edu/.rvm/gems/ruby-1.9.3-p392@gg/gems/rspec-core-2.14.6

Integration Testing with AutoMapper fails to initialise configuration

狂风中的少年 提交于 2019-12-11 02:21:06
问题 Frameworks & Packages .NETCoreApp 1.1 Xunit 2.2.0 AutoMapper 6.0.2 Microsoft.AspNetCore.TestHost 1.1.1 Microsoft.NET.Test.Sdk 15.0.0 Integration Test public class ControllerRequestsShould { private readonly TestServer _server; private readonly HttpClient _client; public ControllerRequestsShould() { _server = new TestServer(new WebHostBuilder() .UseContentRoot(Constants.apiProjectRoot) .UseStartup<Startup>() .UseEnvironment(Constants.testingEnvironment)); _client = _server.CreateClient();

Sending rails errors to rspec output

可紊 提交于 2019-12-11 02:11:38
问题 I am using Capybara in combination with rspec for integration testing of rails apps. I would like any errors (routing errors, errors in a controller, anything) generated during a test to be printed the same as "puts" statements in rspec's output. Is this possible? Additionally, is this a reasonable idea, or am I just being silly? 回答1: Adding the following to my spec_helper.rb file worked: ActionController::Base.class_eval do def rescue_action(exception) raise exception end end 来源: https:/

Dealing with duplication between unit and integration tests

∥☆過路亽.° 提交于 2019-12-11 02:03:36
问题 I have an algorithm implemented by a number of classes, all covered by unit test. I would like to refactor it, which will change behavior of two classes. When I change one class and its tests, all unit tests pass, though the algorithm becomes incorrect until refactoring is done. This example illustrates that complete coverage by unit tests is sometimes not enough and I need "integration" tests for the whole algorithm in terms of input-output. Ideally, such tests should cover the behavior of

Should I unit test concurrency?

自古美人都是妖i 提交于 2019-12-11 01:54:34
问题 I have a few methods that are impacted by concurrency. Specifically "Rush" (a.k.a Race) conditions. Should I unit test them or integrate/black-box test them? I think that setting up a unit test might be a rather difficult task, but also is integration test... 回答1: Unit tests must be deterministic, so concurrency doesn't belong there. (I keep my unit tests completely synchronous.) Go for integration tests to sniff out race conditions — but be prepared for false positives. In other words, the

Embedded or managed Oracle instance for integration tests

坚强是说给别人听的谎言 提交于 2019-12-11 01:37:59
问题 For MySQL, the MXJ connector makes it very easy to launch a managed MySQL instance. I know that Oracle provides Oracle XE for quick setup, but I've only found an RPM distribution that needs to be installed. Is there a neatly packaged jar that I can just drop in the classpath and start up by calling a specific JDBC url, a la HSQLDB or MXJ? I'm interested in having developers use this locally for running tests, as well as on our continuous integration server. 回答1: The short answer is No. Oracle

How to add stdin interaction with pytest

偶尔善良 提交于 2019-12-11 00:26:16
问题 I am writing integration tests for a system where I can automate most of the test via web service calls, but due to legacy-ness that I cannot change, I need a few steps to be done by manual testers. I wanted to use pytest and create a fixture that essentially pauses test execution and prompts the console for input (e.g. "Do XYZ in system; type 'done' when done") and continues with the remainder of the test. I admittedly haven't done a ton of hacking on this yet, but I see from pytest docs

Selenium: wait_for_* and friends in Selenium RC ruby driver

谁说我不能喝 提交于 2019-12-10 23:26:46
问题 Are there any implementations of all the nifty Selenium on Rails methods like wait_for_visible , assert_not_text_present , ... for the ruby driver of Selenium RC ? If not, how would I go about implementing something like wait_for_visible? 回答1: I solved my own problem. I found the official ruby client at the Git Hub Repository I wrote this solution so you can just require this code then you can use all the useful wait_for_*, assert_*, assert_not_*, wait_for_not_*, verify_*, and verify_not_*

assert_select first and second html table cell contents in rails

十年热恋 提交于 2019-12-10 21:45:36
问题 I have the following html table: <table class="list user_permission"> <tr> <th>Name</th> <th>Permission</th> </tr> <tr id="permission_1"> <td> test user01 </td> <td> Reading permission </td> </tr> </table> I want to assert in my tests the content of my first and second table cells. I tried it in the following way: assert_select "tr#permission_1 td", "test user01" assert_select "tr#permission_1 td", "Reading permission" But it didn't work, it couldn't find such a entry. 回答1: You could test