diff --git a/test/smoke/spec/snyk_auth_spec.sh b/test/smoke/spec/snyk_auth_spec.sh index 9e582de4ca..37b8d87a07 100644 --- a/test/smoke/spec/snyk_auth_spec.sh +++ b/test/smoke/spec/snyk_auth_spec.sh @@ -25,7 +25,7 @@ Describe "Snyk CLI Authorization" # Using timeout to not wait for browser confirmation When run timeout 5 snyk auth - The output should include "To authenticate your account, open the below URL in your browser." + The result of function check_auth_output should be success The result of function verify_login_url should include "snyk.io/login?token=" # URL found The status should be failure # TODO: unusable with our current docker issues diff --git a/test/smoke/spec/spec_helper.sh b/test/smoke/spec/spec_helper.sh index b7975028fc..e1cadad267 100644 --- a/test/smoke/spec/spec_helper.sh +++ b/test/smoke/spec/spec_helper.sh @@ -37,3 +37,8 @@ restore_is_ci_flags() { } check_if_regression_test() { ! [ "${REGRESSION_TEST}" = "1" ]; } + +check_auth_output() { + printf %s "$1" | grep -F -e "To authenticate your account, open the below URL in your browser." -e "Now redirecting you to our auth page, go ahead and log in," > /dev/null + echo $? +}