integration-testing

Title test failing for request specs in Michael Hartls tutorial for Rails 3

限于喜欢 提交于 2019-12-21 06:40:09
问题 Im following the Ruby On Rails 3 tutorial by Michael Hartl and using Capybara for the integration specs. The integration specs so far are as follows require 'spec_helper' describe "StaticPages" do describe "Home page" do it "should have the h1 'Sample App'" do visit '/static_pages/home' page.should have_selector('h1',:text => 'Sample App') end it "should have the title 'Home'" do visit '/static_pages/home' page.should have_selector('title',:text => "Ruby on Rails Tutorial Sample App | Home")

What's the best way to set custom request headers when using Capybara in RSpec request specs?

大憨熊 提交于 2019-12-21 04:26:18
问题 I'm monkey patching Capybara::Session with a set_headers method that assigns to Capybara::RackTest::Browser's options attribute (which I've changed from an attr_reader to an attr_accessor). The patches: class Capybara::RackTest::Browser attr_accessor :options end class Capybara::Session def set_headers(headers) if driver.browser.respond_to?(:options=) #because we've monkey patched it above options = driver.browser.options if options.nil? || options[:headers].nil? options ||= {} options[

Why is [AssemblyInitialize] and [AssemblyCleanup] being called twice in same test project assembly?

喜欢而已 提交于 2019-12-21 04:10:51
问题 I thought the whole purpose of these attributes was to run them only once per assembly. I have a simple class as follows: [TestClass] public class AssemblyIntegrationTestSetup { public AssemblyIntegrationTestSetup() { } public TestContext TestContext { get; set; } [AssemblyInitialize] public static void SetupIntegrationTests(TestContext context) { WindowsServiceService.Instance.StartService("Distributed Transaction Coordinator"); } [AssemblyCleanup] public static void TeardownIntegrationTests

Access ScalaTest test name from inside test?

為{幸葍}努か 提交于 2019-12-21 04:08:35
问题 Is it possible to access the name of the currently executing test, from within a ScalaTest test? (And how would I do it?) Background: I'm testing that my Data Access Object eventually throws an OverQuotaException if a user e.g. creates too many pages. These tests take rather long to run. To feel happier, I'd like to print the progress to stdout — and since there are quite many tests, I'd like to include the test name in the output, so I know what test is currently being run. (I didn't find

Integration tests for Google App Engine (java)

戏子无情 提交于 2019-12-20 19:45:03
问题 I'm trying to develop some effective integration tests for my GAE/j application. I'm familiar with https://developers.google.com/appengine/docs/java/tools/localunittesting -- these tools are great for small unit tests. I'm now interested in developing integration tests that test actual web requests. For example, I'd like to test that web.xml is mapping servlets and filters to the expected URLs and test that my JSPs generate what I expect. My aim was to bring up a local development server

When to choose system test over integration test Rails 5.1?

北城以北 提交于 2019-12-20 17:36:26
问题 With the release of Rails 5.1, they included system tests. Which means we can test our JavaScript too in Rails. I see Rails guide explains a sample test creating article in both ways: via system test and via integration test. Now the question is: before Rails 5.1 I was writing complex test cases in integration tests. But now I have two options to write a test case. I can write test case like test: should create article in integration test, but I can also write the same test case in system

Can you mark XUnit tests as Explicit?

一个人想着一个人 提交于 2019-12-20 17:35:04
问题 I'm making the transition from NUnit to XUnit (in C#), and I was writing some "Integrated Tests" (ITs) that I don't necessarily want the test runner to run as part of my automated build process. I typically do this for manually testing, when the full end to end process might not work because of environmental factors (missing data, etc.) In NUnit, you could mark a test with the Explicit attribute and it would just get skipped by the test runner (unless you marked the test with a specific

Protractor E2E Test Seed Database

流过昼夜 提交于 2019-12-20 10:39:38
问题 I haven't found a good way of doing this so hoping someone has some ideas. Is there any way to seed the database with test data before running a E2E Protractor test? Do people do this or do they just mock out the back end? Mocking out the back end for me is not an option so would appreciate ideas on how to seed the database. There are a few solutions out there using node but nothing conclusive. The whole point of E2E testing for my case would be to go to the DB level Thanks 回答1: Being in a

How to integrate Sikuli scripts into Selenium?

自古美人都是妖i 提交于 2019-12-20 10:29:45
问题 I'm extensively using Selenium for integration testing. Works great for all normal stuff (HTML/AJAX), but no go when I'm trying to test third party ActiveX, Java applets and Flash components. The solution I've found for this is Sikuli. Works great locally, but how can I integrate that into Selenium? btw. if that's relevant, for Selenium I'm using Python API. 回答1: See the Python section of the Selenium RC documentation: http://seleniumhq.org/docs/05_selenium_rc.html#python You may be able to

Embedded AMQP Java Broker

孤街醉人 提交于 2019-12-20 09:13:46
问题 I am trying to create integration test for a Scala / Java application that connects to a RabbitMQ broker. To achieve this I would like an embedded broker that speaks AMQP that I start and stop before each test. Originally I tried to introduce ActiveMQ as an embedded broker with AMQP however the application uses RabbitMQ so only speaks AMQP version 0.9.3 whereas ActiveMQ requires AMQP version 1.0. Is there another embedded broker I can use in place of ActiveMQ? 回答1: A completely in-memory