Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Table of Contents

Configuration

...

Client configuration in $HOME/.greenspector/config.yml

The main configuration file must be located in $HOME/.greenspector/config.yml
. To initialize it, simply use the command:

...

  • greenspectorApi is your GREENSPECTOR Server API URL (for example https://app.greenspector.com/api);
  • privateToken is your private token, available in the Preferences screen of on your GREENSPECTOR ServerWeb Interface.

The file file $HOME/.greenspector/config.yml should now existexists.

In case you are behind a proxy, set the proxyUrl property simply by using the command:

Code Block
languagebash
gspt set-proxy
or
gspt set-proxy --proxyUrl <proxyUrl>

...

This command will tell you whether your basic configuration and credentials are correct or not. 

...

Current working

...

folder

...

configuration in $CURRENT_FOLDER/.greenspector/config.yml

To use some of its features, we type the gspt command in a given folder ($CURRENT_FOLDER). The CLI generates and works with a file in the path In order to be able to use all the features of the GREENSPECTOR CLI, you also need a configuration file in your current working folder ($CURRENT_FOLDER/.greenspector/config.yml). This file contains the following fields:

Code Block
languagetext
title$CURRENT_FOLDER/.greenspector/config.yml
application: The<name of applicationthe nameapplication>
version: The version<version of the applicationapplication>
environment: The environment<environment to run the tests onon>
	platform: The platform<platform of the environment (mobile in ormost pccases)>
	os: The OS<OS of the environmentenvironment>
	version: The Version of the OS<version of this OS>
	device: <device name of the environmentenvironment>
device	browsers: <list Theof Devicebrowsers nameavailable ofon thethis environment

...

environment>

For example:

Code Block
languagetext
titleCURRENT$CURRENT_FOLDER/.greenspector/config.yml
application: MyFirstApplication
version: 0.1.2
environment:
	platform: mobile
	os: android
	version: "7"
	device: nexus6

...


	browsers:
	- chrome

You do not have to manually edit this configuration file, you can simply initialize it with the command:

Code Block
languagebash
gspt initprojectconfiguration -a "<Your application name>" -v "<Your version>"
or
gspt ipc -a "<Your application name>" -v "<Your version>"

Usage

...

This command will automatically set the fields application and version in you configuration file, other fields will be updated when you will start using CLI commands related to the Power Test Bench/Cloud service.

Usage

To use GREENSPECTOR Command Line, go to any folder and type the command:

Code Block
languagebash
gspt <command name>

Here is You will find below a list of the the available commands by features:.

Help

To get the The help of GREENSPECTOR Command Line :

Code Block
languagebash
gspt -h

Please note that the help is built in a tree way.
We You will only see only one help level at a time.

For example, to get the help of a command:Choose one of the following commands, depending on the level of help you need: general help, command help or subcommand help.

Code Block
languagebash
gspt -h
gspt <command name> -h

and to get the help of a subcommand:

Code Block
languagebash

gspt <command name> <subcommand name> -h

Ping

To Use this command to test the connection to your GREENSPECTOR Server and to see check that your settings are correct:

...

Code Block
languagebash
gspt meter <subcommand name>

Before using the meter command, you have to define your the application and the version you are working on by setting the config configuration file in the current folder by following instructions at <<current-working-folder-configuration, in paragraph Current working folder configuration in $CURRENT_FOLDER/.greenspector/config.yml.yml>>

Send measures

To Use this subcommand to send the measures results files from the current folder to the server:

...

This feature will read all the results files in the current folder and send their contents to your GREENSPECTOR Server.
When the sending is done successfully, files will be deletedPlease note that these files are deleted when they are successfully sent.

Power Test Bench/Cloud

...

This feature groups all the commands related to the Power Test Bench/Cloud service:

Code Block
languagebash
gspt testbench <subcommand name>

Before using the testbench command, you have to define your the application and the version you are working on by setting the config configuration file in the current folder by following instructions at <<current-working-folder-configuration, in paragraph Current working folder configuration in $CURRENT_FOLDER/.greenspector/config.yml.yml>>

Set the environment

To use the testbench command, you first need to set the environment for your project.
To do so, you should use this command:

...

This feature allows you to run a measure of a web site website on the Power Test Bench/Cloud.
To use this feature, you have to first configure the application name, version and the environment to run the measure on.
The command to run is:

Code Block
languagebash
gspt testbench measure-url --url <Web Site URL>

Examples:

Code Block
languagebash
gspt testbench measure-url --url https://greenspector.com/
gspt testbench measure-url --url https://greenspector.com/ --iterations 5 --browser chrome
gspt testbench measure-url --url https://www.mozilla.org/fr/ --browser firefox --report

...

4 - --report: (Beta feature) Automatically generate the test report in the .greenspector folder . (Wait and wait for the job to end, . (Default: false). Optional

This command will send a measure request to the server. After this measure has run on the Power Test Bench/Cloud, you will find the results on the web interface.

...

1 - --apkFiles: The APK(s) to benchmark. (If set multiple times, all the APK will be installed but only the first one will be probedmonitored). Mandatory option: Minimum 1

...

3 - --report: (Beta feature) Automatically generate the test report in the .greenspector folder . (Wait and wait for the job to end, . (Default: false). Optional

This command will send a measure request to the server. After this measure has run on the Power Test Bench/Cloud, you will find the results on the web interfaceWeb Interface.

Run your custom functional

...

tests on your APK / website

This feature allows you to run your custom functional tests on your Android application or web site on the Power Test Bench/Cloud.
To use this feature, you have to first configure the application name, version and the environment to run the measure on.
The command to run is:

Code Block
languagebash
 gspt testbench custom-tests --apkFiles <path to APK> --testPackages <Test package to launch> --monitoredPackage <package to monitor>

Examples:

Code Block
languagebash
gspt testbench custom-tests --apkFiles target/application.apk --apkFiles target/test.apk --testPackages com.greenspector.demo.tests --monitoredPackage com.greenspector.demo.app
gspt testbench custom-tests --apkFiles target/application.apk --apkFiles target/test-1.apk --apkFiles target/test-2.apk --testPackages com.greenspector.demo.tests.first --testPackages com.greenspector.demo.tests.second --monitoredPackage com.greenspector.demo.app --iterations 5
gspt testbench custom-tests --apkFiles target/application.apk --apkFiles target/test.apk --testPackages com.greenspector.demo.tests --monitoredPackage com.greenspector.demo.app --report

...

2 - --testPackages: For each APK containing functional tests you want to launch (i.e. UIAutomator UI Automator or Espresso APK tests), precise the name of the android package (i.e. package in file AndroidManifest.xml). All tests in those android Android packages will be launched. Mandatory option: Minimum 1

3 - --monitoredPackage: The package name of the Android application to monitor with the probes to get metrics about the process (process Datadata, process CPU…). Probes can monitor only one package at a time. For website, choose the browser where the tests runs (i.e. com.android.chrome). Mandatory option: Exactly 1

...

5 - --report: (Beta feature) Automatically generate the test report in the .greenspector folder . (Wait and wait for the job to end, .(Default: false). Optional

This command will send a measure request to the server. After this measure will ran on the Power Test Bench/Cloud, you will find the results on the web interfaceWeb Interface.

Related articles


Filter by label (Content by label)
showLabelsfalse
max5
spacescom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@185bfa9a
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel = "cli" and type = "page" and space = "DOCUMENTATION"
labelskb-how-to-article