From ae09f8a70a2e848c4a5fc70ac4ccff1bc3874eed Mon Sep 17 00:00:00 2001 From: Filipe Freire Date: Fri, 12 Jan 2018 09:45:02 +0000 Subject: gitlab-qa !155 push creates event on activity page --- qa/qa/page/activity/activity.rb | 18 ++++++++++++++++++ qa/qa/specs/features/activity/activity_spec.rb | 24 ++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 qa/qa/page/activity/activity.rb create mode 100644 qa/qa/specs/features/activity/activity_spec.rb (limited to 'qa') diff --git a/qa/qa/page/activity/activity.rb b/qa/qa/page/activity/activity.rb new file mode 100644 index 00000000000..fc885deedf1 --- /dev/null +++ b/qa/qa/page/activity/activity.rb @@ -0,0 +1,18 @@ +module QA + module Page + module Activity + class Activity < Page::Base + ## + # TODO, define all selectors required by this page object + # + # See gitlab-org/gitlab-qa#155 + # + view 'app/views/projects/activity.html.haml' + + def go_to_push_events + click_button 'Push events' + end + end + end + end +end diff --git a/qa/qa/specs/features/activity/activity_spec.rb b/qa/qa/specs/features/activity/activity_spec.rb new file mode 100644 index 00000000000..5eab95c95f3 --- /dev/null +++ b/qa/qa/specs/features/activity/activity_spec.rb @@ -0,0 +1,24 @@ +module QA + feature 'activity page', :core do + scenario 'push creates an event in the activity page' do + Runtime::Browser.visit(:gitlab, Page::Main::Login) + Page::Main::Login.act { sign_in_using_credentials } + + Factory::Resource::Project.fabricate! do |project| + project.name = 'awesome-project' + project.description = 'create awesome project test' + end + + Factory::Repository::Push.fabricate! do |push| + push.file_name = 'README.md' + push.file_content = '# This is a test project' + push.commit_message = 'Add README.md' + end + + Page::Activity::Activity.act { go_to_push_events } + + expect(page).to have_content('Add README.md') + expect(page).to have_content('pushed to branch master') + end + end +end -- cgit v1.2.1 From 669c34db6c75d826b6b692232f235f9dcc492082 Mon Sep 17 00:00:00 2001 From: Filipe Freire Date: Fri, 12 Jan 2018 10:22:35 +0000 Subject: Add relevant element for push event button --- qa/qa/page/activity/activity.rb | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'qa') diff --git a/qa/qa/page/activity/activity.rb b/qa/qa/page/activity/activity.rb index fc885deedf1..7970d8186c6 100644 --- a/qa/qa/page/activity/activity.rb +++ b/qa/qa/page/activity/activity.rb @@ -2,15 +2,12 @@ module QA module Page module Activity class Activity < Page::Base - ## - # TODO, define all selectors required by this page object - # - # See gitlab-org/gitlab-qa#155 - # - view 'app/views/projects/activity.html.haml' + view 'app/views/projects/activity.html.haml' do + element :push_events_button, 'Push events' + end def go_to_push_events - click_button 'Push events' + click_button :push_events_button end end end -- cgit v1.2.1 From d0a4ab21f0927fa602e1bab972f545e29d8cf206 Mon Sep 17 00:00:00 2001 From: Filipe Freire Date: Fri, 12 Jan 2018 16:45:00 +0000 Subject: improvements after CR --- qa/qa/page/activity/activity.rb | 15 --------------- qa/qa/page/project/activity.rb | 19 +++++++++++++++++++ qa/qa/specs/features/activity/activity_spec.rb | 24 ------------------------ qa/qa/specs/features/project/activity_spec.rb | 19 +++++++++++++++++++ 4 files changed, 38 insertions(+), 39 deletions(-) delete mode 100644 qa/qa/page/activity/activity.rb create mode 100644 qa/qa/page/project/activity.rb delete mode 100644 qa/qa/specs/features/activity/activity_spec.rb create mode 100644 qa/qa/specs/features/project/activity_spec.rb (limited to 'qa') diff --git a/qa/qa/page/activity/activity.rb b/qa/qa/page/activity/activity.rb deleted file mode 100644 index 7970d8186c6..00000000000 --- a/qa/qa/page/activity/activity.rb +++ /dev/null @@ -1,15 +0,0 @@ -module QA - module Page - module Activity - class Activity < Page::Base - view 'app/views/projects/activity.html.haml' do - element :push_events_button, 'Push events' - end - - def go_to_push_events - click_button :push_events_button - end - end - end - end -end diff --git a/qa/qa/page/project/activity.rb b/qa/qa/page/project/activity.rb new file mode 100644 index 00000000000..c343266f01d --- /dev/null +++ b/qa/qa/page/project/activity.rb @@ -0,0 +1,19 @@ +module QA + module Page + module Project + class Activity < Page::Base + view 'app/views/shared/_event_filter.html.haml' do + element :push_events_button, 'Push events' + end + + def go_to_push_events + click_link :push_events_button + end + + def self.path + '/activity' + end + end + end + end +end diff --git a/qa/qa/specs/features/activity/activity_spec.rb b/qa/qa/specs/features/activity/activity_spec.rb deleted file mode 100644 index 5eab95c95f3..00000000000 --- a/qa/qa/specs/features/activity/activity_spec.rb +++ /dev/null @@ -1,24 +0,0 @@ -module QA - feature 'activity page', :core do - scenario 'push creates an event in the activity page' do - Runtime::Browser.visit(:gitlab, Page::Main::Login) - Page::Main::Login.act { sign_in_using_credentials } - - Factory::Resource::Project.fabricate! do |project| - project.name = 'awesome-project' - project.description = 'create awesome project test' - end - - Factory::Repository::Push.fabricate! do |push| - push.file_name = 'README.md' - push.file_content = '# This is a test project' - push.commit_message = 'Add README.md' - end - - Page::Activity::Activity.act { go_to_push_events } - - expect(page).to have_content('Add README.md') - expect(page).to have_content('pushed to branch master') - end - end -end diff --git a/qa/qa/specs/features/project/activity_spec.rb b/qa/qa/specs/features/project/activity_spec.rb new file mode 100644 index 00000000000..3dd82bb0587 --- /dev/null +++ b/qa/qa/specs/features/project/activity_spec.rb @@ -0,0 +1,19 @@ +module QA + feature 'activity page', :core do + scenario 'push creates an event in the activity page' do + Runtime::Browser.visit(:gitlab, Page::Main::Login) + Page::Main::Login.act { sign_in_using_credentials } + + Factory::Repository::Push.fabricate! do |push| + push.file_name = 'README.md' + push.file_content = '# This is a test project' + push.commit_message = 'Add README.md' + end + + Page::Project::Activity.act { go_to_push_events } + + expect(page).to have_content('Add README.md') + expect(page).to have_content('pushed to branch master') + end + end +end -- cgit v1.2.1 From a1a5d142981379087ca7183d402300a3a3b6ad52 Mon Sep 17 00:00:00 2001 From: Filipe Freire Date: Fri, 12 Jan 2018 17:43:13 +0000 Subject: improvement after CR - test reaches Activity page - the actual git push seems to be failing - had problems with defining selectors --- qa/qa.rb | 2 ++ qa/qa/page/project/activity.rb | 15 +++++++-------- qa/qa/page/project/sidebar.rb | 18 ++++++++++++++++++ qa/qa/specs/features/project/activity_spec.rb | 2 ++ 4 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 qa/qa/page/project/sidebar.rb (limited to 'qa') diff --git a/qa/qa.rb b/qa/qa.rb index 4803432aeee..5562d59abe4 100644 --- a/qa/qa.rb +++ b/qa/qa.rb @@ -100,6 +100,8 @@ module QA module Project autoload :New, 'qa/page/project/new' autoload :Show, 'qa/page/project/show' + autoload :Sidebar, 'qa/page/project/sidebar' + autoload :Activity, 'qa/page/project/activity' module Settings autoload :Common, 'qa/page/project/settings/common' diff --git a/qa/qa/page/project/activity.rb b/qa/qa/page/project/activity.rb index c343266f01d..47bfca087fb 100644 --- a/qa/qa/page/project/activity.rb +++ b/qa/qa/page/project/activity.rb @@ -2,16 +2,15 @@ module QA module Page module Project class Activity < Page::Base - view 'app/views/shared/_event_filter.html.haml' do - element :push_events_button, 'Push events' - end + ## + # TODO, define all selectors required by this page object + # + # See gitlab-org/gitlab-qa#155 + # + view 'app/views/shared/_event_filter.html.haml' def go_to_push_events - click_link :push_events_button - end - - def self.path - '/activity' + click_on 'Push events' end end end diff --git a/qa/qa/page/project/sidebar.rb b/qa/qa/page/project/sidebar.rb new file mode 100644 index 00000000000..3e4f783f105 --- /dev/null +++ b/qa/qa/page/project/sidebar.rb @@ -0,0 +1,18 @@ +module QA + module Page + module Project + class Sidebar < Page::Base + ## + # TODO, define all selectors required by this page object + # + # See gitlab-org/gitlab-qa#155 + # + view 'app/views/layouts/nav/sidebar/_project.html.haml' + + def go_to_activity + click_on class: 'shortcuts-project-activity' + end + end + end + end +end diff --git a/qa/qa/specs/features/project/activity_spec.rb b/qa/qa/specs/features/project/activity_spec.rb index 3dd82bb0587..8934a61b76b 100644 --- a/qa/qa/specs/features/project/activity_spec.rb +++ b/qa/qa/specs/features/project/activity_spec.rb @@ -10,6 +10,8 @@ module QA push.commit_message = 'Add README.md' end + Page::Project::Sidebar.act { go_to_activity } + Page::Project::Activity.act { go_to_push_events } expect(page).to have_content('Add README.md') -- cgit v1.2.1 From d7caa2f8ccf554cdd0763db0cca1dc1c39ba30df Mon Sep 17 00:00:00 2001 From: Filipe Freire Date: Tue, 16 Jan 2018 20:20:57 +0000 Subject: improvements after CR + move activity click to side.rb + add element check on activity.rb + minor fixes --- qa/qa.rb | 1 - qa/qa/page/menu/side.rb | 5 +++++ qa/qa/page/project/activity.rb | 13 +++++++------ qa/qa/page/project/sidebar.rb | 18 ------------------ qa/qa/specs/features/project/activity_spec.rb | 5 ++--- 5 files changed, 14 insertions(+), 28 deletions(-) delete mode 100644 qa/qa/page/project/sidebar.rb (limited to 'qa') diff --git a/qa/qa.rb b/qa/qa.rb index 5562d59abe4..2247098b997 100644 --- a/qa/qa.rb +++ b/qa/qa.rb @@ -100,7 +100,6 @@ module QA module Project autoload :New, 'qa/page/project/new' autoload :Show, 'qa/page/project/show' - autoload :Sidebar, 'qa/page/project/sidebar' autoload :Activity, 'qa/page/project/activity' module Settings diff --git a/qa/qa/page/menu/side.rb b/qa/qa/page/menu/side.rb index 1df4e0c2429..3361fd188cb 100644 --- a/qa/qa/page/menu/side.rb +++ b/qa/qa/page/menu/side.rb @@ -6,6 +6,7 @@ module QA element :settings_item element :repository_link, "title: 'Repository'" element :top_level_items, '.sidebar-top-level-items' + element :activity_link, "title: 'Activity'" end def click_repository_setting @@ -29,6 +30,10 @@ module QA yield end end + + def go_to_activity + click_on class: 'shortcuts-project-activity' + end end end end diff --git a/qa/qa/page/project/activity.rb b/qa/qa/page/project/activity.rb index 47bfca087fb..d766dbfb8f6 100644 --- a/qa/qa/page/project/activity.rb +++ b/qa/qa/page/project/activity.rb @@ -2,12 +2,13 @@ module QA module Page module Project class Activity < Page::Base - ## - # TODO, define all selectors required by this page object - # - # See gitlab-org/gitlab-qa#155 - # - view 'app/views/shared/_event_filter.html.haml' + view 'app/views/shared/_event_filter.html.haml' do + ## + # TODO, This needs improvement, _event_filter.html.haml + # doesn't have proper elements defined + # + element :push_events, '.event-filter' + end def go_to_push_events click_on 'Push events' diff --git a/qa/qa/page/project/sidebar.rb b/qa/qa/page/project/sidebar.rb deleted file mode 100644 index 3e4f783f105..00000000000 --- a/qa/qa/page/project/sidebar.rb +++ /dev/null @@ -1,18 +0,0 @@ -module QA - module Page - module Project - class Sidebar < Page::Base - ## - # TODO, define all selectors required by this page object - # - # See gitlab-org/gitlab-qa#155 - # - view 'app/views/layouts/nav/sidebar/_project.html.haml' - - def go_to_activity - click_on class: 'shortcuts-project-activity' - end - end - end - end -end diff --git a/qa/qa/specs/features/project/activity_spec.rb b/qa/qa/specs/features/project/activity_spec.rb index 8934a61b76b..ba94ce8cf28 100644 --- a/qa/qa/specs/features/project/activity_spec.rb +++ b/qa/qa/specs/features/project/activity_spec.rb @@ -10,12 +10,11 @@ module QA push.commit_message = 'Add README.md' end - Page::Project::Sidebar.act { go_to_activity } + Page::Menu::Side.act { go_to_activity } Page::Project::Activity.act { go_to_push_events } - expect(page).to have_content('Add README.md') - expect(page).to have_content('pushed to branch master') + expect(page).to have_content('pushed new branch master') end end end -- cgit v1.2.1 From 80e224c829183109b339205b86ded31b6aca47eb Mon Sep 17 00:00:00 2001 From: Filipe Freire Date: Thu, 18 Jan 2018 18:38:02 +0000 Subject: improve interaction with activity on side.rb --- qa/qa/page/menu/side.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'qa') diff --git a/qa/qa/page/menu/side.rb b/qa/qa/page/menu/side.rb index 3361fd188cb..00b7eba62b0 100644 --- a/qa/qa/page/menu/side.rb +++ b/qa/qa/page/menu/side.rb @@ -32,7 +32,9 @@ module QA end def go_to_activity - click_on class: 'shortcuts-project-activity' + within_sidebar do + click_on 'Activity' + end end end end -- cgit v1.2.1 From 350dbca41c2be6717d4c9f5800ef6dd60b06d932 Mon Sep 17 00:00:00 2001 From: Filipe Freire Date: Thu, 18 Jan 2018 18:52:03 +0000 Subject: improve push events selector in activity.rb --- qa/qa/page/project/activity.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'qa') diff --git a/qa/qa/page/project/activity.rb b/qa/qa/page/project/activity.rb index d766dbfb8f6..0196922c889 100644 --- a/qa/qa/page/project/activity.rb +++ b/qa/qa/page/project/activity.rb @@ -3,11 +3,7 @@ module QA module Project class Activity < Page::Base view 'app/views/shared/_event_filter.html.haml' do - ## - # TODO, This needs improvement, _event_filter.html.haml - # doesn't have proper elements defined - # - element :push_events, '.event-filter' + element :push_events, "event_filter_link EventFilter.push, _('Push events')" end def go_to_push_events -- cgit v1.2.1