Folder names and structures

As the framework starts to evolve, there needs to be some organization around the folder structure in the IDE, along with a naming convention. The IntelliJ IDE uses modules to organize the repo, and under those modules, users can create the folder structures. It is common to also separate the page object and utility classes from the test classes.

So, as an example, under the top-level folder src, create main/java/com/yourCo/page objects and test/java/com/yourCo/tests folders. From there, under each structure, users can create feature-based folders.

Also, to retain a completely independent set of libraries for the Selenium driver and utility classes, create a separate module called something like Selenium3 with the same folder structures. This will allow users to use the same driver class and utilities for any additional modules that are added to the repo/framework. It is common to automate testing for more than one application, and this will allow the inclusion of the module in those additional modules. Here are a few suggestions regarding folder naming conventions:

  • Name all the folders using lowercase names, so there won't be a mix-and-match of different standards.
  • Name the page object class folders after the features they pertain to; for instance, login for the LoginPO.java, email for the GmailPO.java, and so on.
  • Name the test class folders after the same features as the PO classes, but under the test folder. Then there can be a one-to-one correlation between the PO and test class folders.
  • Store the common base classes under a common folder under main.
  • Store the common setup classes under a common folder under test.
  • Store all the utility classes for the AUT under a utils folder under main.
  • Store all the suite files for the tests under a suites folder under test.

Here is an example of a folder structure for the Selenium3 module. Of course, there are no test folders under this one:

IntelliJ third-party class folder structure

Here is an example of a folder structure for an AUT module showing the PO and test class folders:

IntelliJ page object/test class folder structure
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.139.62.103