This lesson will help you learn the basics of working with the mabl command-line interface.
Make sure you are comfortable with the following lessons:
Are you ready to supercharge your day with the powers of the CLI? 💪
The mabl CLI...
Let's get started! 🏁
The mabl CLI is a NodeJS application that runs in the terminal window on your own desktop, and allows access to most mabl functionality and can be invoked from scripts.
✅ First challenge completed. Ready for more?
You supply a command to the mabl CLI. Each command has arguments, some of them may be the same as in other commands, but some are command-specific. Both mabl tests list and mabl plans list support the --limit argument.
You can see the list of commands by running the mabl command without any options, and the available arguments for each command using mabl command --help.
Let's jump in!
Before you can interact with mabl, you have to authenticate using the mabl auth login command. Your session will remain valid for 4 hours. 🕓
mabl auth info allows you to verify that you are logged in and the time left in your session.⏳
You may also have to change configuration defaults with the mabl config command that we will cover in the next lesson.
You’re in? Let’s move on...
If your head is spinning, not to worry...
The mabl web app comes to the rescue! ⛑
Navigate to the test detail page under Tests, and notice the >_ icon that shows how to invoke the CLI.
Ready to 🏃🏽♀️ a test?
The mabl run command allows you to run tests locally on your machine.
The test will spin up a new instance of a browser and you can see all the browser interactions as the test runs.
Is that browser getting in the way? Use the --headless option to hide the browser window while you work on something else.
Do you want to get creative? 🎨
The mabl tests create command allows you to quickly create a new test: it only takes an application URL and a test name to get started.
For more granular control, you may set the application, environment, etc - but now you know how to query all those arguments, right?
One last thing before we go!
Many mabl commands use IDs to identify applications, environments, etc.
The list command comes to the rescue
In addition, the mabl UI can also help when you visit the mabl CLI section in the Settings -> APIs page.
Stay tuned for the sequel where we go into more depth on the mabl CLI! 🍿