Constants

Constants #

To make writing test scripts easier, Loadero offers variety of constants which can be accessed via LOADERO_CONSTANTS object using dot notation. LOADERO_CONSTANTS has 2 nested objects:

  • LOADERO_CONSTANTS.network
  • LOADERO_CONSTANTS.sample_files

network #

Network modeGetterString value
Defaultdefault"default"
4Gmobile_4g"4g"
3.5G/HSPDAmobile_hsdpa"hsdpa"
3Gmobile_3g"3g"
GPRSmobile_gprs"gprs"
Edgemobile_edge"edge"
High jitterjitter"jitter"
High latencylatency"latency"
Asymmetricasymmetric"asymmetric"
Satellite phonesatellite"satellite"
5% packetlosspacketloss5"5packet"
10% packetlosspacketloss10"10packet"
20% packetlosspacketloss20"20packet"
50% packetlosspacketloss50"50packet"
100% packetlosspacketloss100"100packet"
Customcustom"custom"
# Example of updating network conditions using constants
update_network(driver, LOADERO_CONSTANTS.network.mobile_4g)

sample_files #

Sample fileGetterString value
100 KB (PNG)png_100KB"loaderoSample100KB.png"
1 MB (PNG)png_1MB"loaderoSample1MB.png"
5 MB (PNG)png_5MB"loaderoSample5MB.png"
30 MB (PNG)png_30MB"loaderoSample30MB.png"
100 MB (TXT)txt_100MB"loaderoSample100MB.txt"
# Example of setting a sample file using constants
set_file(
    driver,
    e(driver, "css", "input[type=FILE]"),
    LOADERO_CONSTANTS.sample_files.png_100KB,
)