Versions Compared

Key

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

Status
colourGreenYellow
titleUP TO DATEUPDATE

You can use Jenkins to launch your GREENSPECTOR Tests to measure your website or your mobile app.

Requirements

You need to install the GREENSPECTOR the GREENSPECTOR CLI on your Jenkins server

  • The GREENSPECTOR CLI file could be downloaded from the Modules page of your GREENSPECTOR Web Interface. You have to choose the executable which match your server OS.
  • Connect to your Jenkins server through ssh or ftp
  • Upload the GREENSPECTOR CLI on your Jenkins server and Slaves if any
  • Prefer to rename the file in gspt
  • For linux or mac environment, you need to give right of execution : chmod +x gspt
  • Prefer to put it in your path

...

Code Block
# launch 3 iterations of a benchmark on the site web
gspt --spinnerOff testbench measure-url --iterations 3 --url https://greenspector.com/fr/accueil/

...

If your application is already installed on the phone or is available on PlayStore, you need to precise the package name. For example, with this we launch 3 iterations on the application Netflix.

Code Block
gspt --spinnerOff testbench benchmark-apk --targetapkFile "com.netflix.mediaclient" --iterations 3

...

In other case, you need to pass an apk via a public url or an url accessible by your jenkins

Code Block
gspt --spinnerOff testbench benchmark-apk --targetapkFile https://dl.greenspector.com/demo/demo.apk --iterations 3

...

Or to pass an apk via an absolute PATH in JENKINS or relative PATH in your freestyle project

Code Block
gspt --spinnerOff testbench benchmark-apk --targetapkFile ./demo.apk --iterations 3

...

Code Block
# Path to your GDSL script in the working directory
PWD=$(pwd)
TEST_SUITE1="$PWD/greenspector-site.testgb"

# launch a custom test with your gdsl script
gspt --spinnerOff testbench custom-tests --monitoredPackage com.android.chrome --iterations 3 --testsSuite "suite1:$TEST_SUITE1" --networkMode WIFI 


  • You should set the monitoredPackage argument.

...