Gulp is a build tool much like Grunt. It caters the need to run tasks for building websites. In addition, you can perform the following tasks related to web development.

  • Reloading the browser (After the file is saved)
  • Using SaaS and other preprocessors
  • Optimizing assets (JavaScript, Images, CSS)
  • Spinning up a web server

Coming to protractor, you can run multiple JavaScript files containing protractor script using this tool. To implement gulp on protractor script, follow the following steps.

  1. Use webstorm editor to open the project. Right-click on project name to add a new folder.image001
  2. Name the folder “Test’ and click OK.image003
  3. Drag the test.js file into the test folder. This will display the Move window. Click OK to complete the process.image005
  4. Right-click the file name and go to Refactor->Rename to rename the test.js file.image007

Provide a file name and click Refactor button.image009

  1. Right-click on folder and add another js file in the test folder.image011
  2. Enter the file name and click OK.image013
  3. Write the following code in the testsub.js file.image015
  4. Modify the gulp.src() method in gulpfile.js file by writing the following code.image017
  5. All the files with .js extension will be included and executed.
  6. The guplfile.js will look like the following.image019
  7. Start Selenium server using the following command.image021
  8. Run the following command to run protractor script.image023