If you are behind a corporate firewall and need a proxy to access websites, make sure that npm is configured accordingly. For example:
npm config set http-proxy http://proxy.example.com:8080 npm config set https-proxy http://proxy.example.com:8080
With node installed, install the mabl CLI by running the following command in your terminal:
npm i -g @mablhq/mabl-cli
To see the installed version of the CLI run:
Once you install the CLI, you will need to authenticate using either your mabl login credentials or workspace API key. If you are using the CLI on your local machine, you can simply login using your mabl credentials:
mabl auth login
Authentication using the API key as detailed below is available only to the Enterprise plan users.
On the other hand, if you want to use the mabl CLI as part of your build process, you should authenticate with the API key. To get the API key, go to the mabl app -> Settings -> APIs to copy the key and use with the following command:
mabl auth activate-key <YOUR-API-KEY>
Running tests on your local machine
To run tests locally, including using headless mode, please authenticate with your mabl login credentials since API authentication is only meant for running tests on deployment as part of your CI/CD pipeline.
To check if you are successfully authenticated, run:
$ mabl auth info > Logged in as user [[email protected]] > Login expires in [3 hours, 23 minutes]
To update your version of the mabl CLI tool, run:
You can get, set, and list available configuration options using the list subcommand. This command can be used to set the current workspace default in the mabl CLI amongst other options.
# view current configuration values mabl config list # set a configuration value mabl config set workspace <WORKSPACE_ID> # get a configuration value mabl config get workspace
The mabl CLI supports forward proxies. To use a proxy, set the
http.proxy configuration value to the URL for your proxy server. The URL can contain basic authentication credentials and port information.
If you receive an error that the URL you are specifying is invalid, please confirm that you are using Node version 10 or greater.
# add a proxy with no credentials on port 3128 mabl config set http.proxy http://proxy.mycompany.com:3128 # add a proxy using credentials on port 3128 mabl config set http.proxy http://"username:password"@proxy.mycompany.com:3128 # delete the current proxy setting mabl config delete http.proxy
If you receive a
407 error when logging in, this is a proxy authentication error. Ensure your password and username have been set correctly above.
Proxy settings only apply to mabl traffic
Note that if the above configuration option is set, only mabl-specific requests will go through the forwarding proxy. For local test executions, all traffic to the application under test will use the proxy settings of the browser or the operating system.
By default, the CLI verifies server certificates are issued by a known certificate authority. Certificate verification may fail if your proxy is intercepting HTTPS traffic. If you are using a proxy and SSL verification is failing, you can disable certificate verification as shown below. We suggest you do this only if required.
# disable SSL verification mabl config set http.sslVerify false # delete the current ssl verification setting to use the default mabl config delete http.sslVerify
Updated about a month ago