diff --git a/lms/djangoapps/courseware/features/lti.feature b/lms/djangoapps/courseware/features/lti.feature index c0eed13ff6..39d9b9bd6d 100644 --- a/lms/djangoapps/courseware/features/lti.feature +++ b/lms/djangoapps/courseware/features/lti.feature @@ -148,57 +148,3 @@ Feature: LMS.LTI component | description | | Application description | Then I see LTI component description with text "Application description" - - #15 - Scenario: LTI component requests permission for username and is rejected - Given the course has correct LTI credentials with registered Instructor - And the course has an LTI component with correct fields: - | ask_to_send_username | - | True | - Then I view the permission alert - Then I reject the permission alert and do not view the LTI - - #16 - Scenario: LTI component requests permission for username and displays LTI when accepted - Given the course has correct LTI credentials with registered Instructor - And the course has an LTI component with correct fields: - | ask_to_send_username | - | True | - Then I view the permission alert - Then I accept the permission alert and view the LTI - - #17 - Scenario: LTI component requests permission for email and is rejected - Given the course has correct LTI credentials with registered Instructor - And the course has an LTI component with correct fields: - | ask_to_send_email | - | True | - Then I view the permission alert - Then I reject the permission alert and do not view the LTI - - #18 - Scenario: LTI component requests permission for email and displays LTI when accepted - Given the course has correct LTI credentials with registered Instructor - And the course has an LTI component with correct fields: - | ask_to_send_email | - | True | - Then I view the permission alert - Then I accept the permission alert and view the LTI - - #19 - Scenario: LTI component requests permission for email and username and is rejected - Given the course has correct LTI credentials with registered Instructor - And the course has an LTI component with correct fields: - | ask_to_send_email | ask_to_send_username | - | True | True | - Then I view the permission alert - Then I reject the permission alert and do not view the LTI - - #20 - Scenario: LTI component requests permission for email and username and displays LTI when accepted - Given the course has correct LTI credentials with registered Instructor - And the course has an LTI component with correct fields: - | ask_to_send_email | ask_to_send_username | - | True | True | - Then I view the permission alert - Then I accept the permission alert and view the LTI diff --git a/lms/djangoapps/courseware/features/lti.py b/lms/djangoapps/courseware/features/lti.py index f4d496d83f..b761cf0c51 100644 --- a/lms/djangoapps/courseware/features/lti.py +++ b/lms/djangoapps/courseware/features/lti.py @@ -56,61 +56,6 @@ def lti_is_rendered_iframe(_step): check_lti_iframe_content("This is LTI tool. Success.") -@step('I view the permission alert$') -def view_lti_permission_alert(_step): - assert not world.is_css_present('iframe', wait_time=2) - assert world.is_css_present('.link_lti_new_window', wait_time=0) - assert not world.is_css_present('.error_message', wait_time=0) - world.css_find('.link_lti_new_window').first.click() - alert = world.browser.get_alert() - assert alert is not None - assert len(world.browser.windows) == 1 - - -def check_no_alert(): - """ - Make sure the alert has gone away. - - Note that the splinter documentation indicates that - get_alert should return None if no alert is present, - however that is not the case. Instead a - NoAlertPresentException is raised. - """ - try: - assert_is_none(world.browser.get_alert()) - except NoAlertPresentException: - pass - - -@step('I accept the permission alert and view the LTI$') -def accept_lti_permission_alert(_step): - parent_window = world.browser.current_window # Save the parent window - - # To start with you should only have one window/tab - assert len(world.browser.windows) == 1 - alert = world.browser.get_alert() - alert.accept() - check_no_alert() - - # Give it a few seconds for the LTI window to appear - world.wait_for( - lambda _: len(world.browser.windows) == 2, - timeout=5, - timeout_msg="Timed out waiting for the LTI window to appear." - ) - - # Verify the LTI window - check_lti_popup(parent_window) - - -@step('I reject the permission alert and do not view the LTI$') -def reject_lti_permission_alert(_step): - alert = world.browser.get_alert() - alert.dismiss() - check_no_alert() - assert len(world.browser.windows) == 1 - - @step('I view the LTI but incorrect_signature warning is rendered$') def incorrect_lti_is_rendered(_step): assert world.is_css_present('iframe', wait_time=2)