Edit

FAQs

This page lists FAQs (Frequently Asked Questions) about installing Gauge, running a Gauge specification (spec), configuring Gauge, language runners used with Gauge, and using text editors while writing a Gauge spec. To understand these concepts, see Gauge Documentation.

Uninstall Gauge

How can I uninstall Gauge

Gauge JavaScript

How to debug without IDE

I don’t see my question here

If you have any questions that are not answered you can get help from our Google group or you can chat with fellow Gauge users in the Gitter channel. You might also use Stack Overflow for “HOW DO I” type questions. For other questions and discussions,

Installation

Where is the Gauge executable installed by default?

Windows

%ProgramFiles%\gauge\bin

macOS

/usr/local/bin

linux

/usr/local/bin

Where are the plugins installed by default?

Windows

%APPDATA%\gauge\plugins

macOS

~/.gauge/plugins

linux

~/.gauge/plugins

What is GAUGE_HOME?

GAUGE_HOME environment variable can be used to customize config files and plugins installation location.

How can I manually install a plugin?

Download the plugin’s zip file from github release and install the plugin by using the -f flag.

gauge install <plugin_name> -f <path_to_gauge_csharp_zip_file>

Configuration

Note

Gauge specific properties are stored in gauge.properties under gauge configuration folder. Refer to Gauge Properties.

How can I increase the language runner timeout?

By setting

runner_connection_timeout = 3000

Execution

What is the order of execution of scenarios in a specification?

The scenarios should execute in the order they are specified when running in serial mode. But, when executed in parallel or when a scenario/specification uses a data table (data driven tests), all scenarios are parallelized and hence there will not be any order maintained.

We suggest that scenarios should be independent of each other.

Why we cannot skip all tests dynamically during a gauge run if there is a test failure?

If execution of a step fails, that step is marked as failed and execution of further steps in that scenario will be skipped and the execution of the next scenario begins. This is done because we encourage scenarios to be independent of each other.

Logs

Where does gauge log the test execution output. warnings, validation results etc?

You’ll find the logged at logs/gauge.log in your projects directory.

Note

logs is the default location for log files. This can be changed using logs_directory in project’s properties.

Where can I find gauge API logs for debugging IDE plugins?

You’ll find that at logs/api.log in your projects directory.

Note

logs is the default location for log files. This can be changed using logs_directory in project’s properties.

How can I customize the log directory location?

You can specify a custom directory by changing the logs_directory property under env/default/default.properties Refer to project’s properties.

logs_directory = my_custom_log_directory

Where does gauge non project specific logs like plugin installation etc.?

Windows

%APPDATA%\gauge\logs

macOS

~/.gauge/logs

linux

~/.gauge/logs

Uninstalling Gauge

How can I uninstall Gauge?

Remove the Plugins before uninstalling Gauge. For information about removing plugins, see Uninstall Plugins.

Prerequisite

Remove the Plugins before uninstalling Gauge. For information about removing plugins, see Uninstall Plugins.

While uninstalling Gauge, you must remove the Gauge folder (~/.gauge in Mac/Linux and in %APPDATA%Gauge in windows) manually. This folder contains Gauge config, logs and plugins.

Windows

Uninstall Gauge by using Chocolatey .

choco uninstall gauge

macOS

Uninstall Gauge by using HomeBrew .

brew uninstall gauge

Debian/APT

Uninstall Gauge by using the apt-get command:

sudo apt-get remove gauge

YUM/DNF

You can uninstall Gauge in one of the following ways:

Uninstall by using yum.

yum remove gauge

OR

Uninstall by using dnf.

dnf remove gauge

Freebsd

Delete the Gauge files from the installed location.

Curl

Delete the Gauge files from the installed location.

NPM

Uninstall Gauge by using npm.

npm uninstall -g @getgauge/cli

Note

If you have installed Gauge on your system by downloading the Gauge release from GitHub, then delete the Gauge files from the installed location.

Gauge JavaScript

How to debug without IDE

gauge-js supports debugging your test implementation code using node-inspector.

Requirements

Ensure you have the latest Chrome browser and node-inspector installed. Please consult the node-inspector documentation for installation instructions. Ensure that the binaries node-debug and node-inspector are available on PATH. Starting gauge-js with debugger You can do either of these:

Set the DEBUG key to true in env/<env-name>/js.properties file in your gauge project. Set the environment variable DEBUG=true when calling gauge. Like: DEBUG=true gauge specs/. This needs gauge v0.3.2 or newer.

How it works

Setting the debug option will launch the runner code through node-debug. It will start node-inspector, launch Chrome DevTools and pause on the first line of execution. You will need to continue execution to let gauge carry on with its execution.

You can set debugger; inside step implementation or hook callbacks to pause execution in the debugger. This retains the gauge context and gives you a full blown debugger to debug your test implementations.

Example:

gauge.step("There are <num> vowels.", function (num) {
    debugger;
    assert.equal(num, 5);
});

This will pause the debugger when this step’s callback is executed by gauge-js.

Caveats

The debugger exposes entire gauge-js runner code. You need to be quick enough to hit continue in the browser when node-inspector launches. If this takes too long, gauge will timeout connecting to the API. A workaround for this is to increase the runner_connection_timeout property to an acceptable value.

Gauge Python

How to change/rename default step implementation(step_impl) directory

Create python.properties file in the <PROJECT_DIR>/env/default directory and add the following line to it.

STEP_IMPL_DIR = PATH_TO_STEP_IMPLEMENTATION_DIR

Note

The path specified in STEP_IMPL_DIR property should be relative to project root.

How to use different version of python while running specs

By default the language runner uses python command to run specs. To change the default behaviour, add GAUGE_PYTHON_COMMAND property to the python.properties file in the <PROJECT_DIR>/env/default directory.

GAUGE_PYTHON_COMMAND = <python_command>
GAUGE_PYTHON_COMMAND = python3
GAUGE_PYTHON_COMMAND = python2

How to debug gauge-python without using an IDE

Gauge-Python supports debugging your test implementation code using pbd.

import pdb

The typical usage to break into the debugger from a running program is to insert

pdb.set_trace()

Execution will stop where it finds the above statement and you can debug.

Gauge Visual Studio Code

Why are some features not working?

If you notice that any of the documented features (ex. goto definition, Code Lens of implementation files, find usages) are not working then make sure the required language runner is installed, by running gauge version. If not installed, install using gauge install <plugin_name>.

Why does the debugger not stop at the right breakpoint (gauge-java)?

In Java projects, if the debugger does not stop at the right breakpoint, it is related to this issue.