diff options
author | Richard Clamp <richardc@unixbeard.net> | 2017-10-25 07:55:42 +0300 |
---|---|---|
committer | Richard Clamp <richardc@unixbeard.net> | 2017-10-30 14:48:40 +0000 |
commit | ce3b81b953f04caabee30498bb4719c59b8b5d34 (patch) | |
tree | 1358c537720bea55ce8405a7b38f7c749c49b271 /qa/qa/page | |
parent | 4598c00a8f565a33c4460ae920ce7a65ba6540cc (diff) | |
download | gitlab-ce-ce3b81b953f04caabee30498bb4719c59b8b5d34.tar.gz |
Add tests for mattermost login via oauth
* Adds Runtime::Scenario as a place to record the properties of the
Scenario we're interested in.
* Adds a positional argument to Test::Integration::Mattermost to specify
Runtime::Scenario.mattermost
* Adds Page::Mattermost::{Main,Login} to model the mattermost pages we
need to interact with.
* Adds qa/features/mattermost/login_spec to perform a login via oauth
and ensure we are logged in.
Diffstat (limited to 'qa/qa/page')
-rw-r--r-- | qa/qa/page/mattermost/login.rb | 19 | ||||
-rw-r--r-- | qa/qa/page/mattermost/main.rb | 11 |
2 files changed, 30 insertions, 0 deletions
diff --git a/qa/qa/page/mattermost/login.rb b/qa/qa/page/mattermost/login.rb new file mode 100644 index 00000000000..2001dc5b230 --- /dev/null +++ b/qa/qa/page/mattermost/login.rb @@ -0,0 +1,19 @@ +module QA + module Page + module Mattermost + class Login < Page::Base + def initialize + visit(Runtime::Scenario.mattermost + '/login') + end + + def sign_in_using_oauth + click_link class: 'btn btn-custom-login gitlab' + + if page.has_content?('Authorize GitLab Mattermost to use your account?') + click_button 'Authorize' + end + end + end + end + end +end diff --git a/qa/qa/page/mattermost/main.rb b/qa/qa/page/mattermost/main.rb new file mode 100644 index 00000000000..e636d7676f4 --- /dev/null +++ b/qa/qa/page/mattermost/main.rb @@ -0,0 +1,11 @@ +module QA + module Page + module Mattermost + class Main < Page::Base + def initialize + visit(Runtime::Scenario.mattermost) + end + end + end + end +end |