Selenoid - Parallel Testing in Cucumber 4 in Maven using Junit - maven

Well, I am able to launch my Cucumber features in parallel using Maven Surefire Plugin. I am also able to launch these tests remotely in containers using Selenoid as well.
However, when I launch my tests, they are only launched in Chrome as per my default configuration. I want to launch different tests in different browsers. Is there any dynamic way of doing it?
I did a bit of research and found that tagging each scenario with browser name like #chrome or #firefox. If I adopt the same methodology, my scenarios will always run in the same dedicated browsers.

Related

Jenkins : Selenium GUI tests are not visible on Windows 7

When I run my selenium test (mvn test) from jenkins (windows) I see only the console output. I don't see the real browsers getting opened. How can I configure jenkins so that I can see the browsers running the test?
I think you're mis-understanding the reason you would use Jenkins, i believe it's designed to do exactly what it is doing, you need to install a different test-framework along with Maven and Selenium.
Jenkins is an open source DevOps tool which is basically use to automate repetitive tasks like code deployment on server.
SERVER being the main operating word here, you are trying to run your automation scripts from your desktop.
https://www.youtube.com/watch?v=peDWh9q_d0s
Above is a video tutorial of how to setup Maven and a very popular automation test framework, testNG.
Give me a shout if you need any more from me,
All the best,
Jack

How to run Cucumber Selenium Maven with Junit project in Parallel

Iam using Selenium Cucumber Maven framework with Junit. How can we run cucumber feature files in parallel from Command line. I am very thankful if you guys help me. Please help me with a solution.
Have a look at this article https://automationrhapsody.com/running-cucumber-tests-in-parallel/
First of all you need to write (or generate) runner classes for each feature file. Next configure the maven-surefire-plugin to run tests in parallel. If you are using maven-failsafe-plugin look at https://maven.apache.org/surefire/maven-failsafe-plugin/examples/fork-options-and-parallel-execution.html for the configuration.
Be careful in which setup you run the tests. I would recommend you to setup a selenium grid with one master and multiple slaves to avoid hardware restrictions and of course concurrency issues.

How to set up Jenkins for build, unit test and system tests

I want to set up Jenkins for a decent build chain for a JavaFX application that controls a robotic arm and other hardware:
We are using BitBucket with the Git Flow model.
We have 2 development modules and 1 System Test module in IntelliJ that we build with Maven.
We have Unit tests, Integration test and System tests. Unit and Integration tests use JUnit and can run on the Jenkins master, for the System tests we use TestNG and they can run the TestFX tests on a Jenkins agent.
(I think TestNG is more suited for System tests than JUnit)
Development build project (build, unit+integration tests) was already in place. The Test chain has been recently set up by copying the development project, adding the system tests and ignoring the Unit/Integration tests. (so building the application is done twice)
We have 2 types of System tests:
Tests that are fairly simple and run on the application itself
Tests that are more complex and run on the application that interacts with several simulators for the robotic arm
Now I need to set up the 2nd type of tests.
My question would be: what is the best way to set this up in Jenkins?
I'm reading about Jenkins Pipelines and the Blue Ocean plugin here, about a matrix configuration project here. To me it is all a bit confusing what is the ideal way to achieve my goals.
I have no clue how to scale from a testng.xml file in my SystemTest module to flexible tests.
Can I put a sort of capabilities tag to tests so that the correct preconditions are set? For example, for tests in category 1, only the main application needs to be started for TestFX. However, for tests in the category 2, several simulators needs to be started and configured. I think using a sort of capabilities tag, will make this much more maintainable.
My goals:
Easy to maintain Jenkins flow
Efficient building, so preference to copying artifacts instead of building a second time
Possibility to split the system tests over multiple agents, preferably without me having to be concerned about what runs where (similar to Selenium Grid)
Correct dependencies (simulators etc) are started depending if the test needs them
We are looking into running the tests on VMs with OpenGL 3D acceleration due to a canvas used in the application. If tests are able to allocate, start, stop VMs on demand, that would be cool (but would only save some electricity)
Easy reporting where all test results are gathered from all agents. Notice that I prefer the JUnit report that highlights which tests were #Ignored. TestNg report format, doesn't say anything about #Ignored tests.

testing with Protractor Selenium Cucumber in a maven project

We use Cucumber with selenium in a maven project to automate our functional tests and Jenkins for the continuous integration,
Now we start to use AngularJS front-end in the project
I'm not sure if it's a good idea to start using Protractor ?
if yes how can we use'it in the same maven project along side with cucumber?
Protractor is not java based. You need to use Javascript/nodejs in order to run Protractor. Normally in nodejs, there are separate task runners or build tools, such as Grunt/Gulp/Webpack. There might be a way you can leverage to run protractor with maven: https://github.com/greengerong/maven-ng-protractor
IMHO if your application is pure angular application, protractor can provide you some level of conveniences, if your application is in the middle of migration, I rather stay with what you have right now, to me, it doesn't provide much business value on migration from selenium to protractor.

Bamboo and Web UI Testing

We have a node.js project that we are building with Atlassian Bamboo. We are doing CI/CD, or that's the plan. We are using Mocha to do Unit/API testing. But I didn't see anything in the task types to do web UI testing. We have used Selenium in the past, and that was the idea this time as well. But there is no nice, easy to use test runner and parser, as there is with Mocha.
Anyone have any experience with this in Bamboo? Any suggestions on how to do this?
I am using Selenium with Bamboo and I have configured Maven plugin and TestNG Parser . You can pass Selenium Grid URL/Base URL etc in environment variables.

Resources