Skip to main content

Dai-CT Execution Command Line Interface

This feature lets you run multiple execution types easily from the terminal against Continuous Testing Cloud using the command line interface (CLI).

Installation

To install the package, run this following command (with sudo permissions):

npm install -g dai-ct

Configuration

The CLI must be configured before running it.
To configure the CLI, add a file named credentials.json in the root directory of the project. It needs to contain:

  • cloudUrl
  • accessKey

This file needs to be in json format.

credentials.json Example

{
"cloudUrl" : "https://mycloud.experitest.com",
"accessKey" : "myAccessKey"
}

Run Cypress and Playwright Tests

You can run Cypress or Playwright projects.
Cypress and Playwright projects are run asynchronously. The response received is immediate.

dai-ct cypress run -p or --project <path to the project> -c or --conf <path to conf file>
dai-ct playwright run -p or --project <path to the project> -c or --conf <path to conf file>

Execution Test Parameters

NameMandatoryDescription
-p or --projectYesCypress project to run
-c or --confNoConfiguration file for the requested execution.

A file named digitalai.json (in json format) with the required configuration.

For more information, see : 



Start a Cypress Execution

Execute a Playwright Job

Run Cypress Command Example

dai-ct cypress run -p /Users/MyUser/Documents/cypressProject --conf digitalai.json

Run Playwright Command Example

dai-ct playwright run -p /Users/MyUser/Documents/playwrightProject --conf digitalai.json

Get Cypress and Playwright Execution Status

you can get the status of the Cypress or Playwright execution.

dai-ct playwright status -e or --execid <executionID>
dai-ct Cypress status -e or --execid <executionID>

Execution Status Parameters

NameMandatoryDescription
-e or --execidYesExecution Test ID

Get Status Playwright Command Example

dai-ct playwright status -e 555b203f-40f2-4615-9f70-2e1df1fbe011

Get Cypress and Playwright Execution Logs

you can get the zip file of the logs of the Cypress or Playwright execution.
you can save the logs to a specific directory, if no directory chosen, the logs will download to the current directory.

dai-ct playwright logs -e or --execid -d or --dirpath <executionID>
dai-ct Cypress logs -e or --execid -d or --dirpath <executionID>

Logs Parameters

NameMandatoryDescription
-e or --execidYesExecution Test ID
-d or --dirpathNoDirectory path to save the logs to

Get Logs Playwright Command Example

dai-ct playwright logs -e 555b203f-40f2-4615-9f70-2e1df1fbe011 -d /Users/MyUser/Documents

Run Espresso and XCUITest Tests

You can run Espresso or XCUITest projects.
Espresso and XCUITest projects are run asynchronously, the response received is immediate

dai-ct espresso run -a or --app <path to the app> -t or --testApp <path to the test app file> -c or --conf <path to conf.json file>
dai-ct xcuitest run -a or --app <path to the app> -t or --testApp <path to the test app file> -c or --conf <path to conf.json file>

Parameters

NameMandatoryDescription
-c or --confYesConfiguration file for the execution.

A file named conf.json (in json format) with the required parameters for the executions.
For more information see Running Async Espresso/XCUITest.

Only the mandatory parameters are supported:
* runningType
* deviceQueries
* appUrl
* testAppUrl
-a or --appNo (only if appUrl is provided in the conf.json)Application under test
-t or --testAppNo (only if testAppUrl is provided in the conf.json)Espresso / XCUI tests(.zip extension only)

Run Espresso Command Example

dai-ct espresso run -a /Users/MyUser/Documents/myApp.apk -t /Users/MyUser/Documents/myTests.apk -c conf.json 

Run XCUITest Command Example

dai-ct xcuitest run -a /Users/MyUser/Documents/myApp.ipa -t /Users/MyUser/Documents/myTests.zip -c conf.json 

conf.json Example

{
"runningType": "coverage", //Mandatory
"deviceQueries" : "@os='android'", //Mandatory
"appUrl" : "https://actualapp.apk", //Not Mandatory if App argument is given in cli
"testAppUrl" : "https://testapp.apk" //Not Mandatory if TestApp argument is given in cli
}