I am using Selenium with java , and I want to do the setup of CI ustin Gitlab CI - selenium

I have been trying to find out how should I execute the Selenium Test (Java) using gitlab CI
I have created an automation framework and I am able to run the maven project via jenkins
I wanted to run the same maven project with the help of gitlab ci runner
My Code will be available on git and just need to trigger the execution as a when developer checks in the code
Please help me out with this setup, I have been trying to find out the solution but couldn't figure out any

I suggest you to read about jeknins and gitlab hooks here: https://docs.gitlab.com/ee/integration/jenkins.html
, In general, these hooks "follows" any push you perform to you gitlab repository, and run the desired build on them, including pulling the latest code.

Related

jenkins selenium tests ci

I have created a Jenkins maven task to run selenium tests on one project, and now I want to use these selenium test in a proper way for CI.
Actually, I have a Jenkins task which 1-builds the project, 2- uses sonar, 3 - deploys the project. I would like to add the selenium tests to this process. The question is: can I run the selenium tests before deployment? Is it necessary to do a previous deploy for the selenium tests before the real deployment? Is there anyway to simulate a deployment or something like that so I can run the selenium tests?I would appreciate If you could advise me on how to do or any plugin which could help me.
As per my understanding, To deal with the scenario you should run the selenium test on QA environment. If all test pass then deployment should start for staging etc.
Additionally, once the deployment is done on staging, then selenium script should run again, test staging and if something went wrong then rollback from staging should be happened.
I never tried it but you can use below github plug-in for deployment(in case you are using github) :-
https://wiki.jenkins.io/display/JENKINS/GitHub+plugin
If you are using SVN then use below :-
https://www.packtpub.com/mapt/book/application_development/9781783553471/3
Hope it will help you :)

Setting up Protractor e2e tests with Bamboo CI

We use Protractor to automate our angular app and now need to run those protractor tests from a Bamboo CI server.
I'm new to Bamboo and was wondering if anybody could either show me how to or point me to a web article that would show me how to trigger/execute my protractor tests from Bamboo server.
Locally, we run the tests using gulp protractor which all run and pass; Now I'd like to execute those same tests from a Bamboo server.
I was only able to find some articles on Google that shows how to set up Selenium with Bamboo. I understand that Protractor uses Selenium under the hood but am just not sure if Protractor would follow the same steps as Selenium does, when setting it up on a Bamboo CI machine.
If Protractor follows a different setup than Selenium on a Bamboo CI machine, could someone please point me to either another article or simply show the steps here if it's simple to do.
This question is already a few months old, but it's still unanswered, so I try to help. ;)
I haven't tried it by myself, but there is a gulp task in bamboo. (as also mentioned here: gulp tasks execution in bamboo)
I think you have to install node.js on you bamboo server and then you can just add the gulp task to your plan and configure it for your needs.
Short field description:
Node.js executable: should be filled if you have installed Node.js on your bamboo server, or select the correct one if you have installed multiple versions of Node.js (I haven't installed Node.js, so there is no executable available for me)
Gulp executable: I'm not so femiliar with gulp, but I think this default value should be correct in the most cases.
Task: In your case you should insert protractor here

Selenium test schedule via Jenkins

I would like to schedule task which is login to a partner site and prolongs a license. I found that it can do Selenium. After I faced issue with scheduler and found article here http://www.learnseleniumtesting.com/ about Jenkins configuration. Now I cannot understand how to run test from selenium in Jenkins. Is there need good knowledge in python or java ? Also I found that RC standalone selenium server is deprecated and avoided to be using now. Is there need deep diving into using these tools for executing 5-7 action on site ?
I feel that Selenium is great for doing any tasks that you may find yourself doing over and over again. For "prolonging a license" on a partner site I think this is the perfect tool for you. We setup Jenkins to run certain Selenium tests after each commit and other Selenium tests every night. If you need me to go into more detail about how the setup looks I would be glad to show you more details.
Adding Jenkins build information to help show how we did it.
1) The first step is to get a build in Jenkins that will compile any code you have and deploy a war if needed with something similar to the following: mvn -P release clean test package. We set ours to build #midnight shown in the picture below.
2) After this build finishes it triggers the next job to run this command shown in the image below: mvn -Dtest -P smokeTest clean verify

Triggering Jenkins after TFS build

I was wondering if it is possible for Jenkins to be notified after TFS finishes a build.
I'm trying to make a system where, after the TFS build, Jenkins is used to run automated selenium tests.
Thanks in advance!
You have a few options:
You could use a GenericTest to trigger Jenkins and include as part of the Build Definition. This also allows your script to communicate pass/fail information back to the build.
You could just include an InvokeProcess workflow activity to trigger Jenkins. The process would be similar to this or this.
Or you could use a tool that would trigger after a Team Build has finished. Normally people would use tools that then deploy stuff. Most of these tools trigger a Powershell script at some point, which would allow you to trigger the test run:
Octopus Deploy
TFS Deployer

gtihub, jenkins and automated testing

I have several projects in Github, and I´d like to linked them to Jenkins in order to automate testing and improve the quality code.
Is there any free online way to do it?
The git jenkins plugin allows you to link a Jenkins job to a git repository (included GitHub). Then use custom actions to run unit tests.