DBFit : Test that executes other tests - dbfit

I have a bunch of tests that run individually and I would like to create one single test (let's call it root test) which will call the others one by one, so as I have the complete test suite able to run with a single click and have the results for all of them in a single page, respecting the fact that I want them to be in separate folders, etc.
So my question is: Is there a way to create such a test in DBFit?

I have a root directory for my tests called 'MyTests' and there are lets say 5 different tests in there in separate folders. I created a suite and I changed the context.txt file of the MyTests page where I would like to run the suite. In that file I added the line !see .MySuite?suite The suite contains calls to each report I want in its own content.txt file.

Related

Execute one feature at a time during application execution

I'm using Karate in this way; during application execution, I get the test files from another source and I create feature files based on what I get.
then I iterate over the list of the tests and execute them.
My problem is that by using
CucumberRunner.parallel(getClass(), 5, resultDirectory);
I execute all the tests at every iteration, which causes tests to be executed multiple times.
Is there a way to execute one test at a time during application execution (I'am fully aware of the empty test class with annotation to specify one class but that doesn't seem to serve me here)
I thought about creating every feature file in a new folder so that I can specify the path of the folder that contains only one feature at a time, but CucumberRunner.parallel() accepts Class and not path.
Do you have any suggestions please?
You can explicitly set a single file (or even directory path) to run via the annotation:
#CucumberOptions(features = "classpath:animals/cats/cats-post.feature")
I think you already are aware of the Java API which can take one file at a time, but you won't get reports.
Well you can try this, set a System property cucumber.options with the value classpath:animals/cats/cats-post.feature and see if that works. If you add tags (search doc) each iteration can use a different tag and that would give you the behavior you need.
Just got an interesting idea, why don't you generate a single feature, and in that feature you make calls to all the generated feature files.
Also how about you programmatically delete (or move) the files after you are done with each iteration.
If all the above fails, I would try to replicate some of this code: https://github.com/intuit/karate/blob/master/karate-junit4/src/main/java/com/intuit/karate/junit4/Karate.java

golang test setup for entire test run/package

Is there a way to specify code to be run before all the tests in the current test run? Even when running tests across deeply nested directories? e.g.
a/
a/a_test.go
b/c/
b/c/c_test.go
d_test.go
I want to write some code that runs once before and once after all the tests in files a_test.go, c_test.go, d_test.go have run.
I know about TestMain, which sorta does what I want if I needed to do this at the package level, but this doesn't run before/after all the tests in subdirectories/subpackages. I want something that's one level above TestMain.
I'm not limited to go test, so if there's a third-party test runner that would do this for go, that would be alright as well.
I'm looking for something akin to nosetests's SetUpPackage or pytest's session scoped fixtures.

Ember - The last test in my file structure always gets added to the test module i'm viewing

I have a strange bug when running tests in Ember (w/CLI) where the last test that is in my directory is added to any of the individual test modules. The last test always breaks and if I delete the last file it will move on to the penultimate test and append that test. The tests fails with a Global Error message
Any ideas why it would append the last test to any of my individual tests?

Setup page for a suite

I have a number of "smoketests" that are simple selenium-scripts (2-5 lines) that are run with Xebium/Fitnesse. I have now gotten into the problem that I need to start a "reset-job" before my suite runs since some of the tests need to alter some data, and when the data are alterd, the test doesn't run anymore.
I'd basically would like to create a testpage, that are guarantied to run before the suite and that will run a xebium-table to setup the site.
So, the question, how to create a "setup-page" that can run a xebium-table before the other pages in a suite.
Create a page called SuiteSetUp
http://fitnesse.org/FitNesse.UserGuide.SpecialPages

Prefill new test cases in Selenium IDE

I'm using Selenium IDE 2.3.0 to record actions in my web application and create tests.
Before every test I have to clear all cookies, load the main page, log in with a specific user and submit the login form. These ~10 commands are fix and every test case needs them, but I don't want to record or copy them from other tests every time.
Is there a way to configure how "empty" test cases are created?
I know I could create a prepare.html file or something and prepend it to a test suite. But I need to be able to run either a single test or all tests at once, so every test case must include the commands.
Ok I finally came up with a solution that suits me. I wrote custom commands setUpTest and tearDownTest, so I only have to add those two manually to each test.
I used this post to get started:
Adding custom commands to Selenium IDE
Selenium supports object-oriented design. You should create a class that takes those commands that you are referring to and always executes those, in each of the tests that you are executing you could then make a call to that class and the supporting method and then execute it.
A great resource for doing this is here.