I have 4 chained freestyle jobs in Jenkins (A to D) which are used for Continuous delivery. Chained jobs currently start with job A whenever a change is pushed to my Git repostiroy.
The last job (job D) is running my Selenium tests, by default against firefox browser.. but now I'm planning to execute the same tests against Chrome browser, on a nightly basis.. Confusing part is how to configure jobs to execute tests against Chrome browser
For example: (jobs chaining)
A --> B --> C --> D
In my case i'would like to run job A every night but I want to be able to specify the target browser as a parameter when triggering job D.
Any help much appreciated!!
You somehow have to pass the target browser as a parameter to your job D.
You could add two jobs before job A that will react to your different configurations. Say you add jobs A1
and A2
:
Job A1
will be configured for your Git pushes
, and will trigger job A
with a parameter targetBrowser = firefox
and job A2
will be configured for your nightly builds, and will trigger job A
with parameter targetBrowser = chrome
.
You would then pass this browser parameter to each job until job D, that will use this parameter when launching Selenium tests.
So you would have :
Instead triggering from job A, you could start the triggering from job D and call previous job each time before executing your action.
Job D1
will be configured for your Git pushes
and job D2
will be configured for your nightly builds. Both will execute your Selenium tests (D1 against Firefox, D2 against Chrome), but before doing that they will call job C, which will in turn call job B before doing its actions, and so on.
Schema would look like this :