diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-13 15:09:22 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-13 15:09:22 +0300 |
commit | 286fe61013674fe2d245ffc8d2233baf09923e70 (patch) | |
tree | 2037291f5863105e54e75be056b49f7d62007cae /spec/support/helpers | |
parent | 4cb5e5011abfe8d50ac3a7ebd0018c563c6d7af4 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/helpers')
-rw-r--r-- | spec/support/helpers/graphql_helpers.rb | 4 | ||||
-rw-r--r-- | spec/support/helpers/login_helpers.rb | 13 |
2 files changed, 14 insertions, 3 deletions
diff --git a/spec/support/helpers/graphql_helpers.rb b/spec/support/helpers/graphql_helpers.rb index 35b1b802f35..370162b45f0 100644 --- a/spec/support/helpers/graphql_helpers.rb +++ b/spec/support/helpers/graphql_helpers.rb @@ -12,8 +12,8 @@ module GraphqlHelpers end # Run a loader's named resolver - def resolve(resolver_class, obj: nil, args: {}, ctx: {}) - resolver_class.new(object: obj, context: ctx).resolve(args) + def resolve(resolver_class, obj: nil, args: {}, ctx: {}, field: nil) + resolver_class.new(object: obj, context: ctx, field: field).resolve(args) end # Eagerly run a loader's named resolver diff --git a/spec/support/helpers/login_helpers.rb b/spec/support/helpers/login_helpers.rb index 1d42f26ad3e..6a4dcfcdb1e 100644 --- a/spec/support/helpers/login_helpers.rb +++ b/spec/support/helpers/login_helpers.rb @@ -51,7 +51,7 @@ module LoginHelpers def gitlab_enable_admin_mode_sign_in(user) visit new_admin_session_path - fill_in 'password', with: user.password + fill_in 'user_password', with: user.password click_button 'Enter Admin Mode' end @@ -62,6 +62,12 @@ module LoginHelpers click_link provider end + def gitlab_enable_admin_mode_sign_in_via(provider, user, uid, saml_response = nil) + mock_auth_hash_with_saml_xml(provider, uid, user.email, saml_response) + visit new_admin_session_path + click_link provider + end + # Requires Javascript driver. def gitlab_sign_out find(".header-user-dropdown-toggle").click @@ -71,6 +77,11 @@ module LoginHelpers expect(page).to have_button('Sign in') end + # Requires Javascript driver. + def gitlab_disable_admin_mode + click_on 'Leave Admin Mode' + end + private # Private: Login as the specified user |