Arjuna Test Project

A fixed project structure has to be followed for an Arjuna test project. This brings consitency across mutliple test automation implementations within and outside your organization.

Following are critical project directories, sub-directories and files. Arjuna could be creating other directories corresponding to some in-progress or experimental features. They are not listed here.

Creating a New Test Project using create-project Command

You can easily create the project skeleton using create-project command in Arjuna CLI.

It is a simple to run command. For example:

python -m arjuna create-project --project /path/to/proj_name

This command creates a test project with name proj_name at the path provided. proj_name must be a valid Arjuna name.

Purpose of Different Directories and Files

Please also note that some of these directories are mandatory as a part of Arjuna test project structure.

When you create project using create-project command, Arjuna places placeholder.txt files so that when you check-in your code in a code repository, empty directories are not ignored during check-in. It is advised to retain them, until you make use of them by placing files in them as per your project needs.

  • config: Contains configuration files.

    • data.yaml: File containing definitions of Data Configurations.

    • envs.yaml: File containing definitions of Environment Configurations.

    • groups.yaml: File containing definitions of Test Groups.

    • project.yaml: Your project’s configuration file containing project-level configuration settings.

    • withx.yaml: You can define custom identifiers in this file in YAML format. These can be referred to across the project in code as well as GNS files.

    • If you place any .yaml files directly in this directory or in a sub-directory herein, they can be found by Arjuna using the name or relative path.

  • data: Contains files that act as data sources and data references (WIP).

    • source: Data source files go here.

    • reference: Data reference files go here.

      • contextual: Contextual Data References for auto-loading

      • indexed: (Not supported yet) Indexed Data References for auto-loading

  • l10n: Contains localizaation files

  • lib: Sub-package for your framework code.
    • Contains @for_X resources to be used across project. Note that for more complex projects you can change it to a package instead of a module and add all importable names to __all__ in file in the package.

  • guiauto: Contains GUI automation related files.

    • driver: Arjuna automatically downloads drivers. In case you switch this off in a configuration, Arjuna picks Selenium driver executables from this directory in respective OS folders.

    • namespace: GNS (Gui Namespace) files go here.

  • hook: Contains Arjuna’s hook modules.

    • Can contain configurtion related function hooks enabled by Arjuna.

  • httpauto: Contains HTTP automation related files.

    • message: HTTP Message Files go here.

  • report: Reports are generated here. Each test run is associated with a run-id.

    • Timestamp-RunID: Root directory of report for a given run. If –static-rid is provided then the directory is named as the run id that you provide with -rid CLI option or as the default run id which is mrun.

      • html: HTML report (report.html) generated by pytest-html plugin goes here.

      • log: arjuna.log file can be found here.

      • screenshot: Contains screenshots taken for a test run.

      • xml: JUnit-style XML report (report.xml) goes here. It is primarily meant for Jenkins or other CI software intergrations with Arjuna.

  • test: Contains test files. As of now Arjuna supports coded tests only.

    • module: Coded tests are written as Python modules and are placed here. Sub-packaging of modules is allowed.

    • This is pytest’s file, which is auto-generated by Arjuna in every run. Any changes done by you are over-written.

  • script: This directory is meant to contain Arjuna scripts (or your own custom scripts or batch files.)