testing

Pros/cons for using multiple locators per element in Selenium?

我是研究僧i 提交于 2019-12-31 17:45:14
问题 I am testing a website which is still in development. Often an element's id, class, text, or position in the DOM will change. And then the locator I've been using will no longer be able to find the element. But the features are still functioning properly. I don't want several tests to fail when there is no actual regression. So instead of having a single locator for each element, I have a collection of locators. public static final ArrayList<By> LOGIN_ANCHOR_LOCATORS = new ArrayList<By>();

Temporary Doctrine2 fixtures for testing with phpunit

南楼画角 提交于 2019-12-31 14:31:16
问题 I have an application built on Symfony2 + Doctrine2 which I want to create some tests for (using phpunit). For example if I want to test a unique validator against a record in the DB, I want to create a record I can work with, but after the test I don't need it anymore. So is there a way to create temporary (or virtual) fixtures or do I have to manually create and delete them? 回答1: You can use Doctrine DataFixture and put this code in your setUp method of a unit test class: $loader = new

Silverlight testing: Watin vs Selenium comparison

风流意气都作罢 提交于 2019-12-31 13:28:31
问题 I was wondering how well these web test frameworks (Watin and Selenium) work for Silverlight UI testing. Have anyone tried it on a project? Are Watin or Selenium well suited for Silverlight?. 回答1: I can't talk to Watin or Selenium with Silverlight, but I have played with White, which is a layer on top of the MS Automation Framework, and I have liked what I have seen thus far: I should also add that we defer the majority of our UI behavior testing to unit tests using the MVVM pattern. It doesn

Rails 3.2, RSpec, Factory Girl : NameError: uninitialized constant Factory

社会主义新天地 提交于 2019-12-31 10:59:05
问题 Ive been following this introductory to Rails testing and Ive run into an issue I cant seem to find the solution to. Im very familiar with Rails but this is my first foray into testing. Anyhow, I have a very basic model test, not even fully implemented and when I try and run rspec spec/models/admin_spec.rb . I get the following error in the Admin has a valid factory line (full code below) Admin has a valid factory Failure/Error: Factory.create(:admin).should be_valid NameError: uninitialized

Rails - Testing JSON API with functional tests

自作多情 提交于 2019-12-31 10:05:47
问题 I have just a simple question, but I could not found any answer. My ruby on rails 3.2.2 appilcation have a JSON API with a devise session authentication. My question is: How can I test this API with functional or integration tests - and is there a way to handle a session? I do not have a front end, just a API that I can do GET. POST. PUT. and DELETE with JSON Body. Which is the best way to test this automated? EXAMPLE create new user POST www.exmaple.com/users { "user":{ "email" : "test

Rails - Testing JSON API with functional tests

十年热恋 提交于 2019-12-31 10:04:01
问题 I have just a simple question, but I could not found any answer. My ruby on rails 3.2.2 appilcation have a JSON API with a devise session authentication. My question is: How can I test this API with functional or integration tests - and is there a way to handle a session? I do not have a front end, just a API that I can do GET. POST. PUT. and DELETE with JSON Body. Which is the best way to test this automated? EXAMPLE create new user POST www.exmaple.com/users { "user":{ "email" : "test

estimating of testing effort as a percentage of development time [closed]

寵の児 提交于 2019-12-31 08:58:51
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . Does anyone use a rule of thumb basis to estimate the effort required for testing as a percentage of the effort required for

Proper way to assert type of variable in Python

China☆狼群 提交于 2019-12-31 08:33:44
问题 In using a function, I wish to ensure that the type of the variables are as expected. How to do it right? Here is an example fake function trying to do just this before going on with its role: def my_print(begin, text, end): """Print 'text' in UPPER between 'begin' and 'end' in lower """ for i in (begin, text, end): assert isinstance(i, str), "Input variables should be strings" out = begin.lower() + text.upper() + end.lower() print out def test(): """Put your test cases here! """ assert my

Simulating a bad internet connection

余生颓废 提交于 2019-12-31 08:30:11
问题 I'm developing an embedded device which has access to the internet through LAN. I'm in the testing phase now, and I would like to test how the device performs when the connection to the internet is poor. Currently, the device is connected to a router through a hub, which I use to monitor the packets with Wireshark. What's the best way to throttle down the internet speed of the device to mimic a scenario that may happen? Can I do it through a PC? Do I need access to the router? If so, is it

Is there a python equivalent for RSpec to do TDD?

蹲街弑〆低调 提交于 2019-12-31 08:28:50
问题 I'm looking for a test framework like Ruby's RSpec to do test driven development in Python. The advantage of a framework like RSpec is that it offers a DSL that lends itself well to TDD. First you describe the test in english, and then you write the test, and when it fails you get a message saying what test failed with your nice description of what the test is trying to do. So far I've looked at PyTest and Nose. PyTest seems closer to ruby's MiniTest than RSpec. Instead of offering a DSL with