diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 08:27:35 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 08:27:35 +0000 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /qa/qa/specs/features/browser_ui/1_manage/project | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) | |
download | gitlab-ce-0bddc398e06691ecd2db73d0c570a122a6585fe8.tar.gz |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'qa/qa/specs/features/browser_ui/1_manage/project')
4 files changed, 60 insertions, 49 deletions
diff --git a/qa/qa/specs/features/browser_ui/1_manage/project/add_project_member_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/project/add_project_member_spec.rb index 27350176a1e..e71cbeb9837 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/project/add_project_member_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/project/add_project_member_spec.rb @@ -15,9 +15,9 @@ module QA Page::Project::Menu.perform(&:click_members) Page::Project::Members.perform do |members| members.add_member(user.username) - end - expect(page).to have_content(/@#{user.username}(\n| )?Given access/) + expect(members).to have_content(/@#{user.username}( Is using seat)?(\n| )?Given access/) + end end end end diff --git a/qa/qa/specs/features/browser_ui/1_manage/project/create_project_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/project/create_project_spec.rb index 6d07f72a044..2f2f40cba3b 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/project/create_project_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/project/create_project_spec.rb @@ -11,12 +11,14 @@ module QA project.description = 'create awesome project test' end - expect(page).to have_content(created_project.name) - expect(page).to have_content( - /Project \S?awesome-project\S+ was successfully created/ - ) - expect(page).to have_content('create awesome project test') - expect(page).to have_content('The repository for this project is empty') + Page::Project::Show.perform do |project| + expect(project).to have_content(created_project.name) + expect(project).to have_content( + /Project \S?awesome-project\S+ was successfully created/ + ) + expect(project).to have_content('create awesome project test') + expect(project).to have_content('The repository for this project is empty') + end end end end diff --git a/qa/qa/specs/features/browser_ui/1_manage/project/import_github_repo_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/project/import_github_repo_spec.rb index 83dfb2d9639..d54ce0ac0fc 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/project/import_github_repo_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/project/import_github_repo_spec.rb @@ -1,30 +1,35 @@ # frozen_string_literal: true module QA - RSpec.describe 'Manage', :github, quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/issues/26952', type: :bug } do - describe 'Project import from GitHub' do + RSpec.describe 'Manage', :github, :requires_admin do + describe 'Project import' do + let!(:user) do + Resource::User.fabricate_via_api! do |resource| + resource.api_client = Runtime::API::Client.as_admin + end + end + + let(:group) { Resource::Group.fabricate_via_api! } + let(:imported_project) do - Resource::ProjectImportedFromGithub.fabricate! do |project| + Resource::ProjectImportedFromGithub.fabricate_via_browser_ui! do |project| project.name = 'imported-project' - project.personal_access_token = Runtime::Env.github_access_token - project.github_repository_path = 'gitlab-qa/test-project' + project.group = group + project.github_personal_access_token = Runtime::Env.github_access_token + project.github_repository_path = 'gitlab-qa-github/test-project' end end - after do - # We need to delete the imported project because it's impossible to import - # the same GitHub project twice for a given user. - api_client = Runtime::API::Client.new(:gitlab) - delete_project_request = Runtime::API::Request.new(api_client, "/projects/#{CGI.escape("#{Runtime::Namespace.path}/#{imported_project.name}")}") - delete delete_project_request.url - - expect_status(202) + before do + group.add_member(user, Resource::Members::AccessLevel::MAINTAINER) + end - Page::Main::Menu.perform(&:sign_out_if_signed_in) + after do + user.remove_via_api! end - it 'user imports a GitHub repo', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/385' do - Flow::Login.sign_in + it 'imports a GitHub repo', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/385' do + Flow::Login.sign_in(as: user) imported_project # import the project @@ -44,25 +49,28 @@ module QA end def verify_repository_import - expect(page).to have_content('This test project is used for automated GitHub import by GitLab QA.') - expect(page).to have_content(imported_project.name) + Page::Project::Show.perform do |project| + expect(project).to have_content('This test project is used for automated GitHub import by GitLab QA.') + expect(project).to have_content(imported_project.name) + end end def verify_issues_import QA::Support::Retrier.retry_on_exception do Page::Project::Menu.perform(&:click_issues) - expect(page).to have_content('This is a sample issue') - click_link 'This is a sample issue' + Page::Project::Issue::Show.perform do |issue_page| + expect(issue_page).to have_content('This is a sample issue') - expect(page).to have_content('We should populate this project with issues, pull requests and wiki pages.') + click_link 'This is a sample issue' - # Comments - comment_text = 'This is a comment from @rymai.' + expect(issue_page).to have_content('This is a sample first comment') + + # Comments + comment_text = 'This is a comment from @sliaquat' - Page::Project::Issue::Show.perform do |issue_page| expect(issue_page).to have_comment(comment_text) - expect(issue_page).to have_label('enhancement') + expect(issue_page).to have_label('custom new label') expect(issue_page).to have_label('help wanted') expect(issue_page).to have_label('good first issue') end @@ -71,26 +79,23 @@ module QA def verify_merge_requests_import Page::Project::Menu.perform(&:click_merge_requests) - expect(page).to have_content('Improve README.md') - click_link 'Improve README.md' + Page::MergeRequest::Show.perform do |merge_request| + expect(merge_request).to have_content('Improve readme') - expect(page).to have_content('This improves the README file a bit.') + click_link 'Improve readme' - # Review comment are not supported yet - expect(page).not_to have_content('Really nice change.') + expect(merge_request).to have_content('This improves the README file a bit.') - # Comments - expect(page).to have_content('Nice work! This is a comment from @rymai.') + # Comments + expect(merge_request).to have_content('[PR comment by @sliaquat] Nice work!') - # Diff comments - expect(page).to have_content('[Review comment] I like that!') - expect(page).to have_content('[Review comment] Nice blank line.') - expect(page).to have_content('[Single diff comment] Much better without this line!') + # Diff comments + expect(merge_request).to have_content('[Single diff comment] Good riddance') + expect(merge_request).to have_content('[Single diff comment] Nice addition') - Page::MergeRequest::Show.perform do |merge_request| expect(merge_request).to have_label('bug') - expect(merge_request).to have_label('enhancement') + expect(merge_request).to have_label('documentation') end end @@ -107,7 +112,9 @@ module QA def verify_wiki_import Page::Project::Menu.perform(&:click_wiki) - expect(page).to have_content('Welcome to the test-project wiki!') + Page::Project::Wiki::Show.perform do |wiki| + expect(wiki).to have_content('Welcome to the test-project wiki!') + end end end end diff --git a/qa/qa/specs/features/browser_ui/1_manage/project/view_project_activity_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/project/view_project_activity_spec.rb index fd6d26153ea..3609d083fde 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/project/view_project_activity_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/project/view_project_activity_spec.rb @@ -13,9 +13,11 @@ module QA end.project.visit! Page::Project::Menu.perform(&:click_activity) - Page::Project::Activity.perform(&:click_push_events) + Page::Project::Activity.perform do |activity| + activity.click_push_events - expect(page).to have_content('pushed new branch master') + expect(activity).to have_content('pushed new branch master') + end end end end |