#!/usr/bin/env bash

source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../../../../bash/common.lib.sh"

run_behat() {
    local code=0

    print_header "Testing (Behat - CLI commands, regular scenarios; @cli && ~@todo)" "Sylius"
    run_command "vendor/bin/behat --strict --no-interaction -vvv -f progress --tags=\"@cli && ~@todo\"" || code=$?
    if [[ ${code} = 1 ]]; then
        run_command "vendor/bin/behat --strict --no-interaction -vvv -f progress --tags=\"@cli && ~@todo\" --rerun" ; code=$?
    fi

    return ${code}
}

run_behat
