Starting the app

Tests can be easily run with main module of the framework.

from selenium_generator import main

if __name__ == "__main__":
    main.main()

The framework needs loaded configuration for test execution. The main module loads configuration and run tests with test runner according to loaded configuration. If no configuration is specified, framework will use the default configuration.

Show the default config

scenarios: "scenarios"
data: "data"
pages: "pages"

report:
    screenshots: true
    clean: true
    params:
        output: "./reports/"
        report_name: "TestReport"
        report_title: "Test results"

tags: []

drivers:
  chrome:
    remote: false
    allowed: true

  firefox:
    remote: false
    allowed: true

Note

Default configuration can be used only for local drivers of the latest versions.

If the default config isn’t sufficient there are two ways of setting custom configuration.

  1. To place file config.yaml with the custom configuration in the root directory of the project

  2. To load the config file from any other directory and to specify the path to it with CLI argument

$ python main.py -c custom_dir/custom_config.yaml

The framework tries to load config in following order:

  1. Path from CLI argument

  2. config.yaml file from the root folder of the project

  3. Default config

Custom start

You might find the main module insufficient for running the tests, especially if the framework is being extended. In this case you can create your own workflow and override the default behaviour by calling the needed methods individually. Just be aware that the configuration might need to be extended as well as its schema for validation.