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 mode | Getter | String value |
---|---|---|
Default | default | "default" |
4G | mobile_4g | "4g" |
3.5G/HSPDA | mobile_hsdpa | "hsdpa" |
3G | mobile_3g | "3g" |
GPRS | mobile_gprs | "gprs" |
Edge | mobile_edge | "edge" |
High jitter | jitter | "jitter" |
High latency | latency | "latency" |
Asymmetric | asymmetric | "asymmetric" |
Satellite phone | satellite | "satellite" |
5% packetloss | packetloss5 | "5packet" |
10% packetloss | packetloss10 | "10packet" |
20% packetloss | packetloss20 | "20packet" |
50% packetloss | packetloss50 | "50packet" |
100% packetloss | packetloss100 | "100packet" |
Custom | custom | "custom" |
Network constants need to be used as arguments for the
update_network
custom command.
# Example of updating network conditions using constants
update_network(driver, LOADERO_CONSTANTS.network.mobile_4g)
sample_files
#
Sample file | Getter | String 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" |
Sample file constants need to be used as arguments for the
set_file
custom command
# Example of setting a sample file using constants
set_file(
driver,
e(driver, "css", "input[type=FILE]"),
LOADERO_CONSTANTS.sample_files.png_100KB,
)