testing

Is Pex and Moles project still active?

余生颓废 提交于 2020-01-03 18:30:51
问题 They used to release a two new versions a month but since October 2010 they haven't released a new one. I've found this. But the fact they have closed its support forum on MSDN makes me suspect the project is not going forward. We are using it for our current project, but we are thinking to replace it for another framework before it is too late. 回答1: We (the Pex team) has been quite busy working on productizing Moles. This will bring some changes to how things work internally, which has been

Regenerate fixture test files in Rails

99封情书 提交于 2020-01-03 17:48:11
问题 How do I regenerate all the YML fixture files? I accidentally deleted them. 回答1: @brian, I'm using the following script to generate the fixtures from a given sql This is under my lib/task directory as a rake task namespace :fixture_generator do desc "generate fixtures for a given sql query from the current development database" task :fixture_generator, [:sql, :file_name] => :environment do |t, args| args.with_defaults(:sql => nil, :file_name => nil) i = "000" p "creating fixture - #{args.file

What's difference between UI level testing and API level testing?

喜欢而已 提交于 2020-01-03 17:25:55
问题 I got this question while interviewing some companies. I don't think I answer the question well. However, based on my understanding: The UI level testing is more about the what end user will see and would be better to use for acceptance testing. The API level test is good for performance testing, since it's easier to simulate multiple users to access the resource at the same time. And, it's easier to look at where the problem will be. Can anyone give me more detail about that? And when should

What's difference between UI level testing and API level testing?

核能气质少年 提交于 2020-01-03 17:25:09
问题 I got this question while interviewing some companies. I don't think I answer the question well. However, based on my understanding: The UI level testing is more about the what end user will see and would be better to use for acceptance testing. The API level test is good for performance testing, since it's easier to simulate multiple users to access the resource at the same time. And, it's easier to look at where the problem will be. Can anyone give me more detail about that? And when should

Using Ansible variables in testinfra

泪湿孤枕 提交于 2020-01-03 17:16:57
问题 Using TestInfra with Ansible backend for testing purposes. Everything goes fine except using Ansible itself while running tests test.py import pytest def test_zabbix_agent_package(host): package = host.package("zabbix-agent") assert package.is_installed package_version = host.ansible("debug", "msg={{ zabbix_agent_version }}")["msg"] (...) where zabbix_agent_version is an Ansible variable from group_vars. It can be obtained by running this playbook - hosts: all become: true tasks: - name:

How can I generate a list of n unique elements picked from a set?

五迷三道 提交于 2020-01-03 16:51:23
问题 How to generate a list of n unique values ( Gen[List[T]] ) from a set of values (not generators) using ScalaCheck? This post uses Gen[T]* instead of a set of values, and I can't seem to rewrite it to make it work. EDIT At @Jubobs' request I now shamefully display what I have tried so far, revealing my utter novice status at using ScalaCheck :-) I simply tried to replace gs: Gen[T] repeated parameter to a Set in what @Eric wrote as a solution here: def permute[T](n: Int, gs: Set[T]): Gen[Seq[T

Protractor map function returning undefined

泪湿孤枕 提交于 2020-01-03 16:15:44
问题 Given an app with multiple widgets on it, each with their own title and whatnot, I would like to map each widget's elements, to make them easy to handle in tests. For example, a page: this.widgets = element.all(by.css('ul.widget-grid')).map(function(widget, index) { return { index: index, title: widget.element(by.css('div.title')).getText() }; }); And then in my spec: expect(page.widgets[0].index).toBe(0); expect(page.widgets[0].title).toBe('The Title'); Unfortunately, my expects are

Launching Xcode Simulator with jenkins user

依然范特西╮ 提交于 2020-01-03 15:58:42
问题 I'm trying to launch an iOS app tests through command line, from a Jenkins Job. If I launch the command in my user's console, works ok, the command is: xcodebuild test -scheme demoIC -destination 'platform=iOS Simulator,id=E6954360-11D9-49E0-9008-A8EE6BA1ACFC' It's supposed Jenkins uses 'jenkins' user for launching jobs, so I have done: su - jenkins And the when I launch the same command, I got an error: 2015-02-16 18:21:41.215 xcodebuild[3952:1303] iPhoneSimulator: Could not launch simulator

Launching Xcode Simulator with jenkins user

纵然是瞬间 提交于 2020-01-03 15:57:48
问题 I'm trying to launch an iOS app tests through command line, from a Jenkins Job. If I launch the command in my user's console, works ok, the command is: xcodebuild test -scheme demoIC -destination 'platform=iOS Simulator,id=E6954360-11D9-49E0-9008-A8EE6BA1ACFC' It's supposed Jenkins uses 'jenkins' user for launching jobs, so I have done: su - jenkins And the when I launch the same command, I got an error: 2015-02-16 18:21:41.215 xcodebuild[3952:1303] iPhoneSimulator: Could not launch simulator

Is it possible and/or advisable to generate tests dynamically in rails?

雨燕双飞 提交于 2020-01-03 15:33:08
问题 One trick I have found very handy in rails application programming is that class_eval can be used to create methods on the fly. I'm starting to get into testing now and I wonder if a similar idea could be used to generate tests. For example, I have a before_filter to require a user to be logged in for all of the actions in a controller. I would like to write tests which ensure that the before_filter is being applied for all actions. Instead of writing out each test individually I would like