Robotjs protractor test not working on Jenkins - jenkins

I am running a set of protractor tests that run on Jenkins. A couple of my tests use the robotjs npm package. When tested manually the tests perform fine, but when they are run from Jenkins it seems like robotjs does not work at all. Does any one have any experience with robotjs and Jenkins?
Thanks

Related

How to run Cypress tests in parallel using a single machine on Jenkins?

So I have around 45 spec files that I want to execute in parallel on a single machine on Jenkins.
If I create a freestyle job on Jenkins and run this command "npx cypress run --record --key abc --parallel" it executes sequentially.
Do I need to set up nodes on Jenkins, in order to do parallel execution using this command? I am not able to find how exactly I can do that and I have tried various configurations but it still runs sequentially despite the "--parallel"
How do I specify how many threads I can execute it on? Or is that decided automatically by the number of machines? In my case, I can only do this using my single machine and local Jenkins.
Creating a pipeline and passing parallel{} in the stage as mentioned here is not working either so I don't know what I'm doing wrong.
Can someone please share a sample pipeline format for parallel Cypress test execution along with a guide to how nodes are created on Jenkins? Please tell me what additional steps I need to do as well. Thanks in advance
You will have to execute multiple cypress runners in order for Cypress to actually run in parallel. If you only have one npx cypress run command, then only one runner is being used.
I've found the easiest way to run multiple cypress runners is to use npm-run-all.
Assuming my script in my package.json is cypress-tests, my npm-run-all script to run the tests with three runners would be:
npm-run-all cypress-tests cypress-tests cypress-tests --parallel
Note: the --parallel flag here tells npm-run-all to run your commands in parallel. If the corresponding cypress flag is removed, your tests will not run in parallel (instead, npm-run-all will run two cypress runners in parallel, but each running your entire suite.)

VueJS, run e2e tests using Cypress into a Jenkins pipeline using a docker image

I created a VueJs project with some unit tests (using Jest) and integration tests using Cypress.
I have also a Jenkins pipeline in order to build, test and deploy the application.
I Integrated, as test stage, the unit tests but I would like to integrate also Cypress in order to run the integration tests into a dedicated pipeline step.
Is is possible to have this without installing any additional Cypress Jenkins plugin?
I mean, Is it possible to use a docker image to run the tests using Cypress?
Can you point me to some examples?
You should be able to use this with Jenkins Docker capabilities. Also here is another example you can refer to.

How to work with protractor in Jenkins?

I want to include my Protractor testing project on Jenkins.
It's the first time i'm trying to use Jenkins, and I cannot understand what are the steps I need to do to make Protractor work and run in Jenkins.
In addition, how can I make the allure plugin work as well?
By the way, the Protractor might be in the Git in the future.
How all those combinations work?
Thanks a lot.
For configuration of jenkins with protactor please refer to this post https://medium.com/#cnishina/protractor-in-ci-jenkins-6f5fd3fc06ee
In general, executing protactor tests and any other things are ending up in following, if you are able to execute it in command line than you can execute same command under jenkins using "Execute shell" functional of jenkins. A bit more specific: in case of protractor you have this (or something similar) for execution in command line:
npm install
npm run e2e test-conf.js
(ofc file names are just samples)

Running Protractors in Jenkins

I was just wondering if it is possible to run protractor e2e tests in Jenkins with every build. Currently we trigger test cases manually and they are not part of Jenkins but somehow I need them to be run automatically and show the results (failures/pass) as part of the build.
Can anyone share their experience.
Regards
Syed Zaidy
Yes this is possible, you set this up under the Build Triggers section of your job. You have the options to build periodically, build remotely, build after another project is built, or build after a push to GitHub/BitBucket.
You can also put your tests in the pipeline, "downstream" from another job, so they are automatically triggered whenever that job completes.
Yes, it is possible to run Protractor tests from a Jenkins job. To do this, you will need a headless browser. Read about Headless browsers here:
You can follow the following instructions and install npm, protractor and chrome headless in the Jenkins box here

Executing HTML testsuite using Jenkins

I have recorded some simple selenium tests by Selenium IDE. Now I want to run those tests in Jenkins.
Which plugin to Jenkins do I need to do that? And how to run the tests step by step?
My test suite is in HTML.
Can you provide detailed steps for it?
Why isn't enough to run the selenium tests from maven though jenkins? This is how we made it work. If your jenkins is running on unix environment you should bear in mind that additional configuration of the system are needed.

Resources