testing

--xunit output when running a directory of tests

旧巷老猫 提交于 2019-12-24 02:42:56
问题 There is a similar question here - Casperjs 1.1 does not generate XUnit xml file The answer to linked question works when one is executing single .js files, when I trigger the script with casperjs test /path/to/test/files, then multiple test suite files in the folder get executed in sequence, and when that happens the file name in --xunit parameter doesnt get written to. Is there any way to do this? 来源: https://stackoverflow.com/questions/29467310/xunit-output-when-running-a-directory-of

Jackson's Access.WRITE_ONLY during test null

烈酒焚心 提交于 2019-12-24 02:42:45
问题 I'm currently playing around with Jackson's de/serialization features and I encountered a problem, I don't know how to solve. During my test the @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) annotation is ignored and it only shows null . However with e.g. Postman everything works as expected. I using just a Spring Boot Starter with Web Starter and Test Starter dependency. Example Code: @SpringBootApplication public class DemoApplication { public static void main(String[] args) {

programmatically enable android device administration

爱⌒轻易说出口 提交于 2019-12-24 02:42:25
问题 I want to write tests for an application that uses the android device administration API . My problem is that the user needs to manually grant one-time approval for the application to have admin rights, otherwise a SecurityException is thrown at runtime. a user can manually enable/disable admin rights for applications by going to settings->location & security -> select device administators. I would like to do it programmatically from within an AndroidTestCase . 回答1: I did not find a way to

Using @mark.incremental and metafunc.parametrize in a pytest test class

喜你入骨 提交于 2019-12-24 02:34:18
问题 the purpose of @mark.incremental is that if one test fails, the tests afterwards are marked as expected to fail. However, when I use this in conjuction with parametrization I get undesired behavior. For example, in the case of this fake code: //conftest.py: def pytest_generate_tests(metafunc): metafunc.parametrize("input", [True, False, None, False, True]) def pytest_runtest_makereport(item, call): if "incremental" in item.keywords: if call.excinfo is not None: parent = item.parent parent.

How to group xcode 5 test cases into test suites

三世轮回 提交于 2019-12-24 02:24:04
问题 I use xcode 5 test navigator to run my test, but one painful thing is that I need sometime to test whole layers of my app (say the models). I would like a way to group tests into logical units. I could probably use Test targets for that purpose but I don't think that's an efficient way. 回答1: Creating a test case class for each of your logical units will group them in the test navigator. Choose File > New > File to add a new test case class to your project. If you move the cursor over a test

Nested form: shouldn't save if no information for child is entered

我的梦境 提交于 2019-12-24 02:22:48
问题 I have a nested form to sign up a new organization and 1 member (1:many relationship between organization and its members). Both have validations in the model file and the migration file. The issue : I would like the form not to sign up anything (not organization nor member) if not information for both are entered correctly. Currently, when I sign up a new organization but leave all the variables for the member empty it signs up the organization without an error message and it signs up no

Selenium - Get location after clicking on an anchor

北城余情 提交于 2019-12-24 02:22:16
问题 I'm trying to check the fact that when I click on an anchor link, some section is really at the top of the browser (I hope I'm making sense here.) My test looks like that: class Tests(unittest.TestCase): def setUp(self): self.driver = webdriver.Chrome(chromedriver) self.accept_next_alert = True self.driver.set_window_size(1100, 800) self.base_url = "http://someurl" def test_anchor(self): driver = self.driver driver.get(self.base_url) driver.implicitly_wait(1) location = driver.find_element_by

FactoryGirl factory with Trait(s) that returns a Hash with stringed keys

夙愿已清 提交于 2019-12-24 02:13:49
问题 I'm trying to use FactoryGirl to build a Hash that returns something like this: => {"3"=>"1", "6"=>"Word"} I'm getting close but not 100% there yet... The first factory definition i tried looked like this: factory :faqtory, class: Hash do |f| f.ignore do fake_word Faker::Lorem.word end f.sequence(1.to_s) { |n| n } f.send(2.to_s, fake_word.to_s.capitalize) initialize_with { attributes.stringify_keys } end Unfortunately this doesn't work: 1.9.3p448 :001 > FactoryGirl.build :faqtory

upload test cases from excel to microsoft test manager 2013

最后都变了- 提交于 2019-12-24 02:10:07
问题 In my current project we are using Microsoft Test Manager 2013. We have prepared test cases in excel. How can we upload prepared test cases from excel to MTM 2013. 回答1: Additionally to the answer by @MrHinsh: Check Create Manual Tests using Team Web Access and look for the question Can I copy test cases and test steps from an existing Excel worksheet? in the Q&A part. 回答2: I do this using the free tool tcmimport: http://tcmimport.codeplex.com/ 回答3: You can do this by copying and pasting into

Symfony2 functional test session persistence

匆匆过客 提交于 2019-12-24 02:08:07
问题 I'm trying to play a little bit with the functional test in Symfony and i'm currently facing a problem with my sessions. I execute a piece of code, which seems to be working, but nothing is stored inside the session of my container. I have a form where you set datas. When you submit it, it checks the values and store it inside sessions. Then it redirects to another page where these values stored in session are needed. The purpose of my test is to check the session. <?php namespace Acme