integration-testing

How do you test an Android application across multiple Activities?

大憨熊 提交于 2019-11-28 02:42:18
We are building a complex Android application consisting of many screens and workflows spread across many Activities. Our workflows are similar to what you might see on a Bank's ATM machine, for example, there is an Activity to login in that transitions to a main menu Activity which can transition to other activities based on the user's choices. Since we have so many workflows we need to create automated tests that span multiple activities so we can test a workflow from end to end. For example, using the ATM example, we would want to enter a valid PIN, verify that sends us to the main menu,

Implementing Repository pattern and doing Tests

馋奶兔 提交于 2019-11-28 02:02:15
问题 I have read almost all articles about Repository pattern and different implementations of it. Many of them judged bad practices (ex: using IQueryable<T> instead of IList<T> ) etc. that why i'm still stuck and couldn't end-up to the right one. So: Do I need Repository pattern to apply IoC in my MVVM applications ? If yes, What is the efficient IRepository implementation to EF Entities which is a good practice and better testable ? How can I test my Repositories and UnitofWork behavior ? Unit

Eclipse Maven Build and Test with One Button

ⅰ亾dé卋堺 提交于 2019-11-28 00:41:03
问题 The most common build activity I do in Eclipse (other than allowing auto-build to do its thing) is to perform a "Maven Build..." with parameters of clean and package. This runs all my tests. m2eclipse does a great job with this, and I like the output. If a test breaks, I then jump to using the JUnit plug-in, the debugger, etc. I've used "Organize favorites..." under the Run (and Debug) button's drop down menu to make this kind of build "permanent" and somewhat easy to access and use. But not

How to capture a screenshot after each step in tests with JAVA and Cucumber?

ⅰ亾dé卋堺 提交于 2019-11-28 00:31:29
What would be the best way to capture screenshots after each step when running integration tests? Tests are written in Java using Selenium(3.0.1) and Cucumber(1.2.4). Code for taking a screenshot after a test is below, but I need a screenshot after each method annotated with @Given, @When, @Then. @After public void after(Scenario scenario){ final byte[] screenshot = driver.getScreenshotAs(OutputType.BYTES); scenario.embed(screenshot, "image/png"); } Thank you for any hints. Can this post help you? Embedding screenshots in Cucumber JVM Here is the Answer to your Question: Lets assume your

Adding an additional test suite to Gradle

让人想犯罪 __ 提交于 2019-11-27 22:16:09
问题 I am attempting to add Gradle (1.4) to an existing project that has multiple test suites. The standard unit test located in src/test/java ran successfully, but I am having trouble setting up a task to run the JUnit test located in src/integration-test/java . When I run gradle intTest I get several cannot find symbol errors for classes in src/main . This leads me to believe that the dependencies are not set up correctly. How do I setup intTest so that it will run my JUnit integration tests?

Maven Failsafe Plugin: how to use the pre- and post-integration-test phases

跟風遠走 提交于 2019-11-27 22:14:12
It is not completely clear to me how to best use the Maven Failsafe plugin for integration tests. My use case would be to test SQL queries against a local MySQL database. I understand that the database should be started during the pre-integration-test phase, and shut down during the post-integration-test . But how do I specify that? Is there a command line I should put in my pom.xml? Or a method that I should annotate with a specific annotation? Jcs In the regular built-in maven lifecycles (jar, war...) the pre-integration-test and post-integration-test test phases are not bound to any maven

Running e2e tests using Protractor multiCapabilities config but limit max Webdriver instances

社会主义新天地 提交于 2019-11-27 21:00:53
问题 Context I am trying the brand new Protractor 0.19.0 with the multiCapabilities config option. It is actually working as described in the docs : It makes running tests on multiple browsers easier (no need for grunt, nor script, only 1 config file). It makes tests running in parallel The second point is problematic for me. One of my app doesn't handle multiple connection to the data, implying that the tests fail. My question is: Is it possible to limit the maximum number of instances of

How would you test a Connection Pool

爱⌒轻易说出口 提交于 2019-11-27 21:00:22
问题 I have implemented a very simple ConnectionPool in Java. It has no fancy features, just get/release connection methods. How can I test it is working? I know there are plenty of connection Pools ready to use out there, which are much more reliable than what I'll do, but I am just trying to practice to understand how connections Pool work. Thank you! Here is the code in case it helps: public class ConnectionPoolImpl implements ConnectionPool { private Vector<PooledConnection> connections; //

Java, Junit - Capture the standard input / Output for use in a unit test [duplicate]

时光总嘲笑我的痴心妄想 提交于 2019-11-27 20:27:55
This question already has an answer here: JUnit test for System.out.println() 12 answers I'm writing integration tests using JUnit to automate the testing of a console based application. The application is homework but this part isn't the homework. I want to automate these tests to be more productive -- I don't want to have to go back and retest already tested parts of the application. (Standard reasons to use Unit tests) Anyway, I can't figure out or find an article on capturing the output so that I can do assertEquals on it nor providing automated input. I don't care if the output/input goes

Is it possible to specify a user agent in a rails integration test or spec?

落爺英雄遲暮 提交于 2019-11-27 20:23:53
I was doing this before in a rails 2 app in a ActionController::IntegrationTest with get '/', {}, {:user_agent => "Googlebot"} but this seems to not work anymore in Rails 3. What should I do? If you use request.user_agent in your application, you can write the following code: get '/', {}, { "HTTP_USER_AGENT" => "Googlebot" } None of the above answers worked for me, the following is what finally worked in an rspec controller test: @request.user_agent = "a MobileDevice/User-Agent" post :endpoint, param: 2354 I fixed this behavior and with Rails 4.0 you will be able to specify actual HTTP Headers