How to run tests sequentially in Testcafe one browser? - testing

I would like to see a better way to run tests sequentially in Testcafe one browser, I have more than 30 tests.
Currently I'm using numbers for each test:
List item
test1register.ts,
test2login.ts,

Just pass the directory in command line, it will run tests sequentially.
testcafe chrome ./tests/

Related

How to run CI selenium side runner tests on Jenkins

I have a .side file generated by the Selenium IDE, which I need to run on CI using Jenkins.
I am running it as a build step with the following shell command:
selenium-side-runner /path/to/file.ide
The problem arises due to the fact that no matter if the selenium test fails, Jenkins always shows is as success.
In this thread it's suggested to upload the file as generic, but still, the commands to execute it are missing
How to upload a generic file into a Jenkins job?
I've found a possible solution to it on this posts, but I would appreciate having a cleaner way to solve this instead of parsing the results checking for errors.
How to mark a build unstable in Jenkins when running shell scripts
Is there a plugin able to run selenium .side files on Jenkins and this one showing the success/failures of the test?
You can generate a Junit test report file and then use the Jenkins Junit plugin after your tests execution.
selenium-side-runner --output-directory=results --output-format=junit
# Outputs results in `junit` frormat in `./results/projectName.xml'
Check the official documentation for more details.

Run specific tests within test suite - Selenium Side Runner (IDE)

Is it possible to run a specific test within my selenium side runner test suite? For example, within a test suite, my first test logs me into a website, then the other tests, test specific areas of the website. Each of these tests first inherit the login test to auth the "user" when running the tests. But when I run the suite, it runs the tests in order, so it will first run the login test, then rerun the login test within my other tests. Hope this makes sense. So essentially i want to be able to specify which tests to run within my test suite. Thanks in advance
You may use the filter to run tests that have a common name:
Filter tests
You also have the option to run a targeted subset of your tests with the --filter
target command flag (where target is a regular expression value). Test names that
contain the given search criteria will be the only ones run.
[example] selenium-side-runner --filter smoke

How to run only failed tests (protractor+jasmine)

We have ~150 e2e tests and executing in multiple browsers like chrome, firefox, IE, Edge & Safari. Few tests are failing on different reasons. Is it possible to execute only failed tests using protractor?
Yes, You can use protractor-flake => https://www.npmjs.com/package/protractor-flake
It's able to rerun whole spec files. You actually can provide a parser which receives all test output. We use this and it's very helpful.

How to get TestNG results on jenkins while building?

I'm trying to get tests results while the job is building.
When we run tests suite by eclipse we get tests results from TestNG viewer while running the suite, I want to get the same viewer or similar in Jenkins to know the current status of the build before finish.
I mean this in TestNG Viewer:
Results of running suite TestNG viewer
Thanks All :)
AFAIK it is not inbuilt as part of any plugin. But there are couple of options that you can try.
Write results to a database in the IInvokedMethodListener after implementation. Build a ui over the database.
Maintain a datastructure of results , do console out of summary(if you are the only one who needs to know the results) on jenkins in test listener or method listener of the results based on the frequency at which you need to know results. Or you can start of a parallel script which parses the consoleText either as a shell or a separate utility doing curl on the consoletext.

Is there console.log output support to terminal/command-line with intern-runner?

I have a dependency with Intern where we have to spin up a Selenium server and use PhantomJS for our tests. We use Jenkins and may need some more inspection/debug output to console but the console.log's get suppressed from the test files to terminal/command-line
Is console.log to terminal/command-line supported yet?
How console.log works with intern-runner depends on where your test code is running. Unit tests (specified with suites) run in the browser, so that's where console.log output ends up. There isn't currently a way to get console output out of a browser for unit tests.
Functional tests (specified with functionalSuites) control a browser, but actually run in Node.js, so output from console.log statements in functional tests generally goes to intern's stdout. The exceptions are log statements in execute and executeAsync blocks; since those blocks run in the browser, that's where the log output ends up. You can retrieve browser logs in functional tests using getLogsFor('browser'), but WebDriver log support is inconsistent between browsers.