testing

Selenium Python test against Selenium grid created from SeleniumHQ Docker images

两盒软妹~` 提交于 2019-12-22 09:59:31
问题 In brief How to run Python Selenium tests properly against Selenium Grid container created from SeleniumHQ Docker images? I also asked on SeleniumHQ here https://github.com/SeleniumHQ/docker-selenium/issues/521 The error & log 00 - the console error 01 - the hub log 02c - the chrome node log 02f - the firefox node log Full details I've tried this web search and similar search on our site and found none useful. OK with standalone I've succeeded in running this simple test against the

Is there a way to test phonegap build apps on different platforms

风流意气都作罢 提交于 2019-12-22 09:50:30
问题 So I developed a phonegap app using Android development sdk. And I used Phonegap build to build my project for Simbian, WebOS, Windows, iOS, and Blackberry. But I don't have devices for those platforms to test my app on. And I really don't want the headache of setting up those development environments, I mean, that's why they have Phonegap Build right? I have had complaints from WebOS, Simbian, and Windows that my app doesn't work. And haven't gotten the license gen working on Blackberry (no

RSpec+Capybara request specs w/ JS not working

一曲冷凌霜 提交于 2019-12-22 09:32:55
问题 I cannot get request specs working when using Javascript. My specs pass if I run them without Javascript (the page is built to work with or without JS). Specifically, the specs fail when I do assertions like Post.should have(1).record . Capybara just doesn't pick up the records from the DB, and the database is not cleaned between runs. I've tried using DatabaseCleaner with transactional fixtures disabled - the common approach to this, I guess. No dice. I've also tried (and, would ideally

Logging in multithreading environment and testing

夙愿已清 提交于 2019-12-22 09:27:21
问题 Please let me know your suggestions about how to design logging and how to test it, in the following scenario. I've an API which can be called by multiple threads. One call of this API by a single thread generates a log of 50 KB. Does any design pattern exist for logging in multi-threaded environment. i.e one log file for all threads vs one dedicated log file for each thread ? And, How to do testing for this feature. (should it be tested?) Thanks. 回答1: Wrap your logging instance in a thread

Best way to test Thymeleaf form / Spring MVC Controller interaction

拟墨画扇 提交于 2019-12-22 09:26:11
问题 I am working on a Spring Boot app using Thymeleaf & Spring MVC, and I came across a bug in the code where someone had bound the Spring MVC model to 2 different HTML form fields: <input th:field="*{userModel.name}" type="text" /> <input id="name" th:field="*{userModel.name}" type="hidden" /> This was causing the name field in the model of the controller to get set to a string of comma-separated values. "Steve,Steve" for example. I fixed the problem, but I'm wondering the simplest way to write

Having a default port when running tests in ruby on rails

断了今生、忘了曾经 提交于 2019-12-22 08:59:17
问题 Im trying to run my tests with rake spec Im using rspec,capybara with selenium as webdriver. The problem is when ever I try to run the specs It starts up the testing environment in a different port every time. I don't want this to happen as it messes up my Facebook login. How would I make the environment start in the same port every time. pls help! 回答1: Look in config/initializers/webservice.rb and try setting the config.port value to something...I'm not entirely sure this will actually do

How should I test a database-driven Django CMS for 404 errors?

廉价感情. 提交于 2019-12-22 08:54:50
问题 I have designed a basic content management system in Django that uses the database to track Article objects, then displays these Article objects on my website. Each Article uses template tags that I frequently update. Occasionally, I will accidentally break one or more articles on my site when I update a template tag. For example, if I change the required arguments for a template tag referenced by a given article, and forget to update the template tag code within that article, the article

Unit testing algorithms that involve random numbers

試著忘記壹切 提交于 2019-12-22 08:41:35
问题 I'm writting some code about fractals and random terrain generation. Specifically, I'm using the Diamond-Square algorithm as of now. For those of you who don't know, it basically obtains the average of four values, and adds a random number, every step. How wouldI go about testing the result? Should I use a known seed and calculate by hand the average plus the random value, or what? Should I, instead, calculate the result in the code, using the random numbers? Or is there another way? Also,

How to re-run Failed Test and set re-tries for python3 py.test

六眼飞鱼酱① 提交于 2019-12-22 08:35:18
问题 I have few web service related test which sends http requests and the response is verified by py.test test cases. I usually get 1 or 2 failures out of 50 tests which are fails due to intermittent slow web server response gathering or due to network. Is there a way I can re-run or add number of retires to a py.test test case before actually marking it as a Failed one ? Something like run a test 3 times before marking it as failure and moving to the next one, If test passes in any attempt(1 or

How to benchmark unit tests in Python without adding any code

天大地大妈咪最大 提交于 2019-12-22 08:34:26
问题 I have a Python project with a bunch of tests that have already been implemented, and I'd like to begin benchmarking them so I can compare performance of the code, servers, etc over time. Locating the files in a manner similar to Nose was no problem because I have "test" in the names of all my test files anyway. However, I'm running into some trouble in attempting to dynamically execute these tests. As of right now, I'm able to run a script that takes a directory path as an argument and