testcase

How to add Tags to a TestCase in Rally using Rally's JAVA API?

旧街凉风 提交于 2019-12-05 16:32:31
I have been struggling with adding a tag to a testcase in Rally. The tag is already present in the Tags collection. But I cannot add it to a testcase. Can some provide an example about how to do this? Thanks a lot. Here's an example of how to do this - the example shows both adding Tags to an existing Test Case, as well as creating a new Test Case and adding Tags to the new one. public class RestExample_AddTagsToTestCase { public static void main(String[] args) throws URISyntaxException, IOException { // Create and configure a new instance of RallyRestApi // Connection parameters String

Can I get statistics for test cases steps inside robot framework?

自作多情 提交于 2019-12-05 07:58:52
问题 In order to optimize time of execution, i create some test cases dependent from each other i want to get metrics and statistics not only for each testcase and testsuite. But also i want to generate statistics and metrics for each step. Is that possible ? PS : I'm using team city for continuous integration. Best regards, Emna A. 回答1: Using robot framework api we can get TEST and KEYWORD Metrics Reference: Link API: class robot.result.model.Keyword class robot.result.model.Test Keyword Metrics

comparing querysets in django TestCase

若如初见. 提交于 2019-12-04 22:43:42
I have a very simple view as follows def simple_view(request): documents = request.user.document_set.all() return render(request, 'simple.html', {'documents': documents}) To test the above view in my test case i have the following method which errors out. Class SomeTestCase(TestCase): # ... def test_simple_view(self): # ... some other checks docset = self.resonse.context['documents'] self.assertTrue(self.user.document_set.all() == docset) # This line raises an error # ... The error i get is AssertionError: False is not true . I have tried printing both the querysets and both are absolutely

How to set content-type for a spring boot test case which returns PDF file

谁说我不能喝 提交于 2019-12-04 22:09:17
I am currently testing one of my services with Spring boot test.The service exports all user data and produces a CSV or PDF after successful completion. A file is downloade in browser. Below is the code i have wrote in my test class MvcResult result = MockMvc.perform(post("/api/user-accounts/export").param("query","id=='123'") .contentType(MediaType.APPLICATION_JSON_VALUE) .accept(MediaType.APPLICATION_PDF_VALUE) .content(TestUtil.convertObjectToJsonBytes(userObjectDTO))) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_PDF_VALUE)) .andReturn(); String content

NUnit cannot recognise a TestCase when it contains an array

守給你的承諾、 提交于 2019-12-04 15:13:46
问题 This is quite simple but annoying behaviour I am running into with NUnit: I have some tests like this: [Test] [TestCase( 1, 2, "hello" )] [TestCase( 3, 5, "goodbye" )] public void MyClass_MyMethod( int a, int b, string c ) { Assert.IsTrue( a < b ); } This works fine and in the ReSharper NUnit pane I can see each TestCase getting its own response in the result. I have a second TestCase that looks like this: [Test] [TestCase( 1, 2, new long[] { 100, 200 })] [TestCase( 5, 3, new long[] { 300,

Automatically create test cases for web page?

廉价感情. 提交于 2019-12-04 14:46:34
问题 If someone has a webpage, the usual way of testing the web site for user interaction bugs is to create each test case by hand and use selenium. Is there a tool to create these testcases automatically? So if I have a webpage that gets altered, new test cases get created automatically? 回答1: You can look at a paid product. That type of technology is not being developed as open source and will probably cost a bit. Some of the major test tools get closer to this, but full auto I have not heard of.

How can I run multiple tests in parallel with JS/nightwatchjs?

旧街凉风 提交于 2019-12-04 13:34:35
Can I execute multiple test cases in parallel through Nightwatch ?Is it Possible? I am searching for ability of threading capability in java for parallel test case execution. Also what do you guys think about moving from Selenium to Nightwatch? You can see the thread for parallelism: nightwatchjs also take a look into parallel run Nightwatch is using the same selenium webdriver protocol but with some extra additions. Yes you can leverage the parallel mode of nightwatch js using following configuration: test_workers: { enabled: true, workers: 'auto' } To execute tests in multiple browsers, you

How to write a junit testcase for a void method that creates a new object

十年热恋 提交于 2019-12-04 06:25:20
问题 public class SupportController{ public void disableUserAccount(String username) throws Exception { UserAccount userAccount = new UserAccount(Constants.SYSTEM, Constants.CONTAINER, username); UserAccount.disableAccount(); } } How would i test that the useraccount created is disabled? 回答1: I would suggest using Mock Objects. Besides that, you can check the JUnit FAQ, where you can find a section about testing methods that return void . Often if a method doesn't return a value, it will have some

JUnit testcase passes with eclipse but fails with maven build

独自空忆成欢 提交于 2019-12-04 04:11:46
问题 I wrote a JUnit test case for JPA using spring. The testcase passes in eclips. But if I execute the same testcase using maven (mvn test) it fails. My test case is : import javax.annotation.Resource; import junit.framework.TestCase; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.transaction

Can I get statistics for test cases steps inside robot framework?

醉酒当歌 提交于 2019-12-03 20:58:17
In order to optimize time of execution, i create some test cases dependent from each other i want to get metrics and statistics not only for each testcase and testsuite. But also i want to generate statistics and metrics for each step. Is that possible ? PS : I'm using team city for continuous integration. Best regards, Emna A. Using robot framework api we can get TEST and KEYWORD Metrics Reference: Link API: class robot.result.model.Keyword class robot.result.model.Test Keyword Metrics Code: # Keyword Metrics Code: (save following snippet as python file and execute) from robot.api import