Profile

Purpose

    We can specify single property file profile using the Profile feature
    This is useful if we want to specify different environment

Implementation

    In automation -> resource directory, we create a directory pertaining to our profile. eg. environment
    We then add the different profile property files, each containing info about the different environments to test on
      eg. dev.property, qa.property...

Define profile

    We then specify the profile in the properties.property file
    1
    # single config files. prefix: 'config.profile.'. select profile from inside the path
    2
    config.profile.environment = "./resources/properties/environment/"
    Copied!
      We prefix the profile with "config.profile" and then the profile name
      Additional profiles can be added using same syntax
        eg:
        1
        config.profile.suite = "./resources/properties/suite/"
        Copied!
          Here, we create new profile called "suite"

Specify Profile

    We can the specify the desired profile in Properties.property file
    1
    # environment
    2
    profile.environment = dev
    Copied!
      Syntax: profile.profileName = profile
      environment: the profile name we specified
        1
        config.profile.environment = "./resources/properties/environment/"
        Copied!
      dev: The property file containing the profile info. In this case: dev.property
Last modified 1yr ago