Questions tagged [testing]

25178 questions
4

votes
1

answer
103

Views

How to unit test configs

We're working with some very large config files which contain lots of Unity and WCF configuration. When we open some of these configs in the SVC config editor or even try to open a web application using these configs, we recieve errors showing any typos or errors. E.g. a WCF binding is invalid or do...
Kye
5

votes
1

answer
576

Views

How should I test user signup/login with third party library like Omniauth?

I'm using Rails 3.0.3, Rspec2 , Cucumber , Capybara How should a scenario look for user signup process , when using the Omniauth gem ? I mean it doesn't make sense for me to testing this library, I only want to test the whole user registration process of my applications point of view: open my root_p...
astropanic
2

votes
1

answer
62

Views

How would I test this method?

Essentially I've begun to work on a wrapper for the Riot Games API and I'm struggling with how to test it. I've got the repository plugged into Travis so on push it runs go test but I'm not sure how to go about testing it since the API_KEY required for the requests changes daily and I can't auto-reg...
Mikey
3

votes
2

answer
127

Views

Is there a good http level testing framework for .NET?

Are there any good HTTP level testing frameworks for .NET? We want to replace some web inject scripts with something more friendly to .NET developers. Ideally we'd like to be able to plug them into NUnit like the rest of our unit and web driver tests. We've seen HttpUnit for java. Something like tha...
Helephant
3

votes
1

answer
70

Views

Is there a way to set the DateTime for a thread/application with arbitrary value

I need this in few of my automation test cases. The major functionality is time dependent and this causes test cases to fail if I run them during the day time for which there's no record. I know I have another but relatively tedious option of mocking the repository and generate the time dependent da...
Varun K
1

votes
1

answer
77

Views

Angular Testing - promise not returning data

I can't see why vm.chartData in my HomeCtrl never gets populated with the data i've mocked to it in the beforeEach(). the console.log(scope.vm.chartData) returns undefined even while the other scope vars like graphLoading are defined and changed properly. describe('HomeCtrl', function () { var cont...
leshow
10

votes
2

answer
164

Views

How can I tell if a structure in Python has order?

I'm writing a set of test cases for users new to Python. One of the problems I've noticed with my tests is that its possible to get false positives. They may have gotten lucky and happened to give every element in the correct order, however they really should be using a structure that is ordered. So...
K Engle
0

votes
1

answer
95

Views

spring test log4j error

I get this error on my controller tests on Spring MVC project: java.lang.NullPointerException at es.juntaex.asamblea.tests.controllers.LegislaturaControllerTest.testList(LegislaturaControllerTest.java:37) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAcces...
Pako Gonzalez
0

votes
1

answer
1.2k

Views

Ant JUnit Test case failure report not reporting testcase name

I am working on parsing the xml Junit reports generated with Ant Task. I see for pass test cases the report shows exact name of the testcase(method) executed, but not for failing test case. Can be verified below.... org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the...
pratikch
0

votes
2

answer
97

Views

Testing pandas code [closed]

I have a script of about 50 lines that reads data from a database, loads it into a pandas dataframe and then perform numerous operations on the dataframe. I was wondering how people generally test this type of code? I'm not talking about tools like assert_frame_equal, but rather principles people fo...
Johan
3

votes
3

answer
1.1k

Views

Using Jasmine with iPhone Development?

I'm new to the Jasmine Testing Framework, I want to know how to use this for testing iPhone developments? How can I integrate with Xcode and use for BDD testing? Will Jasmine only test my JavaScript code?? Then how can I use Jasmine in between my Xcode and call to JavaScript to verify that my JavaS...
DShah
7

votes
1

answer
1.5k

Views

Unit Testing Windows 8 Store App UI (Xaml Controls)

I've been creating a Windows Store App but I have thread problems testing a method which creates a Grid (Which is a XAML Control). I've tried to test using NUnit and MSTest. The test method is: [TestMethod] public void CreateThumbnail_EmptyLayout_ReturnsEmptyGrid() { Layout l = new Layout(); Thumb...
Marc Verdaguer
3

votes
2

answer
156

Views

autotools: don't include library when doing “make check”

So I'm writing tests for my code, and I want to stub out the calls to library functions (make sure that it's calling the right library calls at the right time, and that it handles errors appropriately). I think I'm SOL with the C standard library functions, but those aren't the only libraries I'm us...
rampion
5

votes
2

answer
308

Views

How do I write tests for my web application?

Question(s) How do I test my ASP.NET MVC4 web application with EntityFramework 5? Should I use a mocking framework like Moq? Introduction I've been researching this topic for weeks. I've found a lot of material but nothing which I feel answers the question completely. A lot of the information is yea...
Rowan Freeman
3

votes
1

answer
194

Views

Fundamental Testing of an Ember Component

I'm having some trouble testing an Ember.Component... I'm pretty sure I must be missing something, but it doesn't seem to be live binding the values in the template? Perhaps someone could shed some light on why the first test on this jsbin pastie passes, but the second fails? http://jsbin.com/UNivug...
Julian Leviston
4

votes
2

answer
977

Views

Simulate trigger with dbUnit

I'm using dbUnit to put test data in DB with dataset like My problem is that there's on-insert trigger in db that populates child records into TABLE_2. So when I try to DatabaseOperation.DELETE.execute(); at tearDown() it fails with java.sql.SQLException: ORA-02292: integrity constraint (TABLE_2_TAB...
Chizh
15

votes
5

answer
4.8k

Views

How to write integration tests for Stripe checkout on Rails?

I've hit the wall trying to write an integration test for Stripe's checkout.js [ https://checkout.stripe.com/checkout.js ] for my Rails 3.2 app. Stripe checkout works correctly for me when manually tested (using Stripe's testing keys), but I cannot get Capybara to detect and fill_in the email field...
dj.
-1

votes
1

answer
125

Views

Capybara didn't visit page although Cucumber step succeeded

I am using Capybara with Cucumber to test my rails application. Given the following scenario: Admin adds new administrator Given I am logged in as admin When I am on the list admins page And I follow 'add_admin' ....... When I run this feature, it is successful at the first two steps and fails in...
Shimaa Marzouk
0

votes
1

answer
376

Views

Unit/Instrumentation tests Android Gradle. Instrumentation tests won't run

I have Tests set up in an Android project in Android Studio. I have a Unit test class with tests and an Instrumentation test class with tests. When I run gradlew connectedAndroidTest the unit tests run fine but the instrumentation tests are not run. Here is my project structure root - app - src - an...
Stephen
0

votes
1

answer
173

Views

How to test the upload of .csv file in protractor

I'm trying to test an upload of a csv file in protractor. For wich i have the following code: const absolutePath = path.resolve(__dirname, 'csvFile.csv'); const fileInput = element(by.css('input[type=file]')); browser.wait(until.presenceOf(fileInput), 5000, 'File input not found'); fileInput.sendKey...
Rohr Facu
0

votes
2

answer
311

Views

Still getting deprecation warnings in Rails3.1

I keep getting depreciation warnings while testing in Rails 3.1 like RailsProject$ bundle exec autotest NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01. Gem.source_index called from /Users/CS/.rvm/gems/ruby-1.9.2-p290/gems/ZenTest-4.5.0/lib/autotest...
csch
3

votes
2

answer
54

Views

How to print in a file the time it took a command to run?

I would like to print in a file the result of a time. For example time ls -lRa / print the time at the end of the execution. And I would like to print it in a file like toto.txt I tried time ls -lRa / >> toto.txt, but as I thought it printed in also the result of ls.. Is there any way I can do to pr...
nookonee
3

votes
1

answer
243

Views

Test framework for Greasemonkey scripts

I need a framework for testing my greasemonkey scripts. UxU claims to provide this but I don't read Japanese, so I can't really follow the documentation. Any suggestions?
rampion
6

votes
3

answer
1.3k

Views

CUIT (Coded UI Tests) + MVVM — Do I have to start naming all my controls now?

Basically, with MVVM I have a lot of my controls unnamed because it isn't necessary to give a Name (or x:Name) to controls anymore. But, looking into coded UI Tests it seems as if I might have to go through and name all my controls again? Or did I just misunderstand what I read and there is a MVVM f...
m-y
2

votes
2

answer
53

Views

Asserting that a certain error occurs

Given the following code: def fun(param): if param == 'a': assert False else: return None # fun('a') THIS THROWS AN AssertionError # PSEUDOCODE FOR WHAT I WANT TO DO: # assert (fun('a') throws an AssertionError) assert fun('b') == None How do I assert that the first function call (fun('a')) will giv...
Ohumeronen
2

votes
5

answer
334

Views

How would you test a program that's supposed to run long time?

How would you test a program that's supposed to run long time? In my project, the program is designed to keep running for years. It's impossible for the QA guys to really test the program that long time. Then what test strategy should I apply to guarantee that the program could really run for that...
yaobin
0

votes
1

answer
99

Views

Doctrine Cascade Delete OneToMany self Referencing

Hello i have an issue with my symfony project I have a listener entity /** * Listener * * @ORM\Entity(repositoryClass='AppBundle\Entity\ListenerRepository') * @ORM\Table('listeners', uniqueConstraints={@ORM\UniqueConstraint(name='sponsor_code', columns={'sponsor_code'})}) * @ORM\HasLifecycleCallback...
RomMer
2

votes
1

answer
656

Views

How do I catch redirections to other domains when testing with Webrat?

In my Rails app, I have a form which redirects through a foreign service, Amazon FPS. The form POSTs to an action in my app which redirects to Amazon, who collect information and then redirect back to my app. I'm testing this workflow with Webrat. Obviously I can't test Amazon, so I want to check...
Peeja
0

votes
1

answer
1.4k

Views

SKPaymentTransactionStateRestored not called for non-recurring subscription while restoring

I have a problem in sandbox that no transactions with transactionState SKPaymentTransactionStateRestored being delivered to - (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions after a called to [[SKPaymentQueue defaultQueue] restoreCompletedTransactions]; In fact...
Benjamin
0

votes
1

answer
69

Views

C#: test a method with an object parameter implementing a private interface

I have a first project with a method that returns a Model object instance implemented with a private class PrivateModel inheriting Model and a private interface IFoo. Sample: Project1: public class Model {} private interface IFoo {} private class PrivateModel : Model, IFoo {} // a sample class with...
tmm360
0

votes
2

answer
103

Views

How to check if there are any invocations of a method in the code base

Let's say I have a class Foo and a method evilMethod: class Foo { public void evilMethod() { // do sth } } Is there a way to write a test that would fail any time there is any invocation of this method in any class on the classpath? I mean, not when the method is invoked at runtime, but when it's de...
siledh
10

votes
1

answer
22.4k

Views

The identity 'iPhone Developer' doesn't match any valid, non-expired certificate/private key pair in your keychains

I want to test my app in a device and I'm stuck with this error for hours: The identity 'iPhone Developer' doesn't match any valid, non-expired certificate/private key pair in your keychains I've followed this guide, and I've searched similar questions here on stackoverflow. This might help: in my P...
diogo.appDev
15

votes
3

answer
4.9k

Views

Is there a good guide to interpreting the Firebug net panel?

I’m using the Net panel in Firebug to evaluate the performance of web pages I’m writing. Specifically, I’m wondering what the precise meaning is of the stages for each resource that’s downloaded (i.e. DNS lookup, Connecting, Blocking, Sending, Waiting, receiving). But more generally, is ther...
Paul D. Waite
10

votes
15

answer
2.3k

Views

How do you make testing not boring?

Just as the title said. What ways do you use to test your own code so that it wouldn't be a boring task? Do you use any tool? For my projects, I use a spreadsheet to list all the possible routines i.e. from the basic CRUD and also all the weird routines. i make about 10 routines. I get about 2-3 bug...
2

votes
1

answer
1.1k

Views

Testing EF SQL Server based application with in-memory SQLite?

I am using SQL Server with Entity Framework for a development of web app in .NET 4 with VS2010 RC. I would like to prepare testing database with sample data. Should I prepare a copy of the real database (say another SQL Server database) for testing, or can I use SQLite in memory for better performan...
twk
11

votes
2

answer
3.3k

Views

How do you test pages that require authentication with Selenium?

I need to test a web application using Selenium. The app is fairly common in its setup: it requires signing in for most of the functionality to be exposed. Upon loading a page, if the user is not authenticated, it will redirect to a login form and then back to the requested page once credentials are...
GomoX
6

votes
2

answer
2.3k

Views

Mock web service

We have two components: enterprise application X, and Web service Y We want to make our (automated) testing tool that will test application X (that interact with Y) only, and we have not the web service Y available. Notes: The testing tool will be a desktop application. We Don't want to use another...
Moro
2

votes
2

answer
211

Views

Testing complex datatypes?

What's are some ways of testing complex data types such as video, images, music, etc. I'm using TDD and wonder are there alternatives to 'gold file' testing for rendering algorithms. I understand that there's ways to test other parts of the program that don't render and using those results you can i...
prafulfillment
4

votes
1

answer
771

Views

Test swing application

How do you test Swing applications? For the code, I have written Unit test cases and hence I am sure that it will work well (If it doesn't, then my test cases were not adequate). But how do you test for applications with UI. It might not appear well or functionality is vague or something. In the la...
Jatin
4

votes
1

answer
568

Views

QuickCheck-Like Template Function Benchmarking in C++

Inspired by Haskell's elegant way of auto-generating (random) instances of a given type, for example in QuickCheck, I'm trying to figure out how to write an as-easy-to-use-as-possible benchmarking framework in C++. I figure I will be using function templates, possibly with the help of new features i...
Nordlöw