Setting up Continuous Integration of Protractor using Jenkins

后端 未结 5 1268
走了就别回头了
走了就别回头了 2020-12-04 12:26

I am writing automation test scripts using Protractor and now I need to set up the CI for this using Jenkins.

Tasks it needs to perform are:

  1. Starting t
5条回答
  •  臣服心动
    2020-12-04 12:59

    I know this already resolved and want to target for beginner to create Jenkins job and running test. I suggest to use selenium-server-standalone jar in configuration file and call configuration file from Jenkins.
    conf.js

        ..  
        exports.config = {
            //seleniumAddress: 'http://localhost:4444/wd/hub',  
            seleniumServerJar: 'node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.5.3.jar',
        ....
        //html reporter logic
        .....
    

    Creating Jenkins Job

    • Install node js on Jenkins Server

    • Install Html Publisher Plugin for end to end testing report

    • Create Freestyle Project or whatever your needs

    • Go to Build Section -> Add build step and choose Execute Windows batch command if Jenkins server in Windows otherwise choose Execute Shell for Linux

    • Call conf.js (install packages and call your configuration file)

    • For reporting Got to Post-Build Actions Section -> Add Publish Html Reports and call your report file (file assuming from root of your project)

    However you can customize execution command using gulp or similar other packages. Thanks

提交回复
热议问题