acceptance-testing

cabybara-webkit + rspec: Records are not available

微笑、不失礼 提交于 2020-01-15 11:19:09
问题 I'm new to the integration testing, although I've done a lot of unit tests for my models and controllers. But now I want to test the whole stack. (I don't want to use Cucumber, since there is no customer and I can read code) Here my (simplified) spec describe ArticlesController, "#show" do before do @article = Factory :article, :title => "Lorem ipsum" end it "should show the article page" do visit article_path(:id => @article) page.should have_content("Lorem ipsum") end end The spec passes,

Acceptance testing preloading of data into GAE dev server datastore

痞子三分冷 提交于 2020-01-13 11:32:36
问题 In my application I have a set of of DAOs which I inject into my application layer. For an acceptance test I'm writing, I want to preload the dev_server datastore with data, so I use the same Spring config in my JUnit test (using the @ContextConfiguration annotation) to inject an instance of the relevant DAO into my test. When I actually go to store some data eg: dao.add(entity) I get the dreaded "No API environment is registered for this thread." Caused by: java.lang.NullPointerException: No

How does the “element(selector, label).query(fn)” method work in Angular E2E tests?

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-13 03:42:26
问题 When writing E2E tests for Angular Scenario Runner I came across a query() method: element(selector, label).query(fn) The documentation says: Executes the function fn(selectedElements, done), where selectedElements are the elements that match the given jQuery selector and done is a function that is called at the end of the fn function. The label is used for test output. So I wrote an it-case for a set of buttons on my html-page: it('should display all buttons on page load', function () { var

Capybara-webkit raises Capybara::Driver::Webkit::WebkitInvalidResponseError

醉酒当歌 提交于 2020-01-03 15:18:06
问题 I got following message from webkit driver in my rspec: Capybara::Driver::Webkit::WebkitInvalidResponseError: Unable to load URL: http://127.0.0.1:44923/posts Few days ago it worked. The problem is with save_page method. What could be wrong? 回答1: I've had similar error messages when my page was raising an error. You should check manually that this is not the case by starting a server in testing mode ( rails s -e test ) and accessing the page yourself. 回答2: Check if you don't have any other

Can you review my Perl rewrite of Cucumber?

假装没事ソ 提交于 2020-01-03 01:58:08
问题 There is a team working on acceptance testing X11 GUI application in our company, and they created a monstrous acceptance testing framework that drives the GUI as well as running scenarios. The framework is written using Perl 5, and scenario files look more like very complex Perl programs (thousands of lines long with procedural-programming style) than acceptance tests. I recently learned Ruby's Cucumber, and generally have been using Ruby for quite a lot of time. But unfortunately I can't

Acceptance testing of sinatra app using webrat fails

痴心易碎 提交于 2019-12-25 05:16:27
问题 I am trying to test a ruby authentication app using minitest and webrat but get errors. Tests like visit '/' fail with an error Status 200 expected but was 404. Tests containing code like fill_in :email, :with => "first@company.com" fail with error Could not find field: :email . I read several sinatra, testing and webrat documents and forums. Some of them were old and suggested stuff like Sinatra::Default, but github.com/brynary/webrat/wiki/sinatra, Building a Sinatra App Driven By Webrat

Is there a way to programmatically supply variables to behat features?

做~自己de王妃 提交于 2019-12-24 11:26:22
问题 I want to exhaustively test a set of pages with behat. For example, this Scenario Outline: Scenario Outline: Given I am at <path> When I click some button Then I should see <hidden-stuff> | path | hidden-stuff | | path1 | element1 | | path1 | element2 | | path1 | element3 | | path2 | element1 | | path2 | element2 | | path2 | element3 | | path3 | element1 | | path3 | element2 | | path3 | element3 | ... In my specific case, I have over 10 examples and 50 paths, so you can see how this becomes

Testing error responses with ember-cli-mirage

本小妞迷上赌 提交于 2019-12-24 01:54:23
问题 I'm reading through ember-cli-mirage's docs about creating mock responses but can't figure out how to test error responses for the exact same request. For example: test("I can view the users", function() { var users = server.createList('user', 3); visit('/users'); andThen(function() { equal( find('li').length, 3 ); equal( find('li:first').text(), users[0].name ); }); }); test("I can view the error if viewing the users returns an error", function() { // somehow set up an error response (?)

XML input/output with Fitnesse

╄→гoц情女王★ 提交于 2019-12-23 16:54:49
问题 I want to create automated tests which accept XML and verify that the XML returned is what was expected. Also, the end user needs to be able to add new data (XML input + expected XML output) without having to get into the code. It seems like Fitnesse should be able to do this, but I haven't figured out a good way to do it yet. Any recommendations? Tools other than Fitnesse that will work better? The code which needs tested is in .NET. Eventually I would like to integrate these test results

Setup testing database for acceptance tests in Codeception (Laravel)

心已入冬 提交于 2019-12-21 06:06:33
问题 I'm using Codeception framework to perform acceptance tests in Laravel 5 application. I wanted to use a separate database for testing to keep real database from changing through testing. I configued the .yml files based on Codeception documentation. But the real database gets affected anyway. This is my configuration files: /codeception.yml actor: Tester paths: tests: tests log: tests/_output data: tests/_data support: tests/_support envs: tests/_envs settings: bootstrap: _bootstrap.php