How do I download and install the CLI?
The CLI is designed to work on both Windows and macOS/Linux machines. For simplicity, the examples below are all for macOS/Linux. To download it, first visit the Functionize dashboard page. Select the tab marked Integrations, then on Command Line Interface. Download the zip file and extract it. Then open the extracted Functionize directory from a terminal or command line window. For Windows, run the install.bat file. For macOS/Linux run the install.sh file (use sudo for this).
$ cd ~/Downloads/Functionize-cli-1-1-1/
$ sudo sh install.sh
Finally, the installer will ask for the Client ID and Client Secret. These can be found by going to the profile menu at the top right of the Functionize GUI and clicking API Keys in the dropdown menu. Scroll down to the section marked User Keys.
How do I use the CLI?
The Functionize CLI comes with built-in help. Simply giving the Functionize command will bring up a list of all current commands. There is also a detailed list of commands on the Command Line Interface tab of the Functionize GUI. All commands take flags. The Functionize CLI will prompt if the right flags for a command are not provided.
$ functionize list-projects
$ functionize list-tests --id 12345 --env live
Some commands take a large number of flags. Find project IDs, test IDs, etc., using the list commands above.
$ functionize create-load-test --environment staging --duration 2000 --region us-west --project 123 --target_id 456 --load_target 135 --title load_test_1
How do I test against a local instance?
As a developer, don’t push every change to the cloud before it can be tested because it wastes time. So, one of the most powerful features in the CLI is the ability to run tests against a local instance of the site. Just start a local server on a suitable port. Then use the following command to create a tunnel from the Functionize Test Cloud back to the server on the appropriate port (8080 in this case).
$ functionize start-tunnel 8080
Next, go to the Functionize GUI and find the test to run. Now click on the gear icon and choose Edit Test Settings. Find and click on the Advanced tab, scroll down and in the URL Override enter localhost. Now when this test is run, the test itself still runs on Functionize’s VMs, but they are accessing the server running on the local machine.
How do I create a new test?
When developing a new feature, chances are that there is no suitable test. Our new Adaptive Language Processing (ALP™) engine makes it easy to create new tests. Simply write out all the test steps in plain English and save as a spreadsheet. Upload this test to the Functionize Test Cloud using the CLI.
$ functionize create-nlp-test new_feature_test.csv
NB, the system needs to create the test on a running server. Therefore, the user will probably need to push the new feature to a staging server. Once the test is created, run it against the local server instance.