Skip to content

Repository details

rohandudam edited this page Aug 12, 2024 · 5 revisions

Repository details

Project Root
   
   |_ conf: For all configurations and credential files
   
   |_ core_helpers: Contains our web app and mobile app helpers and DriverFactory  

   |_ endpoints: Contains our Base Mechanize, different End Points, API Player, API Interface

   |_ integrations: Contains cross-browsers, reporting tools and reporting channel integrations (BrowserStack, SauceLabs, Lambdatest, TestRail, Tesults, Slack, Gmail) 

   |_ log: Log files for all tests

   |_ page_objects: Contains our PageFactory, different Page Objects examples

   |_ screenshots: For screenshots

   |_ tests: Put your tests here

   |_ utils: All utility modules (ssh_util, compare csv, compare images, Base Logger, etc) are kept in this folder

   |_ conftest.py: Configuration file to add different fixtures used in py.test

a) conf - All the configurations and credential files are maintained in the respective .py file. Each parameter in the conf file is stored as key/value pair. In our framework, we are using conf files for fetching the data and locator values. For example, for one of the pages of Selenium Tutorial, test needs form details like name, email, phone, and gender which we store in a conf file as shown below.

example_form_conf.py

name = "name"
email = "email"
phone_no = phone_no
gender = "gender"

The same details can be fetched from the example_conf.py file using the below code in the test script.

import conf.example_form_conf as conf

name = conf.name
email = conf.email
phone = conf.phone_no
gender = conf.gender

b) core_helpers - This folder consists on web app and mobile app helper (previously we used to call it as Base Page and Mobile Base Page), supporting helper files, drivers and DriverFactory.

c) integrations - This folder consists of cross-browsers integrations (BrowserStack, LambdaTest and SauceLabs), reporting tools integrations (TestRail, Tesults) and reporting channels integrations (Slack, Email/Gmail) etc.

d) log - While running a test, we may need some information to be logged in the console and a log file. Information could be any detail depending on our project requirement. This information helps us to understand the test steps and any failure/success of the test execution. We have a class called Base_Logging() which wraps around Python's logging module and takes care of logging functionality.

e) page_objects - This folder consists of Page Objects that represent a webpage. The Page Object Model makes it easy and quick to modify tests to suit corresponding changes in the GUI. We create a Page object for each page. The test script will interact with the methods defined in these Page objects. For more details about Page Object model refer to our blogs on Page Object Model and Page Object Tutorial

f) tests - This folder consists of sample test scripts to validate the workflow in the web application. The test is very easy to read and need not be modified in case of any underlying changes to individual pages. The sample tests in the repository would fill the example form in the selenium-tutorial-main page and get redirected to the selenium-tutorial-redirect page when the form is submitted. Any change to the page elements can be handled by updating the locators_conf.py without changing the test script.