Siesta generate screenshot on fail - siesta

I'm running tests using Siesta from command line.
Is that possible to generate screenshots on each test fail while running Siesta test runner?
Edit:
Need to wait for the feature
http://www.bryntum.com/products/siesta/changelog/

It's not possible in current version 2.0.8, but they are planning to add this in future.
More info can be found on their forum http://www.bryntum.com/forum/
Also Siesta can be runned in cloud on http://www.browserstack.com/ or https://saucelabs.com/. These services offers evene whole screencasts of the tests.

Related

Run only few tests from nunit selenium test suite via command line

I want to run 5 tests from a suite of 200 tests via commandline. The framework uses Selenium with nunit and is built on c#.
After looking for solution online, /run was what I thought could fix my problem but it says invalid argument. Can someone please guide me with what is the parameter to run only few tests from suite via command line for nunit selenium?
You are using obsolete documentation or online answers relating to an older version of NUnit. For NUnit 3, you want the /test option.
BTW, the docs link posted by #vitalis is to legacy docs, as it says on the top of that page. Current docs for the nunit3-console command-line are at https://docs.nunit.org/articles/nunit/running-tests/Console-Command-Line.html
(You're dealing with a program that has been around in various versions for more than 20 years, so it's extra important to make sure you are looking at current information.)

How can I attach a screenshot to a testcase for a failed test with XUnit

We are going with XUnit to run Selenium Functional Tests. In Microsoft Azure Devops, we have a pipeline stage which runs our functional tests.
If the test fails, I want to take a screenshot using the Web Driver and attach it to the test results output.
I know it can be done with NUnit (using TestContext), but how can I achieve this using XUnit? Not sure if this is correct, but is there a way using REST APIs that I could somehow achieve this?
XUnit still doesn't support TestContext, check here: https://github.com/xunit/xunit/issues/2133
After taking the screenshots, you may consider using Attachments - Create Test Result Attachment API to attach the screenshot to a test result:
POST https://dev.azure.com/{organization}/{project}/_apis/test/Runs/{runId}/Results/{testCaseResultId}/attachments?api-version=6.0-preview.1
Looks like xUnit will support it in version 3.0. Currently the teams I work on use the API listed by Cece to push screenshots per-test.
https://github.com/xunit/xunit/issues/621

How to run e2e tests automatically?

I really don't know how to ask question to Google about this, so I excuse me that it is naive.
Our team is developing SPA application in ReactJS. We also do back-end programming for NodeJS. Our project recently got more e2e tests. They are written using webdriver.io packages. Everything works as expected but circa 30 tests run about 50 minutes. It is too long to pause developer work and force him to run tests.
We came with the idea that now when we have so many tests, we need to run them on separate computer (other than a developer's laptop, further I call it e2e-laptop).
So I programmed a bash script and installed Ubuntu on a e2e-laptop. My idea is, that developer who wants to run e2e test logs in on e2e-laptop with ssh, runs specified script with arguments (eg: --rev= specific git revision the tests should run on, --email= where to send Allure report) and logs out. After tests are done he gets Allure report in his mailbox.
This all sounds to me OK, but not very well. It works - it is like a dirty MVP. But what I really would like to give my team is the web browser based UI that gives the features my script has. I can imagine this software is hosted on e2e-laptop, every developer can open its webpage address in his local browser. Then after authorization, there are options: run all specs, run chosen specs, send report and more. It would be the best if that software could also allow simultaneous running of tests commissioned by multiple developers.
What software I need?
You need a continuous integration tool. https://stackify.com/top-continuous-integration-tools/
I recommend Jenkins.
I would first try to run your selenium tests headless in a docker container on your laptop. Once you are able to do that, use that same configuration in your docker container running in Bitbucket pipelines. It could actually be the same container and the same scripts. Then, developers can just make a branch and work with the tests on that branch. If only a certain subset of tests need to run, then the developer can make the necessary changes on his or her local branch to run those tests and push it up to Bitbucket. This should help with the configuration https://github.com/SeleniumHQ/docker-selenium.

Nunit3-console : Console.Writeln won't show up

I'm running nunit tests externally via Nunit3-console.
I'm not able to see any console.logs/console.Writeln
I find it mandatory to be able to track in real time, every step of the test.
I've read that nunit3 framework created a parallel test run feature, which is why the real time test output logs have been taken off.
But if I want to enjoy both worlds?
How can I trigger console logs during a test run?
Thanks in advance.
Nunit3 framework doesn't support live hard coded console outputs when running tests from Nunit3-console, because nunit3 framework was meant to bring the parallel testing methodology, they found it pointless to allow such outputs when more than 1 test is running in parallel.
I solved this by downgrading to Nunit 2.6.4 which isnt supporting parallel testing and allows me to fire console outputs from my test.

parallel execution in nunit for bdd test cases

I am working on BDD (written in selenium webdriver with c#).
For sequential execution we were using nunit but now the client requirement is parallel execution.
Gone through so many documentation but only found Pnunit.
Steps executed till now
downloaded pnunit
changes the setup method the use pnunit
created agent.conf file
run "agent agent.conf" to start agent
created app.conf file for parallel execution
run "launcher app.conf" for execution
but its also not working.
It says that class is not found under dll.
Please provide any suggestions.
-Neeraj
I've developed a method of running selenium tests in parallel that I've written about here http://blog.dmbcllc.com/running-selenium-in-parallel-with-any-net-unit-testing-tool/
Concurrent execution is not supported by Specflow using the standard test runners as the Specflow engine itself is not thread safe. This issue has been addressed and is currently being tested, and the fixed code should be merged in the next few weeks. Please see the discussion here and here
It is possible to use app domain isolation to run tests in parallel, Specflow+ and NCrunch use this technique.
YOu can try this tool https://github.com/qakit/ParallelTestRunner. I developed it for running NUnit tests in parallel (actually it will run in parallel not tests but testfixtures in your tests lib). Works fine for me =). If you will face any problems report me, will try to solve.