diff --git a/testsuite/features/step_definitions/navigation_steps.rb b/testsuite/features/step_definitions/navigation_steps.rb index 28078aab2fd..98050fc437a 100644 --- a/testsuite/features/step_definitions/navigation_steps.rb +++ b/testsuite/features/step_definitions/navigation_steps.rb @@ -557,10 +557,14 @@ click_button_and_wait('Sign In', match: :first) step 'I should be logged in' + $current_user = user + $current_password = passwd end Given(/^I am authorized$/) do - step %(I am authorized as "#{$current_user}" with password "#{$current_password}") + user = get_context('user') || 'admin' + password = get_context('password') || 'admin' + step %(I am authorized as "#{user}" with password "#{password}") end When(/^I sign out$/) do diff --git a/testsuite/features/support/env.rb b/testsuite/features/support/env.rb index ef18104ea22..f715f30de6f 100644 --- a/testsuite/features/support/env.rb +++ b/testsuite/features/support/env.rb @@ -257,8 +257,8 @@ def process_code_coverage $feature_filename = feature_path.split(%r{(\.feature|/)})[-2] next if get_context('user_created') == true - # Core features are always handled using admin user, the rest will use its own user based on feature filename - if (feature_path.include? 'core') || (feature_path.include? 'reposync') || (feature_path.include? 'finishing') + # Some stages have features that always requires admin user, the rest will use its own user based on feature filename + if (feature_path.include? 'core') || (feature_path.include? 'reposync') || (feature_path.include? 'finishing') || (feature_path.include? 'build_validation') $current_user = 'admin' $current_password = 'admin' else