CLI Integration

aiTest-CLI-screenshot

CLI Integration

The aiTest Command Line Interface (CLI) is a tool which offers a seamless and efficient way to control and manage all of your aiTest services in a centralized manner, streamlining your workflow and improving overall productivity.

How to use CLI Integration

Installing:

  • To install this CLI tool you can run the below command for Linux/Mac.
  
    $pip3 install aitest-cli
  
  • To install this CLI tool you can run the below command for windows.
  
    $pip install aitest-cli
  

How to get configuration information:

  • 1) To get User Identifier follow the below steps:
  
    visit aitest -> settings -> copy User Identifier.
  
  • 2) To get the Client ID and Client secret ID:
  
    You need to send a request via email to this email id aitest-support@appliedaiconsulting.com
    You will receive the Client ID and Client secret ID via email.
  

How to get Testrun ID:

  • 1) To get Testrun ID follow the below steps:
  
    visit aitest -> select test  -> copy testrun ID from dashboard.
  

How to use - -help command:

  • To understand the various options and commands available in the aitest CLI, you can use the following commands:
  • 1) For an overview of the aitest CLI execute the below command:
  • Input:
  
    aitest --help
  
  • Output:
  
    Usage: aitest [OPTIONS] COMMAND [ARGS]...

    The aitest Command Line Interface is a unified tool to manage your aitest services.

    To see help text, you can run:

   aitest --help

   aitest command --help

   aitest command subcommand --help

   Options:
       --help  Show this message and exit.

   Commands:
       configure  If this command is run with no arguments, you will be prompted...
       run        If this command is run with testrun id as an argument, aitest...
       status     If this command is run with testrun id as an argument, aitest...
  
  • 2) To view information about a specific command, such as the ‘configure’ command:
  • Input:
  
    aitest run -id 82e256e4-918e-11ed-b437-26f4364d7489 -p git_token -w 5 
  

Note: i) Enter git token/password only if you used git url of the automation code for creating the test otherwise no need to enter git token/password.
How to generate git token:
For GitHub - Click here
For GitLab - Click here

ii) Enter the waiting time in minutes, to get testrun result.

  • Output:
  
    Test created successfully
        Test Name : Test 1
        Testrun ID : 47782fb0-9711-11ed-809d-62cd909dddc7

        Testrun is in progress, result will be displayed once it get completed.

        test status : completed

        +--------------+-----------------+--------------------------------------+--------+------------+
        | browser_name | browser_version |          test run result id          | status | time taken |
        +--------------+-----------------+--------------------------------------+--------+------------+
        |   firefox    |       104       | 47c53f08-9711-11ed-b277-c6d8e5da78fe |  fail  |   0.001    |
        |   firefox    |       104       | 47d350e8-9711-11ed-b277-c6d8e5da78fe |  fail  |   0.001    |
        |   firefox    |       104       | 47deb2b2-9711-11ed-b277-c6d8e5da78fe |  fail  |   0.001    |
        |   firefox    |       104       | 47eca5fc-9711-11ed-b277-c6d8e5da78fe |  fail  |   0.001    |
        |   firefox    |       104       | 47fa16ec-9711-11ed-b277-c6d8e5da78fe |  fail  |   0.002    |
        +--------------+-----------------+--------------------------------------+--------+------------+
  
  • 3) Run the aitest status command:
  • Input:
  
    aitest status -id ae96545a-79da-11ed-8d95-762fbb2b81b4
  
  • Output:
  
     test status : completed

        +--------------+-----------------+--------------------------------------+--------+------------+
        | browser_name | browser_version |          test run result id          | status | time taken |
        +--------------+-----------------+--------------------------------------+--------+------------+
        |    chrome    |        79       | 4bb515ca-972a-11ed-8880-768461f941d2 |  fail  |   0.001    |
        |    chrome    |        79       | 4bc35e78-972a-11ed-8880-768461f941d2 |  fail  |   0.001    |
        |    chrome    |        79       | 4bd2e85c-972a-11ed-8880-768461f941d2 |  fail  |   0.002    |
        |    chrome    |        79       | 4be168dc-972a-11ed-8880-768461f941d2 |  fail  |   0.003    |
        |    chrome    |        79       | 4c01d432-972a-11ed-8880-768461f941d2 |  fail  |   0.002    |
        +--------------+-----------------+--------------------------------------+--------+------------+

  

Questions answered

  • How aiTest CLI works ?
  • Default commands needed to make CLI work
×

Subscribe

The latest tutorials sent straight to your inbox.