utils
Provides miscellaneous utility methods.

decrypt

Decrypt text
Usage example:
1
// to encrypt plaintext into ciphertext
2
const encrypt = utils.encrypt('https://www.wikipedia.org/');
3
log.info(encrypt); // will print b757ba2c2fc50fbb511d596816ca06c4fa56f4e98ce222f30bc58d5251ed635e
4
5
// to decrypt ciphertext and use it in script
6
const decrypt = utils.decrypt(encrypt);
7
log.info(decrypt); // will print ENCRYPTED
8
9
web.init();
10
web.open(decrypt); // will open https://www.wikipedia.org/
11
12
// to get original plaintext use getDecryptResult
13
const value = decrypt.getDecryptResult();
14
log.info(value); //will print https://www.wikipedia.org/
Copied!
Parameters:
Name
Type
Description
text
String
Text
Returns:
Object - DecryptResult Object with getDecryptResult method

encrypt

Encrypt text
Usage example:
1
// to encrypt plaintext into ciphertext
2
const encrypt = utils.encrypt('https://www.wikipedia.org/');
3
log.info(encrypt); // will print b757ba2c2fc50fbb511d596816ca06c4fa56f4e98ce222f30bc58d5251ed635e
4
5
// to decrypt ciphertext and use it in script
6
const decrypt = utils.decrypt(encrypt);
7
log.info(decrypt); // will print ENCRYPTED
8
9
web.init();
10
web.open(decrypt); // will open https://www.wikipedia.org/
11
12
// to get original plaintext use getDecryptResult
13
const value = decrypt.getDecryptResult();
14
log.info(value); //will print https://www.wikipedia.org/
Copied!
Parameters:
Name
Type
Description
text
String
Text
Returns:
String - Encrypted text

pause

Pause test execution for the given amount of milliseconds.
Parameters:
Name
Type
Description
ms
Number
Milliseconds to pause the execution for.

readCsv

Reads data from csv file
Parameters:
Name
Type
Description
filePath
String
Absolute path to file
options
Object

writeCsv

Writes data into csv file
Parameters:
Name
Type
Description
filePath
String
Absolute path to file
data
Array
CSV data in format [{column_name_1: 'foo', column_name_2: 'bar'}]
Last modified 24d ago