testing

TestNG: More than one @DataProvider for one @Test

大兔子大兔子 提交于 2020-03-17 06:45:19
问题 I'm using TestNG for Eclipse . Is it possible to give two data providers step by step to the same test-function? I could put both providers in one, but that is not what I want. I need (not like in this example) to generate independently data. @DataProvider(name = "dataSet1") public Object[][] createDataX() { return new Object[][] { { 1, 1 }, { 2, 2 } }; } @DataProvider(name = "dataSet2") public Object[][] createDataY() { return new Object[][] { { 0, 0 }, { 3, 3 } }; } I want to give both

Instrumentation run failed due to 'Process crashed.'

折月煮酒 提交于 2020-03-17 06:44:10
问题 I wanted to run the following test: package com.xxx.yyy; import android.content.Context; import androidx.test.InstrumentationRegistry; import androidx.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test

Creating integration tests in a monolithic SpringBoot application

℡╲_俬逩灬. 提交于 2020-03-16 08:17:52
问题 I was asked to create an integration test for a service within a very large SpringBoot project yielding dozens of implemented services. When the application is executed all of these services are deployed - I want to avoid deploying all services unrelated with the one for which I'm creating the test. Unfortunately, I do not (yet) have as much experience with spring boot tests as I would hope for hence I was wondering what is the best approach to address this. I was thinking about annotating

How to find a variable with rspec tests using page.find

蓝咒 提交于 2020-03-15 11:50:29
问题 I have a test case, most of my other pages have at least one field that is just straight text and can be found using: page.find("tr", text: "What I filled in").find("a.tick").click This page all of the options are drop down selects, so how do I find a variable? The rest of the syntax looks like this: it "edits person job and redirects to index" do expect(p = FactoryGirl.create(:person)).to be_valid() expect(j = FactoryGirl.create(:job)).to be_valid() visit new_job_path select p.name, from:

How to find a variable with rspec tests using page.find

纵饮孤独 提交于 2020-03-15 11:49:42
问题 I have a test case, most of my other pages have at least one field that is just straight text and can be found using: page.find("tr", text: "What I filled in").find("a.tick").click This page all of the options are drop down selects, so how do I find a variable? The rest of the syntax looks like this: it "edits person job and redirects to index" do expect(p = FactoryGirl.create(:person)).to be_valid() expect(j = FactoryGirl.create(:job)).to be_valid() visit new_job_path select p.name, from:

How to find a variable with rspec tests using page.find

匆匆过客 提交于 2020-03-15 11:48:17
问题 I have a test case, most of my other pages have at least one field that is just straight text and can be found using: page.find("tr", text: "What I filled in").find("a.tick").click This page all of the options are drop down selects, so how do I find a variable? The rest of the syntax looks like this: it "edits person job and redirects to index" do expect(p = FactoryGirl.create(:person)).to be_valid() expect(j = FactoryGirl.create(:job)).to be_valid() visit new_job_path select p.name, from:

How to find a variable with rspec tests using page.find

我怕爱的太早我们不能终老 提交于 2020-03-15 11:45:59
问题 I have a test case, most of my other pages have at least one field that is just straight text and can be found using: page.find("tr", text: "What I filled in").find("a.tick").click This page all of the options are drop down selects, so how do I find a variable? The rest of the syntax looks like this: it "edits person job and redirects to index" do expect(p = FactoryGirl.create(:person)).to be_valid() expect(j = FactoryGirl.create(:job)).to be_valid() visit new_job_path select p.name, from:

Test slice with @WebMvcTest is loading a substantial amount of controllers unrelated with the target

左心房为你撑大大i 提交于 2020-03-05 00:23:12
问题 I have a spring boot application yielding numerous controllers and my goal is to create an integration test for a specific one. I read that we can achieve a test slice with the @WebMvcTest annotation that loads only what is necessary to deploy the target controller, is this assumption correct ? Here is my test: @RunWith(SpringRunner.class) @WebMvcTest( controllers = {DummyController.class}, ) public class DummyControllerIT { @Autowired private MockMvc mockMvc; ... Unfortunately the execution

Test slice with @WebMvcTest is loading a substantial amount of controllers unrelated with the target

↘锁芯ラ 提交于 2020-03-05 00:23:11
问题 I have a spring boot application yielding numerous controllers and my goal is to create an integration test for a specific one. I read that we can achieve a test slice with the @WebMvcTest annotation that loads only what is necessary to deploy the target controller, is this assumption correct ? Here is my test: @RunWith(SpringRunner.class) @WebMvcTest( controllers = {DummyController.class}, ) public class DummyControllerIT { @Autowired private MockMvc mockMvc; ... Unfortunately the execution

Testing vim scripts

两盒软妹~` 提交于 2020-03-03 07:39:19
问题 I'm exploring options for testing vim scripts. I'm wondering if I need a tool like Vader or if I can just roll my own using vim from the command line. I'm using Perl (but it could be any language), and I can do this: `$path_to_vi -c "normal iLink" -c "normal \r" -c wq ~/vimwiki/output.md`; Then I can just inspect the contents of output.md with an appropriate test. Thanks for any tips and advice. 回答1: You can use built in functions such as :h assert_true() to test scripts. Every time you call