Table of content

Protractor Project Structure

The Simple answer is You cannot generalize.

We will see the protractor project folder structure without any project-specific customization. I have given project structures in steps, so you can choose from it when it fulfills your requirement.

Basic Protractor project

  • Protractor API : This is actual protractor package which contains all the required functionalities
  • PO : All the required page objects will be stored in PO files; it is a directory inside which you can store page objects of different pages.
  • Lib : Repeated steps will be created into functions, and those are stored under the Lib folder
  • Specs : All the test cases are stored in different files and then put into Spec files.

basic-protractor-project-structure

Page Objects Model in Protractor

A project with file utils

  • ExcelUtils : Create files that will read and write data from Excel files under ExcelUtils.
  • JSONUtils : Create files that will read and write data from JSON files under JSONUtils.
  • Data : Data folder will have all the files to be read and write
  • These not only can be used for data but also for page objects

protractor-project-structure-with-file-reading

Install Jenkins for Protractor

Project with Constants

  • ErrorsMessages: we will store all the error messages that occur in our application under the ErrorMessages folder.
  • StringsConstants : Instead of creating the string values, again and again, we can store them in files and put them under StringConstants.
  • Colorcodes : All the rgb, rgba, HEX color will be stored under the ColorCodes folder.
  • Not only above things you can store all kinds of constants here

protractor-project-structure-with-constants

Install Docker for Protractor

A project with Report and Logging

  • logging: Files which has the logic to generate the log for the frame will be put under logging
  • output : All the output files like reports, logs, and screenshots will be stored under the output folder.
  • report : Some people may have their own reporting mechanism; in such cases, they might need to create one more folder called report.

protractor-project-folder-with-logging

Writing an excel sheet

A project with an intermediate layer

  • intermediatelayer: this layer will have only one file, which will override all the functionalities provided by the protractor. This enables us to have encapsulation.

protractor-advanced-project

Implicitly Wait

Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions