Questions tagged [testcase]

A test case in software engineering is a set of conditions or variables under which a tester will determine whether an application or software system is working correctly or not.

A test case is also defined as a sequence of steps to test the correct behavior of a functionality/feature of an application. A test case is a set of conditions or variables under which a tester will determine if a requirement upon an application is partially or fully satisfied. It may take many test cases to determine that a requirement is fully satisfied. In order to fully test that all the requirements of an application are met, there must be at least one test case for each requirement unless a requirement has sub requirements. In that situation, each sub requirement must have at least one test case. Generally Senior tester writes test cases and after verification and approval the junior testers carry out execution of test cases.

998 questions
5
votes
2 answers

Cypress testcase: Select only text of an element (not the text of its children/descendants)

HTML Code:

I am Span 1 of target_value 1* I am Span 2 of target_value 2* target_value /* I want to get this value in cypress test case */

Note*: Both the texts "I am Span 1 of…
Nitish Singh
  • 215
  • 1
  • 2
  • 15
5
votes
3 answers

How to disable rendering the view in ActionController TestCase (Rails 3.0.9)

What's the proper way to disable ActionController::TestCase to actually render the views? Alternatively, what'd be the way to render the view without the layout in the tests? Using rr, I've tried stub(@controller).render { "" } but this broke…
zoli
  • 469
  • 6
  • 17
5
votes
1 answer

Django Unit test is giving Anonymous user while login

I've the below code for Django login Unit test. """This is the unit test case for form element""" from django.test import TestCase from django.contrib.auth.models import User class TestForm(TestCase): def setUp(self): self.credentials…
Amlanjyoti
  • 85
  • 2
  • 8
5
votes
1 answer

Android: Is there any naming rule for test cases

I found really weird stuff when I was building my test project. I subclassed my own test from AndroidTestCase, and implemented several test cases inside. Some cases didn't run at first, however, there was no exceptions. After I just changed the name…
fifth
  • 4,249
  • 9
  • 45
  • 62
5
votes
2 answers

What is a test case?

I'm having difficulties finding a hard definition of the word "test case". Some sources claim that a test case is a class that extends TestCase. Other sources claim that a test case is a single test method. The JUnit documentation is unclear, it…
fredoverflow
  • 256,549
  • 94
  • 388
  • 662
5
votes
0 answers

How to analyse Testcases from src/test/java folder using sonarlint in intellij

How to use sonarlint for analyzing testcases? I have found similar thing in sonar cube sonar.test.inclusions as property but couldn't find anything similar in sonarlint > intellij. Folder I need to analyse: src/test/java Work around: Renaming test…
Diptman
  • 374
  • 3
  • 14
5
votes
1 answer

How to write unit test cases for a Perl script

I'm able to write unit tests test_case.t for a Perl Module ModuleOne.pm test_case.t use strict; use warnings; use Test::More; use Test::Cmd; use ModuleOne; # Included the module here my $ret = ModuleOne::methodone(args); is($ret->{val}, 1,…
Srikanth Jeeva
  • 3,005
  • 4
  • 38
  • 58
5
votes
1 answer

Run parametrized test from console

I'd like to run test method with only one set of params from a testcase. I'm using NUnit Console 3.4.1. Example of code: [Category("SmokeTests")] [TestCase("1 param", "2 param", "3 param")] [TestCase("aaa", "bbb", "ccc")] public void…
Yuriy Rozhkov
  • 117
  • 1
  • 11
5
votes
3 answers

How to stub a method in ActiveSupport::TestCase

In RSpec I could stub method like this: allow(company).to receive(:foo){300} How can I stub a method with ActiveSupport::TestCase? I have a test like this. class CompanyTest < ActiveSupport::TestCase test 'foobar' do company =…
ironsand
  • 14,329
  • 17
  • 83
  • 176
5
votes
1 answer

Nunit runsTestCase with a TestCaseSource with the first iteration having no parameters? Why?

Hi I am new to Nunit and I am passing a series of objects to a TestCase as a TestCaseSource. For some reason though Nunit seems to run the test first with no parameters passed to it which results in an ignored output: The test: private readonly…
Phil
  • 616
  • 2
  • 8
  • 21
5
votes
3 answers

How to resolve OptimisticLockingFailureException?

The code that triggers the OptimisticLockingFailureException: @Test public void shouldIncrementUserTotalLikesByOne() throws IllegalArgumentException, UserNotFoundException { databuilderService.createAll(); User user =…
Giridhar Kumar
  • 619
  • 1
  • 7
  • 12
5
votes
2 answers

TestCase display name in NUnit when using Arrays or Generics

I am trying to use TestCaseSource in NUnit to run multiple tests with one of parameters being an array private static readonly object[] ReturnChopCases = { new TestCaseData(3, new List {}).Returns(-1), new…
Matt McCabe
  • 2,986
  • 2
  • 22
  • 29
5
votes
2 answers

Add Test Case to ITestSuiteBase in TFS API

I'm working with the TFS API and have run into a problem with ITestSuiteBase and IRequirementTestSuite. I've mananged to easily create a new test case within a IStaticTestSuite: IStaticTestSuite workingSuite = this.WorkingSuite as…
Direweasel
  • 153
  • 2
  • 10
5
votes
2 answers

Get example matches that fit a regular expression

Possible Duplicates: Random Text generator based on regex Using Regex to generate Strings rather than match them Hi, I need a matches generator for my regular expressions. E.g. for input like: [A-Z]+[0-9]? I get…
Krzysztof Krasoń
  • 26,515
  • 16
  • 89
  • 115
5
votes
1 answer

python 2.6 - django TestCase - assertRaises ValidationError clean() method

Django 1.5 and Python 2.6. The model has a clean() method that validates that job.company_id must equal job.location.company_id I'm trying to write a test for this, but instead of passing/failing the test, the test is ending with the validation…
billrichards
  • 2,041
  • 4
  • 25
  • 35