Commit d8a79016 by David Baumgold

Add a lettuce test for removing own admin permission on course team

parent 53ae1771
......@@ -71,3 +71,16 @@ Feature: Course Team
And she deletes me from the course team
And I log in
Then I do not see the course on my page
Scenario: Admins should be able to remove their own admin rights
Given I have opened a new course in Studio
And the user "harry" exists as a course admin
And I am viewing the course team settings
Then I should be marked as an admin
And I can add users
And I can delete users
When I remove admin rights from myself
Then I should not be marked as an admin
And I cannot add users
And I cannot delete users
And I cannot make myself a course team admin
......@@ -112,6 +112,11 @@ def marked_as_admin(_step, name, inverted):
assert world.is_css_present(flag_css)
@step(u'I should( not)? be marked as an admin')
def self_marked_as_admin(_step, inverted):
return marked_as_admin(_step, "robot+studio", inverted)
@step(u'I can(not)? delete users')
@step(u's?he can(not)? delete users')
def can_delete_users(_step, inverted):
......@@ -130,3 +135,17 @@ def can_add_users(_step, inverted):
assert world.is_css_not_present(add_css)
else:
assert world.is_css_present(add_css)
@step(u'I can(not)? make ("([^"]*)"|myself) a course team admin')
@step(u's?he can(not)? make ("([^"]*)"|me) a course team admin')
def can_make_course_admin(_step, inverted, outer_capture, name):
if outer_capture == "myself":
email = world.scenario_dict["USER"].email
else:
email = name + EMAIL_EXTENSION
add_button_css = '.user-item[data-email="{email}"] .add-admin-role'.format(email=email)
if inverted:
assert world.is_css_not_present(add_button_css)
else:
assert world.is_css_present(add_button_css)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment