diff options
Diffstat (limited to 'features')
-rw-r--r-- | features/group/members.feature | 34 | ||||
-rw-r--r-- | features/project/team_management.feature | 20 | ||||
-rw-r--r-- | features/steps/group/members.rb | 65 | ||||
-rw-r--r-- | features/steps/project/team_management.rb | 77 |
4 files changed, 4 insertions, 192 deletions
diff --git a/features/group/members.feature b/features/group/members.feature index 1f9514bac39..e539f6a1273 100644 --- a/features/group/members.feature +++ b/features/group/members.feature @@ -4,40 +4,6 @@ Feature: Group Members And "John Doe" is owner of group "Owned" And "John Doe" is guest of group "Guest" - @javascript - Scenario: I should add user to group "Owned" - Given User "Mary Jane" exists - When I visit group "Owned" members page - And I select user "Mary Jane" from list with role "Reporter" - Then I should see user "Mary Jane" in team list - - @javascript - Scenario: Add user to group - Given gitlab user "Mike" - When I visit group "Owned" members page - When I select "Mike" as "Reporter" - Then I should see "Mike" in team list as "Reporter" - - @javascript - Scenario: Ignore add user to group when is already Owner - Given gitlab user "Mike" - When I visit group "Owned" members page - When I select "Mike" as "Reporter" - Then I should see "Mike" in team list as "Owner" - - @javascript - Scenario: Invite user to group - When I visit group "Owned" members page - When I select "sjobs@apple.com" as "Reporter" - Then I should see "sjobs@apple.com" in team list as invited "Reporter" - - @javascript - Scenario: Edit group member permissions - Given "Mary Jane" is guest of group "Owned" - And I visit group "Owned" members page - When I change the "Mary Jane" role to "Developer" - Then I should see "Mary Jane" as "Developer" - # Leave @javascript diff --git a/features/project/team_management.feature b/features/project/team_management.feature index 5888662fc3f..aed41924cd9 100644 --- a/features/project/team_management.feature +++ b/features/project/team_management.feature @@ -7,26 +7,6 @@ Feature: Project Team Management And "Dmitriy" is "Shop" developer And I visit project "Shop" team page - Scenario: See all team members - Then I should be able to see myself in team - And I should see "Dmitriy" in team list - - @javascript - Scenario: Add user to project - When I select "Mike" as "Reporter" - Then I should see "Mike" in team list as "Reporter" - - @javascript - Scenario: Invite user to project - When I select "sjobs@apple.com" as "Reporter" - Then I should see "sjobs@apple.com" in team list as invited "Reporter" - - @javascript - Scenario: Update user access - Given I should see "Dmitriy" in team list as "Developer" - And I change "Dmitriy" role to "Reporter" - And I should see "Dmitriy" in team list as "Reporter" - Scenario: Cancel team member Given I click cancel link for "Dmitriy" Then I visit project "Shop" team page diff --git a/features/steps/group/members.rb b/features/steps/group/members.rb index dcbf36df656..b04a7015d4e 100644 --- a/features/steps/group/members.rb +++ b/features/steps/group/members.rb @@ -4,71 +4,6 @@ class Spinach::Features::GroupMembers < Spinach::FeatureSteps include SharedPaths include SharedGroup include SharedUser - include Select2Helper - - step 'I select "Mike" as "Reporter"' do - user = User.find_by(name: "Mike") - - page.within ".users-group-form" do - select2(user.id, from: "#user_ids", multiple: true) - select "Reporter", from: "access_level" - end - - click_button "Add to group" - end - - step 'I select "Mike" as "Master"' do - user = User.find_by(name: "Mike") - - page.within ".users-group-form" do - select2(user.id, from: "#user_ids", multiple: true) - select "Master", from: "access_level" - end - - click_button "Add to group" - end - - step 'I should see "Mike" in team list as "Reporter"' do - page.within '.content-list' do - expect(page).to have_content('Mike') - expect(page).to have_content('Reporter') - end - end - - step 'I should see "Mike" in team list as "Owner"' do - page.within '.content-list' do - expect(page).to have_content('Mike') - expect(page).to have_content('Owner') - end - end - - step 'I select "sjobs@apple.com" as "Reporter"' do - page.within ".users-group-form" do - select2("sjobs@apple.com", from: "#user_ids", multiple: true) - select "Reporter", from: "access_level" - end - - click_button "Add to group" - end - - step 'I should see "sjobs@apple.com" in team list as invited "Reporter"' do - page.within '.content-list' do - expect(page).to have_content('sjobs@apple.com') - expect(page).to have_content('Invited') - expect(page).to have_content('Reporter') - end - end - - step 'I select user "Mary Jane" from list with role "Reporter"' do - user = User.find_by(name: "Mary Jane") || create(:user, name: "Mary Jane") - - page.within ".users-group-form" do - select2(user.id, from: "#user_ids", multiple: true) - select "Reporter", from: "access_level" - end - - click_button "Add to group" - end step 'I should see user "John Doe" in team list' do expect(group_members_list).to have_content("John Doe") diff --git a/features/steps/project/team_management.rb b/features/steps/project/team_management.rb index 6986c7ede56..ff4c9deee2a 100644 --- a/features/steps/project/team_management.rb +++ b/features/steps/project/team_management.rb @@ -4,25 +4,10 @@ class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps include SharedPaths include Select2Helper - step 'I should be able to see myself in team' do - expect(page).to have_content(@user.name) - expect(page).to have_content(@user.username) - end - - step 'I should see "Dmitriy" in team list' do + step 'I should not see "Dmitriy" in team list' do user = User.find_by(name: "Dmitriy") - expect(page).to have_content(user.name) - expect(page).to have_content(user.username) - end - - step 'I select "Mike" as "Reporter"' do - user = User.find_by(name: "Mike") - - page.within ".users-project-form" do - select2(user.id, from: "#user_ids", multiple: true) - select "Reporter", from: "access_level" - end - click_button "Add to project" + expect(page).not_to have_content(user.name) + expect(page).not_to have_content(user.username) end step 'I should see "Mike" in team list as "Reporter"' do @@ -34,60 +19,6 @@ class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps end end - step 'I select "sjobs@apple.com" as "Reporter"' do - page.within ".users-project-form" do - find('#user_ids', visible: false).set('sjobs@apple.com') - select "Reporter", from: "access_level" - end - click_button "Add to project" - end - - step 'I should see "sjobs@apple.com" in team list as invited "Reporter"' do - project_member = project.project_members.find_by(invite_email: 'sjobs@apple.com') - page.within "#project_member_#{project_member.id}" do - expect(page).to have_content('sjobs@apple.com') - expect(page).to have_content('Invited') - expect(page).to have_content('Reporter') - end - end - - step 'I should see "Dmitriy" in team list as "Developer"' do - user = User.find_by(name: 'Dmitriy') - project_member = project.project_members.find_by(user_id: user.id) - page.within "#project_member_#{project_member.id}" do - expect(page).to have_content('Dmitriy') - expect(page).to have_content('Developer') - end - end - - step 'I change "Dmitriy" role to "Reporter"' do - project = Project.find_by(name: "Shop") - user = User.find_by(name: 'Dmitriy') - project_member = project.project_members.find_by(user_id: user.id) - page.within "#project_member_#{project_member.id}" do - click_button project_member.human_access - - page.within '.dropdown-menu' do - click_link 'Reporter' - end - end - end - - step 'I should see "Dmitriy" in team list as "Reporter"' do - user = User.find_by(name: 'Dmitriy') - project_member = project.project_members.find_by(user_id: user.id) - page.within "#project_member_#{project_member.id}" do - expect(page).to have_content('Dmitriy') - expect(page).to have_content('Reporter') - end - end - - step 'I should not see "Dmitriy" in team list' do - user = User.find_by(name: "Dmitriy") - expect(page).not_to have_content(user.name) - expect(page).not_to have_content(user.username) - end - step 'gitlab user "Mike"' do create(:user, name: "Mike") end @@ -113,7 +44,7 @@ class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps project.team << [user, :reporter] end - step 'I click link "Import team from another project"' do + step 'I click link "Import team from another project"' do page.within '.users-project-form' do click_link "Import" end |