integration-testing

Integration testing - seeking your knowledge, advice and links!

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-04 01:52:06
问题 Hey guys, I'm after some advice and pointers on integration testing for a web app. Our project has been running for a number of years and it's reasonably complex. We're pretty well covered with unit tests but we're missing a decent set of integration tests. We don't have documented use cases or even a reasonable set of test cases beyond our unit tests. 'Integration testing' today consists of the developer's knowledge of the likely impact of a change and manual, ad-hoc testing of the app. It's

Mock IOptionsMonitor

丶灬走出姿态 提交于 2020-01-03 10:47:54
问题 How can I make an class instance manually of a class that requires an IOptionsMonitor in the constructor? My Class private readonly AuthenticationSettings _authenticationSettings; public ActiveDirectoryLogic(IOptionsMonitor<AuthenticationSettings> authenticationSettings) { _authenticationSettings = authenticationSettings.CurrentValue; } My test AuthenticationSettings au = new AuthenticationSettings(){ ... }; var someOptions = Options.Create(new AuthenticationSettings()); var optionMan = new

Angular 2 Integration Testing (Unit Test Style)

孤街浪徒 提交于 2020-01-03 09:05:43
问题 Is it possible to test an angular app with its testing framework (primarily designed for unit testing) against a real backend? Let's say E2E Testing with Protractor is not an option for me, but still i want to do some integration tests within my Unit Test Environment with Karma. I really have trouble finding examples or even a statement if it's possible or not using Jasmine and the testing libs of angular 2. I know, that this isn't supposed to be best (or even just a good) practice, but that

How to replace Middleware in integration tests project

旧城冷巷雨未停 提交于 2020-01-03 08:38:14
问题 I have startup cs where I register AuthenticationMiddleware like this: public class Startup { public void Configure(IApplicationBuilder app, IHostingEnvironment env) { ... AddAuthentication(app); app.UseMvcWithDefaultRoute(); app.UseStaticFiles(); } protected virtual void AddAuthentication(IApplicationBuilder app) { app.UseAuthentication(); } } and I test it using: WebApplicationFactory<Startup>().CreateClient(); Question: I would like to replace app.UseAuthentication(); with app

What is the best mechanism for testing applets?

余生长醉 提交于 2020-01-03 08:06:07
问题 I'm trying to effectively build a functional test suite for an applet, and I'm trying to find a good framework for it. In the past, when I wanted to design a test suite that would serve as both functional and load testing on an application, it has always been a web-based application, or at least some kind of service-based application, and I've used something like grinder to build up test scripts and use them to simulate users. With a Java applet, it's not clear to me what, if any, mechanism

How to set the ignore_ssl_errors option for Capybara Webkit in spec_helper.rb

◇◆丶佛笑我妖孽 提交于 2020-01-02 04:41:09
问题 In my spec_helper file I have: Capybara.javascript_driver = :webkit capybara_webkit now has a ignore_ssl_errors option that I want to use. How do I specify that in my spec_helper? 回答1: Here's how to register the :webkit driver with the :ignore_ssl_errors option. Capybara.register_driver :webkit do |app| Capybara::Driver::Webkit.new(app, :ignore_ssl_errors => true) end 回答2: As of writing (capybara-webkit 1.7.1), the configuration seems to have been simplified: Capybara::Webkit.configure do

How to create liquibase changeset for integration tests in springboot?

半世苍凉 提交于 2020-01-02 03:44:31
问题 I want mock data for integration tests by liquibase changeset, how to make that to not affect real database? I found partial idea from here, but I am using springboot and I hope there is simpler solution. 回答1: Hi you can use liquibase's context parameter. For example create changeset which will have inserts loaded from sql file and specify the context for it. something like this: <changeSet id="test_data_inserts" author="me" context="test"> <sqlFile path="test_data.sql"

Integration Testing with Flyway

旧城冷巷雨未停 提交于 2020-01-02 03:44:22
问题 I'm using Flyway to handle the database migration. Everything is working fine: the default location of the migration files is: main/resource/db/migration/V1... I am running integration tests and my setup uses an separate database schema for integration, which I would like to manage with flyway as well. The integration tests, though, are located in the test folder (not main ). When the Flyway bean executes migrate() , it doesn't find the migration files because they are in the main folder. If

Robolectric, Problems with clicking list items

隐身守侯 提交于 2020-01-02 01:55:15
问题 I have been struggling with this problem a bit, and I think I am not getting something fundamental about Robolectric. Usually some google searches can help me get to the bottom of this type of problem, but between that and looking at the sample code I am not finding anything of use. I am trying to emulate a click on a list view item and check that an activity is launched after the click. I keep getting back that the current activity I am testing is the resulting activity. I tried removing all

Mark Gradle source folder as test source in IntelliJ

十年热恋 提交于 2020-01-02 00:51:10
问题 I have an integration test source folder set up in gradle like so: subprojects { apply plugin: 'java' apply plugin: 'idea' sourceCompatibility = 1.8 configurations { integrationTestCompile.extendsFrom testCompile integrationTestCompileOnly.extendsFrom integrationTestCompile integrationTestCompileOnly.extendsFrom testCompileOnly integrationTestRuntime.extendsFrom testRuntime } sourceSets { integrationTest { java { compileClasspath += main.output + test.output runtimeClasspath += main.output +