1

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.

Christina
  • 43
  • 7
  • Could I use Cargo Maven plugin to solve this? If yes, should I add it on the Selenium project or to the main project? – Christina Aug 10 '17 at 10:00
  • Refer my answer here .. It will explain how to trigger selnium test - https://stackoverflow.com/questions/16782414/how-to-run-testng-tests-on-jenkins – Shubham Jain Aug 10 '17 at 11:32
  • Thanks, but my problem is not to run a task with only selenium tests in Jenkins. I want to achieve the whole cycle of CI. When there are modifications on the main project, there must be a deployment so the selenium tests are applied on those modifications. QA environment could be a solution, but I have read that there is someway to start and stop a deployment for running the tests, and I am trying to figure out how ... – Christina Aug 10 '17 at 12:39

1 Answers1

1

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 :)

Shubham Jain
  • 16,610
  • 15
  • 78
  • 125