Sakuli CLI commands

sakuli create project

npx sakuli create project [ <path> ] [ <suiteName> ] [ --force | -f ] [ --package ]


Generates a default project structure


Positionals:
  path                  Path to create testsuite                                    [optional][default: $PWD]
  suiteName             Name of testsuite                                           [optional][default: sakuli_test_suite]
  
Options:
  --force (alias -f)    Forces sakuli to create testsuite
  --package             Create additional package.json for testsuite

This creates a Sakuli testsuite folder with the testsuite.suite and testsuite.properties files and a case1 folder containing an empty check.js. With the --package option, it is possible to create an additional package.json. Further information on how to set up a Sakuli project and the needed files can be found here.

sakuli create masterkey

npx sakuli create masterkey [ --algorithm ]


Generates a new masterkey


Positionals:
  algorithm             The algorithm to create a key for                           [optional][default: "aes-128-cbc"]

This command outputs a masterkey which can be used to encrypt a secret with the sakuli encrypt command or to decrypt a secret in a testcase with a Sakuli function like Environment.decryptSecret().

sakuli enable-modules

npx sakuli enable-modules


Configures and enables modules

This command starts an assistant which will guide you through the setup of modules. More information on how to use the enable-modules command can be found here.

sakuli encrypt

npx sakuli encrypt <secret> --masterkey


Encrypts a secret via provided masterkey


Positionals:
  secret                The secret to encrypt                                       [required]
  
Options:
  --masterkey           The masterkey used for encryption                           [required]

To use this command it is necessary to create a masterkey with npx create masterkey first. With npx sakuli encrypt you can now encrypt a secret or password which then can be decrypted in the Sakuli testcase with one of the decryption functions like Environment.decryptSecret().

sakuli decrypt

npx sakuli decrypt <secret> --masterkey


Decrypts a secret via provided masterkey


Positionals:
secret                The secret to decrypt                                       [required]

Options:
--masterkey           The masterkey used for decryption                           [required]

With npx sakuli decrypt you can now decrypt a secret for e.g. debugging purposes.

sakuli migrate

npx sakuli migrate <path>


Transforms all legacy testsuites into new syntax


Positional
  path                  path to a legacy suite                                      [required]

Since Sakuli had some minor changes in the syntax with v2, old Sakuli v1 testcases need to be adapted to the new syntax. With this command Sakuli takes over this task.

sakuli run

npx sakuli run <path> [ options ]


Runs a Sakuli Suite


Positionals:
  path                  path to Sakuli suite                                        [required]
Options:
  browser=''            Browser which is started by the WebDriver
  ui-only=''            Configures whether the testsuite runs in ui-only mode
  reuseBrowser=''       Configures whether the browser is reused after each testcase