This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 9 years ago.
I wanna use Karma (previously known as Testacular) to run some jasmine tests. So I've installed node.js, then I run:
npm -g install karma
I even installed jasmine
npm -g jasmine-node
then I used karma init it created 'karma.conf.js' where "files" section contains this
files = [
JASMINE,
JASMINE_ADAPTER,
'*.js',
];
and I created a small test file
describe("A suite", function() {
return it("spec with an expectation", function() {
return expect(true).toBe(true);
});
});
now I'm trying to run it karma start it throws me an error: Uncaught ReferenceError: JASMINE is not defined, if I remove the line with JASMINE, run again - now it doesn't say anything about jasmine, but throws: describe is not defined
So what am I doing wrong?
btw. putting module('someModule') in test file doesn't help (module is not defined error)
upd: I'm on Windows
in fact I'm pretty sure using global variables (e.g. JASMINE) been deprecated in the lastest Karma version - but it's not documented.
It should have been replaced by the frameworks options, so you'd only need:
frameworks = ["jasmine"];
Related
This question already has an answer here:
Customize the directory of Karate HTML reports
(1 answer)
Closed 1 year ago.
I want to run karate from two terminals in the same working directory i.e parallelly, so that they may generate different reports but all I am getting are the reports of the latter run even though they run successfully both at the same time. Is there a way to do custom reporting so that I can save all run reports.
Make sure you are on the latest version (at least Karate 1.0) and you can over-ride the report-directory.
If you are referring to the standalone JAR, you use the -o or --output option.
If you are using the Runner API or from within a JUnit test, use the reportDir() method.
If none of the above options work, kindly consider this not supported and please contribute code :)
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I'm testing a web application with several functionalities. I didn't develop this application, I'm a mere tester. I'm new to testing and when I started working on it I was given a series a Selenium Tests. These tests are performed by using Selenium IDE on Firefox.
They're very easy to perform in this way, cause you can just record and store variables and run the test.
The problem is that when, for example:
* a web page has a table with 3 rows, I prepare the test for this scenario, it works
* the day after the table has 4 rows so my test doesn't work anymore,
* Selenium doesn't allow me to make a for-cycle over rows or columns
That's why I thought I could export the several Selenium test to Java 4 Web Driver and import them in Eclipse. In this way I'm able to improve the code, by adding for cycles and other stuff.
I created a project for my test suite, imported the JUnit 4 and Selenium library, ran the suite and everything was alright, no errors. It was great.
*The thing is: how I do I manage to VISUALIZE (or Playback) on Firefox Browser my tests, as I was doing earlier in Selenium IDE?? *
Thx a lot
When you run the tests in Eclipse, it will open a Firefox window and perform the tests just as it would in the IDE.
As for actual test management (i.e starting/stopping tests) you will need to invest in some CI software. TeamCity, Jenkins or something like that will work.
As for picking elements out (the 'find' option in Selenium IDE), this is much more tricky as you've just ditched the IDE and are very new to Selenium. It is, however, easily done.
You can run XPath and CSS queries directly into Firefox's Console (or Firebug, if you wish). Thus, you can still run the same queries you would in the IDE, the only difference is how the results are returned to. Selenium IDE will 'highlight' an element, whereas the console will return it as a DOM object.
If none of the above helps, please go into more detail for what you are requiring, but I've covered what the IDE allows you to do and what are the alternatives.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
TDD & BDD? Which, Why and How?
Can anyone give a good explanation to justify "Which", "Why" and "How" on both?
Thanks in advance.
TDD is used more for unit testing e.g. testing a method on a class. BDD is used for testing the behaviour of a system e.g. Creating a user, or Sending out new product emails.
So for TDD you might see something like.
public void Test()
{
// Arrange.
var sut = new ClassToTest();
// Act.
int result = sut.SoSomething();
// Assert.
Assert.Equal(result, 23);
}
With BDD (depending on the tools you're using) you tend to see something like this:
Feature: Add a user
As a system admin
In order to give a user access to the site
I want to create a user account
Scenario: Creating a basic user
Given I have the user's name
When I create a new user account
Then that user can log onto the site
As you can, BDD is testing the behaviour of a system rather then single unit. Here is a very good intro to BDD by Dan North - http://dannorth.net/introducing-bdd/
I would recommend using TDD when you are building your classes/code and want to testing little bits of it at a time. Use BDD when you want to test more then one of those classes in a test i.e. integration test.
EDIT:
With the how side of things, for BDD I would recommend using SpecFlow. This is a popular BDD tool which adds a lot of functionality to Visual Studio for creating feature files (The Feature: stuff I mentioned above) and running and debugging the tests.
Under the hood SpecFlow can use NUnit or MSTest to generate the tests. Other BDD tools include:
MSpec
NSpec
SpecsFor
StoryQ
and many others I've forgotten about right now :) I would suggest you try them out and see which one you prefer.
For TDD you have many options including:
NUNit
xUnit
MSTest
A lot of the above tools can installed via NuGet in Visual Studio, which is handy.
I am trying to use QUnit with a Meteor app. Should this be possible? Any recommended patterns?
I was trying to make an app that was "self testing" by making a route for "/test" but it doesn't appear that QUnit is running my tests (no test output appears).
#Tom, sure here ya go:
I've added a package for qunit with meteor here:
https://github.com/jpmec/meteor/commit/786b93153d94c0e2291ac210f64587dbbbad23d6
Some facts and disclaimers:
I didn't to the branch right, I branched from master not devel.
I'm not spending much time trying to keep my meteor branch up to date.
This meteor branch is truely fubar'ed wrt the main meteor project, so don't branch from it.
Your best bet is to download, and go look in the packages folder for qunit. That part I think I did right. You'll probably just want to drop this in your meteor packages folder and see if it helps you.
After trying it out some, here are my thoughts to other would-be qunit with meteor users:
I cannot figure out how to easily have a "test site" and "production site" with meteor. It seems like it is all or nothing out of the box, so you can have a self-testing site, but all users get to run the tests. (What I would like is to serve up one site on one port and another site on another port, while maintaining a consistent folder tree for my "app").
The hot-push of meteor is really cool with qunit. As you write your tests you see them go from red to green in semi-real time. No need to keep switching to the test page and refreshing. This is by far the coolest part of meteor, and using qunit with meteor.
The answer to this question was a little more involved for me.
I found no discernible difference between putting qunit in a package, and just including qunit sources in my /client files. My difficulty was that sometimes tests seemed to run, sometimes not at all, and frequently a mysterious "global error" would appear in my test results.
This was called by qunit attempting to automatically launch the test run before my own code had loaded tests. I found no good solution to prevent the automatic behavior. My eventual solution was to let qunit finish its (empty) automatic test run, and then to call Qunit.init(), load tests, then Qunit.start().
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 10 years ago.
I have installed ruby on Windows 7 using the installer Ruby 1.9.3-p125 which is the latest version (ruby -v shows the right version). Next, I downloaded devkit-3.4.5r3-20091110, which is also the latest version. When I tried the following in the installation directory,
ruby dk.rb init
the console showed an error:
ruby: No such file or directory -- dk.rb (LoadError)
I am new to ruby and I don't want to learn ruby — I just want to use Jekyll which needs ruby.
How can I fix this error?
Try to run the command from the devkit folder, and let me know if it doesn't work.
Try installing the dev kit from here. You'll find dk.rb in the directory you extracted the contents to.