From c64d9aaabeb85a919c853217b02879540df058c8 Mon Sep 17 00:00:00 2001 From: Muddasser Date: Wed, 27 Jul 2016 06:34:09 +0000 Subject: [PATCH 1/4] automate help links --- common/test/acceptance/pages/studio/index.py | 3 +- .../test/acceptance/pages/studio/library.py | 4 +- common/test/acceptance/pages/studio/login.py | 3 +- common/test/acceptance/pages/studio/signup.py | 4 +- common/test/acceptance/pages/studio/users.py | 3 +- common/test/acceptance/pages/studio/utils.py | 56 +++ common/test/acceptance/tests/helpers.py | 93 ++++ .../tests/studio/test_studio_help.py | 454 ++++++++++++++++++ 8 files changed, 613 insertions(+), 7 deletions(-) diff --git a/common/test/acceptance/pages/studio/index.py b/common/test/acceptance/pages/studio/index.py index 210de24358..a7eac88493 100644 --- a/common/test/acceptance/pages/studio/index.py +++ b/common/test/acceptance/pages/studio/index.py @@ -7,6 +7,7 @@ from selenium.webdriver import ActionChains from common.test.acceptance.pages.studio import BASE_URL from common.test.acceptance.pages.studio.login import LoginPage from common.test.acceptance.pages.studio.signup import SignupPage +from common.test.acceptance.pages.studio.utils import HelpMixin class HeaderMixin(object): @@ -40,7 +41,7 @@ class IndexPage(PageObject, HeaderMixin): return self.q(css='.wrapper-text-welcome').visible -class DashboardPage(PageObject): +class DashboardPage(PageObject, HelpMixin): """ Studio Dashboard page with courses. The user must be logged in to access this page. diff --git a/common/test/acceptance/pages/studio/library.py b/common/test/acceptance/pages/studio/library.py index 1113fb7f5c..73562aba76 100644 --- a/common/test/acceptance/pages/studio/library.py +++ b/common/test/acceptance/pages/studio/library.py @@ -10,13 +10,13 @@ from common.test.acceptance.pages.studio.container import XBlockWrapper from common.test.acceptance.pages.studio.users import UsersPageMixin from common.test.acceptance.pages.studio.pagination import PaginatedMixin from selenium.webdriver.common.keys import Keys - +from common.test.acceptance.pages.studio.utils import HelpMixin from common.test.acceptance.pages.common.utils import confirm_prompt, wait_for_notification from common.test.acceptance.pages.studio import BASE_URL -class LibraryPage(PageObject): +class LibraryPage(PageObject, HelpMixin): """ Base page for Library pages. Defaults URL to the edit page. """ diff --git a/common/test/acceptance/pages/studio/login.py b/common/test/acceptance/pages/studio/login.py index 335f3c700b..8d99aee051 100644 --- a/common/test/acceptance/pages/studio/login.py +++ b/common/test/acceptance/pages/studio/login.py @@ -6,6 +6,7 @@ from bok_choy.promise import EmptyPromise from common.test.acceptance.pages.studio import BASE_URL from common.test.acceptance.pages.studio.course_page import CoursePage +from common.test.acceptance.pages.studio.utils import HelpMixin class LoginMixin(object): @@ -34,7 +35,7 @@ class LoginMixin(object): ).fulfill() -class LoginPage(PageObject, LoginMixin): +class LoginPage(PageObject, LoginMixin, HelpMixin): """ Login page for Studio. """ diff --git a/common/test/acceptance/pages/studio/signup.py b/common/test/acceptance/pages/studio/signup.py index 02748c79f6..d3bbac1b94 100644 --- a/common/test/acceptance/pages/studio/signup.py +++ b/common/test/acceptance/pages/studio/signup.py @@ -4,11 +4,11 @@ Signup page for studio from bok_choy.page_object import PageObject from common.test.acceptance.pages.studio import BASE_URL -from common.test.acceptance.pages.studio.utils import set_input_value +from common.test.acceptance.pages.studio.utils import set_input_value, HelpMixin from common.test.acceptance.pages.common.utils import click_css -class SignupPage(PageObject): +class SignupPage(PageObject, HelpMixin): """ Signup page for Studio. """ diff --git a/common/test/acceptance/pages/studio/users.py b/common/test/acceptance/pages/studio/users.py index 7102641145..0f1e5f4359 100644 --- a/common/test/acceptance/pages/studio/users.py +++ b/common/test/acceptance/pages/studio/users.py @@ -6,6 +6,7 @@ from bok_choy.page_object import PageObject from common.test.acceptance.tests.helpers import disable_animations from common.test.acceptance.pages.studio.course_page import CoursePage from common.test.acceptance.pages.studio import BASE_URL +from common.test.acceptance.pages.studio.utils import HelpMixin def wait_for_ajax_or_reload(browser): @@ -147,7 +148,7 @@ class UsersPageMixin(PageObject): disable_animations(self) -class LibraryUsersPage(UsersPageMixin): +class LibraryUsersPage(UsersPageMixin, HelpMixin): """ Library Team page in Studio """ diff --git a/common/test/acceptance/pages/studio/utils.py b/common/test/acceptance/pages/studio/utils.py index f58ef20935..b83b74daf2 100644 --- a/common/test/acceptance/pages/studio/utils.py +++ b/common/test/acceptance/pages/studio/utils.py @@ -9,6 +9,12 @@ from bok_choy.promise import EmptyPromise from common.test.acceptance.pages.common.utils import click_css, wait_for_notification +NAV_HELP_NOT_SIGNED_IN_CSS = '.nav-item.nav-not-signedin-help a' +NAV_HELP_CSS = '.nav-item.nav-account-help a' +SIDE_BAR_HELP_AS_LIST_ITEM = '.bit li.action-item a' +SIDE_BAR_HELP_CSS = '.bit.external-help a' + + @js_defined('window.jQuery') def press_the_notification_button(page, name): # Because the notification uses a CSS transition, @@ -148,6 +154,7 @@ def type_in_codemirror(page, index, text, find_prefix="$"): CodeMirror.signal(cm, "focus", cm); cm.setValue(arguments[0]); CodeMirror.signal(cm, "blur", cm);""".format(index=index, find_prefix=find_prefix) + page.browser.execute_script(script, str(text)) @@ -250,3 +257,52 @@ def click_studio_help(page): def studio_help_links(page): """Return the list of Studio help links in the page footer.""" return page.q(css='.support .list-actions a').results + + +class HelpMixin(object): + """ + Mixin for testing Help links. + """ + def get_nav_help_element_and_click_help(self, signed_in=True): + """ + Click on the help, and also get the DOM help element. + + It operates on the help elements in the navigation bar. + + Arguments: + signed_in (bool): Indicates whether user is signed in or not. + + Returns: + WebElement: Help DOM element in the navigation bar. + """ + + element_css = None + if signed_in: + element_css = NAV_HELP_CSS + else: + element_css = NAV_HELP_NOT_SIGNED_IN_CSS + + self.q(css=element_css).click() + return self.q(css=element_css).results[0] + + def get_side_bar_help_element_and_click_help(self, as_list_item=False): + """ + Click on the help, and also get the DOM help element. + + It operates on the help elements in the side bar. + + Arguments: + as_list_item (bool): Indicates whether help element is + enclosed in a 'li' DOM element. + + Returns: + WebElement: Help DOM element in the side bar. + """ + element_css = None + if as_list_item: + element_css = SIDE_BAR_HELP_AS_LIST_ITEM + else: + element_css = SIDE_BAR_HELP_CSS + + self.q(css=element_css).click() + return self.q(css=element_css).results[0] diff --git a/common/test/acceptance/tests/helpers.py b/common/test/acceptance/tests/helpers.py index 04c6787c35..f2e352ad67 100644 --- a/common/test/acceptance/tests/helpers.py +++ b/common/test/acceptance/tests/helpers.py @@ -379,6 +379,48 @@ def auto_auth(browser, username, email, staff, course_id): AutoAuthPage(browser, username=username, email=email, course_id=course_id, staff=staff).visit() +def get_url_with_changed_domain(url): + """ + Replaces .org with .io in the url + + Arguments: + url (str): The url to perform replace operation on. + + Returns: + str: The updated url + """ + return url.replace('.org/', '.io/') + + +def assert_link(test, expected_link, actual_link): + """ + Assert that 'href' and text inside help DOM element are correct. + + Arguments: + test: Test on which links are being tested. + expected_link (dict): The expected link attributes. + actual_link (dict): The actual link attribute on page. + """ + test.assertEqual(expected_link['href'], actual_link.get_attribute('href')) + test.assertEqual(expected_link['text'], actual_link.text) + + +def assert_opened_help_link_is_correct(test, url): + """ + Asserts that url of browser when help link is clicked is correct. + Arguments: + test (WebAppTest): test calling this method. + url (str): url to verify. + """ + test.browser.switch_to_window(test.browser.window_handles[-1]) + # Assert that url in the browser is the same. + # Please note that .org domain in href attribute of help anchor DOM element + # is changed into .io domain. This is because browser is redirected from .org + # domain to .io domain. + test.assertEqual(get_url_with_changed_domain(url), test.browser.current_url) + test.assertNotIn('Maze Found', test.browser.title) + + class EventsTestMixin(TestCase): """ Helpers and setup for running tests that evaluate events emitted @@ -772,6 +814,57 @@ def create_user_partition_json(partition_id, name, description, groups, scheme=" ).to_json() +def assert_nav_help_link(test, page, href, signed_in=True): + """ + Asserts that help link in navigation bar is correct. + + It first checks the url inside anchor DOM element and + then clicks to ensure that help opens correctly. + + Arguments: + test (WebAppTest): Test object + page (PageObject): Page object to perform tests on. + href (str): The help link which we expect to see when it is opened. + signed_in (bool): Specifies whether user is logged in or not. (It effects the css) + """ + expected_link = { + 'href': href, + 'text': 'Help' + } + # Get actual anchor help element from the page. + actual_link = page.get_nav_help_element_and_click_help(signed_in) + # Assert that 'href' and text are the same as expected. + assert_link(test, expected_link, actual_link) + # Assert that opened link is correct + assert_opened_help_link_is_correct(test, href) + + +def assert_side_bar_help_link(test, page, href, help_text, as_list_item=False): + """ + Asserts that help link in side bar is correct. + + It first checks the url inside anchor DOM element and + then clicks to ensure that help opens correctly. + + Arguments: + test (WebAppTest): Test object + page (PageObject): Page object to perform tests on. + href (str): The help link which we expect to see when it is opened. + as_list_item (bool): Specifies whether help element is in one of the + 'li' inside a sidebar list DOM element. + """ + expected_link = { + 'href': href, + 'text': help_text + } + # Get actual anchor help element from the page. + actual_link = page.get_side_bar_help_element_and_click_help(as_list_item) + # Assert that 'href' and text are the same as expected. + assert_link(test, expected_link, actual_link) + # Assert that opened link is correct + assert_opened_help_link_is_correct(test, href) + + class TestWithSearchIndexMixin(object): """ Mixin encapsulating search index creation """ TEST_INDEX_FILENAME = "test_root/index_file.dat" diff --git a/common/test/acceptance/tests/studio/test_studio_help.py b/common/test/acceptance/tests/studio/test_studio_help.py index 8cf7bb62da..8f3e79e163 100644 --- a/common/test/acceptance/tests/studio/test_studio_help.py +++ b/common/test/acceptance/tests/studio/test_studio_help.py @@ -3,10 +3,22 @@ Test the Studio help links. """ from flaky import flaky +from bok_choy.web_app_test import WebAppTest from common.test.acceptance.tests.studio.base_studio_test import StudioCourseTest from common.test.acceptance.pages.studio.index import DashboardPage from common.test.acceptance.pages.studio.utils import click_studio_help, studio_help_links +from common.test.acceptance.pages.studio.index import IndexPage, HomePage +from common.test.acceptance.tests.studio.base_studio_test import StudioLibraryTest +from common.test.acceptance.pages.studio.utils import click_css +from common.test.acceptance.pages.studio.library import LibraryPage +from common.test.acceptance.pages.studio.users import LibraryUsersPage +from common.test.acceptance.tests.helpers import ( + assert_nav_help_link, + assert_side_bar_help_link +) +from common.test.acceptance.pages.studio.import_export import ExportLibraryPage, ImportLibraryPage +from common.test.acceptance.pages.studio.auto_auth import AutoAuthPage class StudioHelpTest(StudioCourseTest): @@ -47,3 +59,445 @@ class StudioHelpTest(StudioCourseTest): expected['sr_text'], actual.find_element_by_xpath('following-sibling::span').text ) + + +class SignInHelpTest(WebAppTest): + """ + Tests help links on 'Sign In' page + """ + def setUp(self): + super(SignInHelpTest, self).setUp() + self.index_page = IndexPage(self.browser) + self.index_page.visit() + + def test_sign_in_nav_help(self): + """ + Scenario: Help link in navigation bar is working on 'Sign In' page. + Given that I am on the 'Sign In" page. + And I want help about the sign in + And I click the 'Help' in the navigation bar + Then Help link should open. + And help url should end with 'getting_started/get_started.html' + """ + sign_in_page = self.index_page.click_sign_in() + # The href we want to see in anchor help element. + href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/' \ + 'en/latest/getting_started/get_started.html' + + # Assert that help link is correct. + assert_nav_help_link( + test=self, + page=sign_in_page, + href=href, + signed_in=False + ) + + +class SignUpHelpTest(WebAppTest): + """ + Tests help links on 'Sign Up' page. + """ + def setUp(self): + super(SignUpHelpTest, self).setUp() + self.index_page = IndexPage(self.browser) + self.index_page.visit() + + def test_sign_up_nav_help(self): + """ + Scenario: Help link in navigation bar is working on 'Sign Up' page. + Given that I am on the 'Sign Up" page. + And I want help about the sign up + And I click the 'Help' in the navigation bar + Then Help link should open. + And help url should end with 'getting_started/get_started.html' + """ + sign_up_page = self.index_page.click_sign_up() + # The href we want to see in anchor help element. + href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/' \ + 'en/latest/getting_started/get_started.html' + + # Assert that help link is correct. + assert_nav_help_link( + test=self, + page=sign_up_page, + href=href, + signed_in=False + ) + + +class HomeHelpTest(StudioCourseTest): + """ + Tests help links on 'Home'(Courses tab) page. + """ + def setUp(self): # pylint: disable=arguments-differ + super(HomeHelpTest, self).setUp() + self.home_page = HomePage(self.browser) + self.home_page.visit() + + def test_course_home_nav_help(self): + """ + Scenario: Help link in navigation bar is working on 'Home'(Courses tab) page. + Given that I am on the 'Home'(Courses tab) page. + And I want help about the courses + And I click the 'Help' in the navigation bar + Then Help link should open. + And help url should end with 'getting_started/get_started.html' + """ + # The href we want to see in anchor help element. + href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/' \ + 'en/latest/getting_started/get_started.html' + + # Assert that help link is correct. + assert_nav_help_link( + test=self, + page=self.home_page, + href=href + ) + + def test_course_home_side_bar_help(self): + """ + Scenario: Help link in sidebar links is working on 'Home'(Courses tab) page. + Given that I am on the 'Home'(Courses tab) page. + And I want help about the courses + And I click the 'Getting Started with edX Studio' in the sidebar links + Then Help link should open. + And help url should end with 'getting_started/get_started.html' + """ + # The href we want to see in anchor help element. + href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/' \ + 'en/latest/getting_started/get_started.html' + + # Assert that help link is correct. + assert_side_bar_help_link( + test=self, + page=self.home_page, + href=href, + help_text='Getting Started with edX Studio', + as_list_item=True + ) + + +class NewCourseHelpTest(WebAppTest): + """ + Test help links while creating a new course. + """ + def setUp(self): + super(NewCourseHelpTest, self).setUp() + self.auth_page = AutoAuthPage(self.browser, staff=True) + self.dashboard_page = DashboardPage(self.browser) + self.auth_page.visit() + self.dashboard_page.visit() + self.assertTrue(self.dashboard_page.new_course_button.present) + self.dashboard_page.click_new_course_button() + + def test_course_create_nav_help(self): + """ + Scenario: Help link in navigation bar is working on 'Create a New Course' page in the dashboard. + Given that I am on the 'Create a New Course' page in the dashboard. + And I want help about the process + And I click the 'Help' in the navigation bar + Then Help link should open. + And help url should end with 'getting_started/get_started.html' + """ + # The href we want to see in anchor help element. + href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff' \ + '/en/latest/getting_started/get_started.html' + + # Assert that help link is correct. + assert_nav_help_link( + test=self, + page=self.dashboard_page, + href=href + ) + + def test_course_create_side_bar_help(self): + """ + Scenario: Help link in sidebar links is working on 'Create a New Course' page in the dashboard. + Given that I am on the 'Create a New Course' page in the dashboard. + And I want help about the process + And I click the 'Getting Started with edX Studio' in the sidebar links + Then Help link should open. + And help url should end with 'getting_started/get_started.html' + """ + # The href we want to see in anchor help element. + href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/' \ + 'en/latest/getting_started/get_started.html' + + # Assert that help link is correct. + assert_side_bar_help_link( + test=self, + page=self.dashboard_page, + href=href, + help_text='Getting Started with edX Studio', + as_list_item=True + ) + + +class NewLibraryHelpTest(WebAppTest): + """ + Test help links while creating a new library + """ + def setUp(self): + super(NewLibraryHelpTest, self).setUp() + self.auth_page = AutoAuthPage(self.browser, staff=True) + self.dashboard_page = DashboardPage(self.browser) + self.auth_page.visit() + self.dashboard_page.visit() + self.assertTrue(self.dashboard_page.has_new_library_button) + self.dashboard_page.click_new_library() + + def test_library_create_nav_help(self): + """ + Scenario: Help link in navigation bar is working on 'Create a New Library' page in the dashboard. + Given that I am on the 'Create a New Library' page in the dashboard. + And I want help about the process + And I click the 'Help' in the navigation bar + Then Help link should open. + And help url should end with 'getting_started/get_started.html' + """ + # The href we want to see in anchor help element. + href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/' \ + 'en/latest/getting_started/get_started.html' + + # Assert that help link is correct. + assert_nav_help_link( + test=self, + page=self.dashboard_page, + href=href + ) + + def test_library_create_side_bar_help(self): + """ + Scenario: Help link in sidebar links is working on 'Create a New Library' page in the dashboard. + Given that I am on the 'Create a New Library' page in the dashboard. + And I want help about the process + And I click the 'Getting Started with edX Studio' in the sidebar links + Then Help link should open. + And help url should end with 'getting_started/get_started.html' + """ + # The href we want to see in anchor help element. + href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/' \ + 'en/latest/getting_started/get_started.html' + + # Assert that help link is correct. + assert_side_bar_help_link( + test=self, + page=self.dashboard_page, + href=href, + help_text='Getting Started with edX Studio', + as_list_item=True + ) + + +class LibraryTabHelpTest(WebAppTest): + """ + Test help links on the library tab present at dashboard. + """ + def setUp(self): + super(LibraryTabHelpTest, self).setUp() + self.auth_page = AutoAuthPage(self.browser, staff=True) + self.dashboard_page = DashboardPage(self.browser) + self.auth_page.visit() + self.dashboard_page.visit() + + def test_library_tab_nav_help(self): + """ + Scenario: Help link in navigation bar is working on 'Home'(Courses tab) page. + Given that I am on the 'Home'(Courses tab) page. + And I want help about the process + And I click the 'Help' in the navigation bar + Then Help link should open. + And help url should end with 'getting_started/get_started.html' + """ + self.assertTrue(self.dashboard_page.has_new_library_button) + click_css(self.dashboard_page, '#course-index-tabs .libraries-tab', 0, False) + # The href we want to see in anchor help element. + href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/' \ + 'en/latest/getting_started/get_started.html' + + # Assert that help link is correct. + assert_nav_help_link( + test=self, + page=self.dashboard_page, + href=href + ) + + +class LibraryHelpTest(StudioLibraryTest): + """ + Test help links on a Library page. + """ + def setUp(self): + super(LibraryHelpTest, self).setUp() + self.library_page = LibraryPage(self.browser, self.library_key) + self.library_user_page = LibraryUsersPage(self.browser, self.library_key) + + def test_library_content_nav_help(self): + """ + Scenario: Help link in navigation bar is working on content + library page(click a library on the Library list page). + Given that I am on the content library page(click a library on the Library list page). + And I want help about the process + And I click the 'Help' in the navigation bar + Then Help link should open. + And help url should end with 'course/components/libraries.html' + """ + self.library_page.visit() + # The href we want to see in anchor help element. + href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/' \ + 'en/latest/course_components/libraries.html' + + # Assert that help link is correct. + assert_nav_help_link( + test=self, + page=self.library_page, + href=href + ) + + def test_library_content_side_bar_help(self): + """ + Scenario: Help link in sidebar links is working on + content library page(click a library on the Library list page). + Given that I am on the content library page(click a library on the Library list page). + And I want help about the process + And I click the 'Learn more about content libraries' in the sidebar links + Then Help link should open. + And help url should end with 'course/components/libraries.html' + """ + self.library_page.visit() + # The href we want to see in anchor help element. + href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/' \ + 'en/latest/course_components/libraries.html' + + # Assert that help link is correct. + assert_side_bar_help_link( + test=self, + page=self.library_page, + href=href, + help_text='Learn more about content libraries' + ) + + def test_library_user_access_setting_nav_help(self): + """ + Scenario: Help link in navigation bar is working on 'User Access' + settings page of library. + Given that I am on the 'User Access' settings page of library. + And I want help about the process + And I click the 'Help' in the navigation bar + Then Help link should open. + And help url should end with + 'creating_content/libraries.html#give-other-users-access-to-your-library' + """ + self.library_user_page.visit() + # The href we want to see in anchor help element. + href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/en/' \ + 'latest/course_components/libraries.html#give-other-users-access-to-your-library' + + # Assert that help link is correct. + assert_nav_help_link( + test=self, + page=self.library_user_page, + href=href + ) + + +class LibraryImportHelpTest(StudioLibraryTest): + """ + Test help links on a Library import and export pages. + """ + def setUp(self): + super(LibraryImportHelpTest, self).setUp() + self.library_import_page = ImportLibraryPage(self.browser, self.library_key) + self.library_import_page.visit() + + def test_library_import_nav_help(self): + """ + Scenario: Help link in navigation bar is working on Library import page. + Given that I am on the Library import page. + And I want help about the process + And I click the 'Help' in the navigation bar + Then Help link should open. + And help url should end with 'creating_content/libraries.html#import-a-library' + """ + # The href we want to see in anchor help element. + href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/en/' \ + 'latest/course_components/libraries.html#import-a-library' + + # Assert that help link is correct. + assert_nav_help_link( + test=self, + page=self.library_import_page, + href=href + ) + + def test_library_import_side_bar_help(self): + """ + Scenario: Help link in sidebar links is working on Library import page. + Given that I am on the Library import page. + And I want help about the process + And I click the 'Learn more about importing a library' in the sidebar links + Then Help link should open. + And help url should end with 'creating_content/libraries.html#import-a-library' + """ + # The href we want to see in anchor help element. + href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/en/' \ + 'latest/course_components/libraries.html#import-a-library' + + # Assert that help link is correct. + assert_side_bar_help_link( + test=self, + page=self.library_import_page, + href=href, + help_text='Learn more about importing a library' + ) + + +class LibraryExportHelpTest(StudioLibraryTest): + """ + Test help links on a Library export pages. + """ + def setUp(self): + super(LibraryExportHelpTest, self).setUp() + self.library_export_page = ExportLibraryPage(self.browser, self.library_key) + self.library_export_page.visit() + + def test_library_export_nav_help(self): + """ + Scenario: Help link in navigation bar is working on Library export page. + Given that I am on the Library export page. + And I want help about the process + And I click the 'Help' in the navigation bar + Then Help link should open. + And help url should end with 'creating_content/libraries.html#export-a-library' + """ + # The href we want to see in anchor help element. + href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/en/' \ + 'latest/course_components/libraries.html#export-a-library' + + # Assert that help link is correct. + assert_nav_help_link( + test=self, + page=self.library_export_page, + href=href + ) + + def test_library_export_side_bar_help(self): + """ + Scenario: Help link in sidebar links is working on Library export page. + Given that I am on the Library export page. + And I want help about the process + And I click the 'Learn more about exporting a library' in the sidebar links + Then Help link should open. + And help url should end with 'creating_content/libraries.html#export-a-library' + """ + # The href we want to see in anchor help element. + href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/en/' \ + 'latest/course_components/libraries.html#export-a-library' + + # Assert that help link is correct. + assert_side_bar_help_link( + test=self, + page=self.library_export_page, + href=href, + help_text='Learn more about exporting a library' + ) From 3683ee7f320df49daae7f6556f57a5fbf5043c5a Mon Sep 17 00:00:00 2001 From: Muddasser Date: Thu, 8 Sep 2016 13:34:46 +0000 Subject: [PATCH 2/4] Help Links second pass --- .../test/acceptance/pages/studio/container.py | 3 +- .../acceptance/pages/studio/course_page.py | 14 +- common/test/acceptance/pages/studio/index.py | 10 +- common/test/acceptance/pages/studio/users.py | 20 +- common/test/acceptance/pages/studio/utils.py | 12 +- common/test/acceptance/tests/helpers.py | 6 +- .../tests/studio/test_studio_help.py | 769 +++++++++++++++++- 7 files changed, 819 insertions(+), 15 deletions(-) diff --git a/common/test/acceptance/pages/studio/container.py b/common/test/acceptance/pages/studio/container.py index 7c524a650a..403e823135 100644 --- a/common/test/acceptance/pages/studio/container.py +++ b/common/test/acceptance/pages/studio/container.py @@ -5,13 +5,14 @@ Container page in Studio from bok_choy.page_object import PageObject from bok_choy.promise import Promise, EmptyPromise from common.test.acceptance.pages.studio import BASE_URL +from common.test.acceptance.pages.studio.utils import HelpMixin from common.test.acceptance.pages.common.utils import click_css, confirm_prompt from common.test.acceptance.pages.studio.utils import type_in_codemirror -class ContainerPage(PageObject): +class ContainerPage(PageObject, HelpMixin): """ Container page in Studio """ diff --git a/common/test/acceptance/pages/studio/course_page.py b/common/test/acceptance/pages/studio/course_page.py index 9d42054c29..a03c0355c4 100644 --- a/common/test/acceptance/pages/studio/course_page.py +++ b/common/test/acceptance/pages/studio/course_page.py @@ -1,14 +1,15 @@ """ Base class for pages specific to a course in Studio. """ - +from abc import abstractmethod import os from opaque_keys.edx.locator import CourseLocator from bok_choy.page_object import PageObject from common.test.acceptance.pages.studio import BASE_URL +from common.test.acceptance.pages.studio.utils import HelpMixin -class CoursePage(PageObject): +class CoursePage(PageObject, HelpMixin): """ Abstract base class for page objects specific to a course in Studio. """ @@ -17,6 +18,15 @@ class CoursePage(PageObject): # Does not need to include the leading forward or trailing slash url_path = "" + @abstractmethod + def is_browser_on_page(self): + """ + Verifies browser is on the correct page. + + Should be implemented in child classes. + """ + pass + def __init__(self, browser, course_org, course_num, course_run): """ Initialize the page object for the course located at diff --git a/common/test/acceptance/pages/studio/index.py b/common/test/acceptance/pages/studio/index.py index a7eac88493..bb378971ef 100644 --- a/common/test/acceptance/pages/studio/index.py +++ b/common/test/acceptance/pages/studio/index.py @@ -31,7 +31,7 @@ class HeaderMixin(object): return next_page.wait_for_page() -class IndexPage(PageObject, HeaderMixin): +class IndexPage(PageObject, HeaderMixin, HelpMixin): """ Home page for Studio when not logged in. """ @@ -322,3 +322,11 @@ class DashboardPageWithPrograms(DashboardPage): element.find_element_by_css_selector('.course-org .value').text, # org key ) return self.q(css='div.programs-tab li.course-item').map(div2info).results + + def click_new_program_button(self): + """ + Click on the new program button. + """ + self.q(css='.button.new-button.new-program-button').click() + self.wait_for_ajax() + self.wait_for_element_visibility(".account-username", "New program page is open") diff --git a/common/test/acceptance/pages/studio/users.py b/common/test/acceptance/pages/studio/users.py index 0f1e5f4359..29c237b282 100644 --- a/common/test/acceptance/pages/studio/users.py +++ b/common/test/acceptance/pages/studio/users.py @@ -1,6 +1,8 @@ """ Page classes to test either the Course Team page or the Library Team page. """ +import os +from opaque_keys.edx.locator import CourseLocator from bok_choy.promise import EmptyPromise from bok_choy.page_object import PageObject from common.test.acceptance.tests.helpers import disable_animations @@ -164,13 +166,27 @@ class LibraryUsersPage(UsersPageMixin, HelpMixin): return "{}/library/{}/team/".format(BASE_URL, unicode(self.locator)) -class CourseTeamPage(CoursePage, UsersPageMixin): +class CourseTeamPage(UsersPageMixin, CoursePage): """ Course Team page in Studio. """ - url_path = "course_team" + @property + def url(self): + """ + Construct a URL to the page within the course. + """ + # TODO - is there a better way to make this agnostic to the underlying default module store? + default_store = os.environ.get('DEFAULT_STORE', 'draft') + course_key = CourseLocator( + self.course_info['course_org'], + self.course_info['course_num'], + self.course_info['course_run'], + deprecated=(default_store == 'draft') + ) + return "/".join([BASE_URL, self.url_path, unicode(course_key)]) + class UserWrapper(PageObject): """ diff --git a/common/test/acceptance/pages/studio/utils.py b/common/test/acceptance/pages/studio/utils.py index b83b74daf2..e3d27753b7 100644 --- a/common/test/acceptance/pages/studio/utils.py +++ b/common/test/acceptance/pages/studio/utils.py @@ -12,7 +12,7 @@ from common.test.acceptance.pages.common.utils import click_css, wait_for_notifi NAV_HELP_NOT_SIGNED_IN_CSS = '.nav-item.nav-not-signedin-help a' NAV_HELP_CSS = '.nav-item.nav-account-help a' SIDE_BAR_HELP_AS_LIST_ITEM = '.bit li.action-item a' -SIDE_BAR_HELP_CSS = '.bit.external-help a' +SIDE_BAR_HELP_CSS = '.external-help a, .external-help-button' @js_defined('window.jQuery') @@ -282,10 +282,10 @@ class HelpMixin(object): else: element_css = NAV_HELP_NOT_SIGNED_IN_CSS - self.q(css=element_css).click() + self.q(css=element_css).first.click() return self.q(css=element_css).results[0] - def get_side_bar_help_element_and_click_help(self, as_list_item=False): + def get_side_bar_help_element_and_click_help(self, as_list_item=False, index=-1): """ Click on the help, and also get the DOM help element. @@ -294,6 +294,8 @@ class HelpMixin(object): Arguments: as_list_item (bool): Indicates whether help element is enclosed in a 'li' DOM element. + index (int): The index of element in case there are more than + one matching elements. Returns: WebElement: Help DOM element in the side bar. @@ -304,5 +306,5 @@ class HelpMixin(object): else: element_css = SIDE_BAR_HELP_CSS - self.q(css=element_css).click() - return self.q(css=element_css).results[0] + self.q(css=element_css).results[index].click() + return self.q(css=element_css).results[index] diff --git a/common/test/acceptance/tests/helpers.py b/common/test/acceptance/tests/helpers.py index f2e352ad67..a71ed7178c 100644 --- a/common/test/acceptance/tests/helpers.py +++ b/common/test/acceptance/tests/helpers.py @@ -839,7 +839,7 @@ def assert_nav_help_link(test, page, href, signed_in=True): assert_opened_help_link_is_correct(test, href) -def assert_side_bar_help_link(test, page, href, help_text, as_list_item=False): +def assert_side_bar_help_link(test, page, href, help_text, as_list_item=False, index=-1): """ Asserts that help link in side bar is correct. @@ -852,13 +852,15 @@ def assert_side_bar_help_link(test, page, href, help_text, as_list_item=False): href (str): The help link which we expect to see when it is opened. as_list_item (bool): Specifies whether help element is in one of the 'li' inside a sidebar list DOM element. + index (int): The index of element in case there are more than + one matching elements. """ expected_link = { 'href': href, 'text': help_text } # Get actual anchor help element from the page. - actual_link = page.get_side_bar_help_element_and_click_help(as_list_item) + actual_link = page.get_side_bar_help_element_and_click_help(as_list_item=as_list_item, index=index) # Assert that 'href' and text are the same as expected. assert_link(test, expected_link, actual_link) # Assert that opened link is correct diff --git a/common/test/acceptance/tests/studio/test_studio_help.py b/common/test/acceptance/tests/studio/test_studio_help.py index 8f3e79e163..c8a2236743 100644 --- a/common/test/acceptance/tests/studio/test_studio_help.py +++ b/common/test/acceptance/tests/studio/test_studio_help.py @@ -5,14 +5,28 @@ Test the Studio help links. from flaky import flaky from bok_choy.web_app_test import WebAppTest -from common.test.acceptance.tests.studio.base_studio_test import StudioCourseTest -from common.test.acceptance.pages.studio.index import DashboardPage +from common.test.acceptance.fixtures.course import XBlockFixtureDesc +from common.test.acceptance.tests.studio.base_studio_test import StudioCourseTest, ContainerBase +from common.test.acceptance.pages.studio.index import DashboardPage, DashboardPageWithPrograms from common.test.acceptance.pages.studio.utils import click_studio_help, studio_help_links from common.test.acceptance.pages.studio.index import IndexPage, HomePage from common.test.acceptance.tests.studio.base_studio_test import StudioLibraryTest +from common.test.acceptance.pages.studio.course_info import CourseUpdatesPage from common.test.acceptance.pages.studio.utils import click_css from common.test.acceptance.pages.studio.library import LibraryPage from common.test.acceptance.pages.studio.users import LibraryUsersPage +from common.test.acceptance.pages.studio.overview import CourseOutlinePage +from common.test.acceptance.pages.studio.asset_index import AssetIndexPage +from common.test.acceptance.pages.studio.edit_tabs import PagesPage +from common.test.acceptance.pages.studio.textbook_upload import TextbookUploadPage +from common.test.acceptance.pages.studio.settings import SettingsPage +from common.test.acceptance.pages.studio.settings_graders import GradingPage +from common.test.acceptance.pages.studio.settings_group_configurations import GroupConfigurationsPage +from common.test.acceptance.pages.studio.settings_advanced import AdvancedSettingsPage +from common.test.acceptance.pages.studio.settings_certificates import CertificatesPage +from common.test.acceptance.pages.studio.import_export import ExportCoursePage, ImportCoursePage +from common.test.acceptance.pages.studio.users import CourseTeamPage +from common.test.acceptance.fixtures.programs import ProgramsConfigMixin from common.test.acceptance.tests.helpers import ( assert_nav_help_link, assert_side_bar_help_link @@ -501,3 +515,754 @@ class LibraryExportHelpTest(StudioLibraryTest): href=href, help_text='Learn more about exporting a library' ) + + +class NewProgramHelpTest(ProgramsConfigMixin, WebAppTest): + """ + Test help links on a 'New Program' page + """ + def setUp(self): + super(NewProgramHelpTest, self).setUp() + self.auth_page = AutoAuthPage(self.browser, staff=True) + self.program_page = DashboardPageWithPrograms(self.browser) + self.auth_page.visit() + self.set_programs_api_configuration(True) + self.program_page.visit() + + def test_program_create_nav_help(self): + """ + Scenario: Help link in navigation bar is working on 'New Program' page + Given that I am on the 'New Program' page + And I want help about the process + And I click the 'Help' in the navigation bar + Then Help link should open. + And help url should end with 'index.html' + """ + self.program_page.click_new_program_button() + href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff' \ + '/en/latest/index.html' + + # Assert that help link is correct. + assert_nav_help_link( + test=self, + page=self.program_page, + href=href, + ) + + +class CourseOutlineHelpTest(StudioCourseTest): + """ + Tests help links on course outline page. + """ + def setUp(self): # pylint: disable=arguments-differ + super(CourseOutlineHelpTest, self).setUp() + self.course_outline_page = CourseOutlinePage( + self.browser, + self.course_info['org'], + self.course_info['number'], + self.course_info['run'] + ) + self.course_outline_page.visit() + + # This scenario depends upon TNL-5460 + # def test_course_outline_nav_help(self): + # """ + # Scenario: Help link in navigation bar is working on Course Outline page + # Given that I am on the Course Outline page + # And I want help about the process + # And I click the 'Help' in the navigation bar + # Then Help link should open. + # And help url should end with 'developing_course/course_outline.html' + # """ + # href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff' \ + # '/en/latest/developing_course/course_outline.html' + # + # # Assert that help link is correct. + # assert_nav_help_link( + # test=self, + # page=self.course_outline_page, + # href=href + # ) + + def test_course_outline_side_bar_help(self): + """ + Scenario: Help link in sidebar links is working on Course Outline page + Given that I am on the Course Outline page. + And I want help about the process + And I click the 'Learn more about the course outline' in the sidebar links + Then Help link should open. + And help url should end with 'developing_course/course_outline.html' + """ + href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff' \ + '/en/latest/developing_course/course_outline.html' + + # Assert that help link is correct. + assert_side_bar_help_link( + test=self, + page=self.course_outline_page, + href=href, + help_text='Learn more about the course outline', + index=0 + ) + + +class CourseUpdateHelpTest(StudioCourseTest): + """ + Test help links on Course Update page + """ + def setUp(self): # pylint: disable=arguments-differ + super(CourseUpdateHelpTest, self).setUp() + self.course_update_page = CourseUpdatesPage( + self.browser, + self.course_info['org'], + self.course_info['number'], + self.course_info['run'] + ) + self.course_update_page.visit() + + def test_course_update_nav_help(self): + """ + Scenario: Help link in navigation bar is working on 'Course Update' page + Given that I am on the 'Course Update' page + And I want help about the process + And I click the 'Help' in the navigation bar + Then Help link should open. + And help url should end with 'course_assets/handouts_updates.html' + """ + href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/' \ + 'en/latest/course_assets/handouts_updates.html' + + # Assert that help link is correct. + assert_nav_help_link( + test=self, + page=self.course_update_page, + href=href + ) + + +class AssetIndexHelpTest(StudioCourseTest): + """ + Test help links on Course 'Files & Uploads' page + """ + def setUp(self): # pylint: disable=arguments-differ + super(AssetIndexHelpTest, self).setUp() + self.course_asset_index_page = AssetIndexPage( + self.browser, + self.course_info['org'], + self.course_info['number'], + self.course_info['run'] + ) + self.course_asset_index_page.visit() + + def test_asset_index_nav_help(self): + """ + Scenario: Help link in navigation bar is working on 'Files & Uploads' page + Given that I am on the 'Files & Uploads' page + And I want help about the process + And I click the 'Help' in the navigation bar + Then Help link should open. + And help url should end with 'course_assets/course_files.html' + """ + href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/' \ + 'en/latest/course_assets/course_files.html' + + # Assert that help link is correct. + assert_nav_help_link( + test=self, + page=self.course_asset_index_page, + href=href + ) + + def test_asset_index_side_bar_help(self): + """ + Scenario: Help link in sidebar links is working on 'Files & Uploads' page + Given that I am on the 'Files & Uploads' page. + And I want help about the process + And I click the 'Learn more about managing files' in the sidebar links + Then Help link should open. + And help url should end with 'course_assets/course_files.html' + """ + href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/' \ + 'en/latest/course_assets/course_files.html' + + # Assert that help link is correct. + assert_side_bar_help_link( + test=self, + page=self.course_asset_index_page, + href=href, + help_text='Learn more about managing files' + ) + + +class CoursePagesHelpTest(StudioCourseTest): + """ + Test help links on Course 'Pages' page + """ + def setUp(self): # pylint: disable=arguments-differ + super(CoursePagesHelpTest, self).setUp() + self.course_pages_page = PagesPage( + self.browser, + self.course_info['org'], + self.course_info['number'], + self.course_info['run'] + ) + self.course_pages_page.visit() + + def test_course_page_nav_help(self): + """ + Scenario: Help link in navigation bar is working on 'Pages' page + Given that I am on the 'Pages' page + And I want help about the process + And I click the 'Help' in the navigation bar + Then Help link should open. + And help url should end with 'course_assets/pages.html' + """ + href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/' \ + 'en/latest/course_assets/pages.html' + + # Assert that help link is correct. + assert_nav_help_link( + test=self, + page=self.course_pages_page, + href=href + ) + + +class UploadTextbookHelpTest(StudioCourseTest): + """ + Test help links on Course 'Textbooks' page + """ + def setUp(self): # pylint: disable=arguments-differ + super(UploadTextbookHelpTest, self).setUp() + self.course_textbook_upload_page = TextbookUploadPage( + self.browser, + self.course_info['org'], + self.course_info['number'], + self.course_info['run'] + ) + self.course_textbook_upload_page.visit() + + def test_course_textbook_upload_nav_help(self): + """ + Scenario: Help link in navigation bar is working on 'Textbooks' page + Given that I am on the 'Textbooks' page + And I want help about the process + And I click the 'Help' in the navigation bar + Then Help link should open. + And help url should end with 'course_assets/textbooks.html' + """ + href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff' \ + '/en/latest/course_assets/textbooks.html' + + # Assert that help link is correct. + assert_nav_help_link( + test=self, + page=self.course_textbook_upload_page, + href=href + ) + + def test_course_textbook_side_bar_help(self): + """ + Scenario: Help link in sidebar links is working on 'Textbooks' page + Given that I am on the 'Textbooks' page + And I want help about the process + And I click the 'Learn more about textbooks' in the sidebar links + Then Help link should open. + And help url should end with 'course_assets/textbooks.html' + """ + href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff' \ + '/en/latest/course_assets/textbooks.html' + + # Assert that help link is correct. + assert_side_bar_help_link( + test=self, + page=self.course_textbook_upload_page, + href=href, + help_text='Learn more about textbooks' + ) + + +class StudioUnitHelpTest(ContainerBase): + """ + Tests help links on Unit page. + """ + def setUp(self, is_staff=True): + super(StudioUnitHelpTest, self).setUp(is_staff=is_staff) + + def populate_course_fixture(self, course_fixture): + course_fixture.add_advanced_settings( + {u"advanced_modules": {"value": ["split_test"]}} + ) + + course_fixture.add_children( + XBlockFixtureDesc('chapter', 'Test Section').add_children( + XBlockFixtureDesc('sequential', 'Test Subsection').add_children( + XBlockFixtureDesc('vertical', 'Test Unit') + ) + ) + ) + + def test_unit_page_nav_help(self): + """ + Scenario: Help link in navigation bar is working on Unit page. + Given that I am on the Unit page. + And I want help about the process + And I click the 'Help' in the navigation bar + Then Help link should open. + And help url should end with 'developing_course/course_units.html' + """ + unit_page = self.go_to_unit_page() + href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff' \ + '/en/latest/developing_course/course_units.html' + + # Assert that help link is correct. + assert_nav_help_link( + test=self, + page=unit_page, + href=href + ) + + +class SettingsHelpTest(StudioCourseTest): + """ + Tests help links on Schedule and Details Settings page + """ + def setUp(self, is_staff=False, test_xss=True): + super(SettingsHelpTest, self).setUp() + + self.settings_page = SettingsPage( + self.browser, + self.course_info['org'], + self.course_info['number'], + self.course_info['run'] + ) + + self.settings_page.visit() + + def test_settings_page_nav_help(self): + """ + Scenario: Help link in navigation bar is working on Settings page. + Given that I am on the Settings page. + And I want help about the process + And I click the 'Help' in the navigation bar + Then Help link should open. + And help url should end with 'set_up_course/setting_up_student_view.html' + """ + href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff' \ + '/en/latest/set_up_course/setting_up_student_view.html' + + # Assert that help link is correct. + assert_nav_help_link( + test=self, + page=self.settings_page, + href=href + ) + + +class GradingPageHelpTest(StudioCourseTest): + """ + Tests help links on Grading page + """ + def setUp(self, is_staff=False, test_xss=True): + super(GradingPageHelpTest, self).setUp() + + self.grading_page = GradingPage( + self.browser, + self.course_info['org'], + self.course_info['number'], + self.course_info['run'] + ) + + self.grading_page.visit() + + def test_grading_page_nav_help(self): + """ + Scenario: Help link in navigation bar is working on Grading page. + Given that I am on the Grading page + And I want help about the process + And I click the 'Help' in the navigation bar + Then Help link should open. + And help url should end with 'grading/index.html' + """ + href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/' \ + 'en/latest/grading/index.html' + + # Assert that help link is correct. + assert_nav_help_link( + test=self, + page=self.grading_page, + href=href + ) + + +class CourseTeamSettingsHelpTest(StudioCourseTest): + """ + Tests help links on Course Team settings page + """ + def setUp(self, is_staff=False, test_xss=True): + super(CourseTeamSettingsHelpTest, self).setUp() + + self.course_team_settings_page = CourseTeamPage( + self.browser, + self.course_info['org'], + self.course_info['number'], + self.course_info['run'] + ) + + self.course_team_settings_page.visit() + + def test_course_course_team_nav_help(self): + """ + Scenario: Help link in navigation bar is working on Course Team settings page + Given that I am on the Course Team settings page + And I want help about the process + And I click the 'Help' in the navigation bar + Then Help link should open. + And help url should end with 'set_up_course/course_staffing.html#add-course-team-members' + """ + href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/' \ + 'en/latest/set_up_course/course_staffing.html#add-course-team-members' + + # Assert that help link is correct. + assert_nav_help_link( + test=self, + page=self.course_team_settings_page, + href=href + ) + + +class CourseGroupConfigurationHelpTest(StudioCourseTest): + """ + Tests help links on course Group Configurations settings page + """ + def setUp(self, is_staff=False, test_xss=True): + super(CourseGroupConfigurationHelpTest, self).setUp() + + self.course_group_configuration_page = GroupConfigurationsPage( + self.browser, + self.course_info['org'], + self.course_info['number'], + self.course_info['run'] + ) + + self.course_group_configuration_page.visit() + + def test_course_group_conf_nav_help(self): + """ + Scenario: Help link in navigation bar is working on + Group Configurations settings page + Given that I am on the Group Configurations settings page + And I want help about the process + And I click the 'Help' in the navigation bar + Then Help link should open. + And help url should end with 'index.html' + """ + href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/' \ + 'en/latest/index.html' + + # Assert that help link is correct. + assert_nav_help_link( + test=self, + page=self.course_group_configuration_page, + href=href + ) + + def test_course_group_conf_content_group_side_bar_help(self): + """ + Scenario: Help link in side bar under the 'content group' is working + on Group Configurations settings page + Given that I am on the Group Configurations settings page + And I want help about the process + And I click the 'Learn More' in the sidebar links + Then Help link should open. + And help url should end with 'course_features/cohorts/cohorted_courseware.html' + """ + href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/' \ + 'en/latest/course_features/cohorts/cohorted_courseware.html' + + # Assert that help link is correct. + assert_side_bar_help_link( + test=self, + page=self.course_group_configuration_page, + href=href, + help_text='Learn More' + ) + + +class AdvancedSettingHelpTest(StudioCourseTest): + """ + Tests help links on course Advanced Settings page. + """ + def setUp(self, is_staff=False, test_xss=True): + super(AdvancedSettingHelpTest, self).setUp() + + self.advanced_settings = AdvancedSettingsPage( + self.browser, + self.course_info['org'], + self.course_info['number'], + self.course_info['run'] + ) + + self.advanced_settings.visit() + + def test_advanced_settings_nav_help(self): + """ + Scenario: Help link in navigation bar is working on Advanced Settings page. + Given that I am on the Advanced Settings page. + And I want help about the process + And I click the 'Help' in the navigation bar + Then Help link should open. + And help url should end with 'index.html' + """ + href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff' \ + '/en/latest/index.html' + + # Assert that help link is correct. + assert_nav_help_link( + test=self, + page=self.advanced_settings, + href=href + ) + + +class CertificatePageHelpTest(StudioCourseTest): + """ + Tests help links on course Certificate settings page. + """ + def setUp(self, is_staff=False, test_xss=True): + super(CertificatePageHelpTest, self).setUp() + + self.certificates_page = CertificatesPage( + self.browser, + self.course_info['org'], + self.course_info['number'], + self.course_info['run'] + ) + + self.certificates_page.visit() + + def test_certificate_page_nav_help(self): + """ + Scenario: Help link in navigation bar is working on Certificate settings page + Given that I am on the Certificate settings page + And I want help about the process + And I click the 'Help' in the navigation bar + Then Help link should open. + And help url should end with 'set_up_course/creating_course_certificates.html' + """ + href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff' \ + '/en/latest/set_up_course/creating_course_certificates.html' + + # Assert that help link is correct. + assert_nav_help_link( + test=self, + page=self.certificates_page, + href=href + ) + + def test_certificate_page_side_bar_help(self): + """ + Scenario: Help link in side bar is working Certificate settings page + Given that I am on the Certificate settings page + And I want help about the process + And I click the 'Learn more about certificates' in the sidebar links + Then Help link should open. + And help url should end with 'set_up_course/creating_course_certificates.html' + """ + href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff' \ + '/en/latest/set_up_course/creating_course_certificates.html' + + # Assert that help link is correct. + assert_side_bar_help_link( + test=self, + page=self.certificates_page, + href=href, + help_text='Learn more about certificates', + ) + + +class GroupExperimentConfigurationHelpTest(ContainerBase): + """ + Tests help links on course Group Configurations settings page + + It is related to Experiment Group Configurations on the page. + """ + def setUp(self): # pylint: disable=arguments-differ + super(GroupExperimentConfigurationHelpTest, self).setUp() + self.group_configuration_page = GroupConfigurationsPage( + self.browser, + self.course_info['org'], + self.course_info['number'], + self.course_info['run'] + ) + # self.create_poorly_configured_split_instance() + self.group_configuration_page.visit() + + def populate_course_fixture(self, course_fixture): + course_fixture.add_advanced_settings( + {u"advanced_modules": {"value": ["split_test"]}} + ) + + def test_course_group_configuration_experiment_side_bar_help(self): + """ + Scenario: Help link in side bar under the 'Experiment Group Configurations' + is working on Group Configurations settings page + Given that I am on the Group Configurations settings page + And I want help about the process + And I click the 'Learn More' in the sidebar links + Then Help link should open. + And help url should end with + 'content_experiments_configure.html#set-up-group-configurations-in-edx-studio' + """ + href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/en/latest/course_features' \ + '/content_experiments/content_experiments_configure.html#set-up-group-configurations-in-edx-studio' + # Assert that help link is correct. + assert_side_bar_help_link( + test=self, + page=self.group_configuration_page, + href=href, + help_text='Learn More', + ) + + +class ToolsImportHelpTest(StudioCourseTest): + """ + Tests help links on tools import pages. + """ + def setUp(self, is_staff=False, test_xss=True): + + super(ToolsImportHelpTest, self).setUp() + + self.import_page = ImportCoursePage( + self.browser, + self.course_info['org'], + self.course_info['number'], + self.course_info['run'] + ) + self.import_page.visit() + + def test_tools_import_nav_help(self): + """ + Scenario: Help link in navigation bar is working on tools Library import page + Given that I am on the Library import tools page + And I want help about the process + And I click the 'Help' in the navigation bar + Then Help link should open. + And help url should end with 'releasing_course/export_import_course.html#import-a-course' + """ + href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/en/' \ + 'latest/releasing_course/export_import_course.html#import-a-course' + + # Assert that help link is correct. + assert_nav_help_link( + test=self, + page=self.import_page, + href=href + ) + + def test_tools_import_side_bar_help(self): + """ + Scenario: Help link in side bar is working on tools Library import page + Given that I am on the tools Library import page + And I want help about the process + And I click the 'Learn more about importing a course' in the sidebar links + Then Help link should open. + And help url should end with 'releasing_course/export_import_course.html#import-a-course' + """ + href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/en/' \ + 'latest/releasing_course/export_import_course.html#import-a-course' + + # Assert that help link is correct. + assert_side_bar_help_link( + test=self, + page=self.import_page, + href=href, + help_text='Learn more about importing a course', + ) + + +class ToolsExportHelpTest(StudioCourseTest): + """ + Tests help links on tools export pages. + """ + def setUp(self, is_staff=False, test_xss=True): + + super(ToolsExportHelpTest, self).setUp() + + self.export_page = ExportCoursePage( + self.browser, + self.course_info['org'], + self.course_info['number'], + self.course_info['run'] + ) + self.export_page.visit() + + def test_tools_import_nav_help(self): + """ + Scenario: Help link in navigation bar is working on tools Library export page + Given that I am on the Library export tools page + And I want help about the process + And I click the 'Help' in the navigation bar + Then Help link should open. + And help url should end with 'releasing_course/export_import_course.html#export-a-course' + """ + href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/en/' \ + 'latest/releasing_course/export_import_course.html#export-a-course' + + # Assert that help link is correct. + assert_nav_help_link( + test=self, + page=self.export_page, + href=href + ) + + def test_tools_import_side_bar_help(self): + """ + Scenario: Help link in side bar is working on tools Library export page + Given that I am on the tools Library import page + And I want help about the process + And I click the 'Learn more about exporting a course' in the sidebar links + Then Help link should open. + And help url should end with 'releasing_course/export_import_course.html#export-a-course' + """ + href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/en/' \ + 'latest/releasing_course/export_import_course.html#export-a-course' + + # Assert that help link is correct. + assert_side_bar_help_link( + test=self, + page=self.export_page, + href=href, + help_text='Learn more about exporting a course', + ) + + +class StudioWelcomeHelpTest(WebAppTest): + """ + Tests help link on 'Welcome' page ( User not logged in) + """ + def setUp(self): + super(StudioWelcomeHelpTest, self).setUp() + self.index_page = IndexPage(self.browser) + self.index_page.visit() + + def test_welcome_nav_help(self): + """ + Scenario: Help link in navigation bar is working on 'Welcome' page (User not logged in). + Given that I am on the 'Welcome' page. + And I want help about the edx + And I click the 'Help' in the navigation bar + Then Help link should open. + And help url should contain 'getting_started/get_started.html' + """ + # The url we want to see in anchor help element. + href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/' \ + 'en/latest/getting_started/get_started.html' + + # Assert that help link is correct. + assert_nav_help_link( + test=self, + page=self.index_page, + href=href, + signed_in=False + ) From 9aee093300f2839e80990e050dc563c3e31527e7 Mon Sep 17 00:00:00 2001 From: Muddasser Date: Wed, 21 Sep 2016 09:42:09 +0000 Subject: [PATCH 3/4] Addressed Comments --- common/test/acceptance/pages/studio/utils.py | 5 +- .../tests/studio/test_studio_help.py | 53 ++++++++++++------- 2 files changed, 37 insertions(+), 21 deletions(-) diff --git a/common/test/acceptance/pages/studio/utils.py b/common/test/acceptance/pages/studio/utils.py index e3d27753b7..6160497305 100644 --- a/common/test/acceptance/pages/studio/utils.py +++ b/common/test/acceptance/pages/studio/utils.py @@ -306,5 +306,6 @@ class HelpMixin(object): else: element_css = SIDE_BAR_HELP_CSS - self.q(css=element_css).results[index].click() - return self.q(css=element_css).results[index] + help_element = self.q(css=element_css).results[index] + help_element.click() + return help_element diff --git a/common/test/acceptance/tests/studio/test_studio_help.py b/common/test/acceptance/tests/studio/test_studio_help.py index c8a2236743..8828f4cf3c 100644 --- a/common/test/acceptance/tests/studio/test_studio_help.py +++ b/common/test/acceptance/tests/studio/test_studio_help.py @@ -4,6 +4,7 @@ Test the Studio help links. from flaky import flaky from bok_choy.web_app_test import WebAppTest +from unittest import skip from common.test.acceptance.fixtures.course import XBlockFixtureDesc from common.test.acceptance.tests.studio.base_studio_test import StudioCourseTest, ContainerBase @@ -564,25 +565,25 @@ class CourseOutlineHelpTest(StudioCourseTest): ) self.course_outline_page.visit() - # This scenario depends upon TNL-5460 - # def test_course_outline_nav_help(self): - # """ - # Scenario: Help link in navigation bar is working on Course Outline page - # Given that I am on the Course Outline page - # And I want help about the process - # And I click the 'Help' in the navigation bar - # Then Help link should open. - # And help url should end with 'developing_course/course_outline.html' - # """ - # href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff' \ - # '/en/latest/developing_course/course_outline.html' - # - # # Assert that help link is correct. - # assert_nav_help_link( - # test=self, - # page=self.course_outline_page, - # href=href - # ) + @skip("This scenario depends upon TNL-5460") + def test_course_outline_nav_help(self): + """ + Scenario: Help link in navigation bar is working on Course Outline page + Given that I am on the Course Outline page + And I want help about the process + And I click the 'Help' in the navigation bar + Then Help link should open. + And help url should end with 'developing_course/course_outline.html' + """ + href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff' \ + '/en/latest/developing_course/course_outline.html' + + # Assert that help link is correct. + assert_nav_help_link( + test=self, + page=self.course_outline_page, + href=href + ) def test_course_outline_side_bar_help(self): """ @@ -790,6 +791,14 @@ class StudioUnitHelpTest(ContainerBase): super(StudioUnitHelpTest, self).setUp(is_staff=is_staff) def populate_course_fixture(self, course_fixture): + """ + Populates the course fixture. + + We are modifying 'advanced_modules' setting of the + course. + + Also add a section with a subsection and a unit. + """ course_fixture.add_advanced_settings( {u"advanced_modules": {"value": ["split_test"]}} ) @@ -1099,6 +1108,12 @@ class GroupExperimentConfigurationHelpTest(ContainerBase): self.group_configuration_page.visit() def populate_course_fixture(self, course_fixture): + """ + Populates the course fixture. + + We are modifying 'advanced_modules' setting of the + course. + """ course_fixture.add_advanced_settings( {u"advanced_modules": {"value": ["split_test"]}} ) From 8774728226a12c45799b9013a15d79db27819428 Mon Sep 17 00:00:00 2001 From: Muddasser Date: Thu, 22 Sep 2016 09:57:29 +0000 Subject: [PATCH 4/4] Base url for help links is changed --- common/test/acceptance/tests/helpers.py | 18 +--- .../tests/studio/test_studio_help.py | 82 +++++++++---------- 2 files changed, 42 insertions(+), 58 deletions(-) diff --git a/common/test/acceptance/tests/helpers.py b/common/test/acceptance/tests/helpers.py index a71ed7178c..a9443bd10d 100644 --- a/common/test/acceptance/tests/helpers.py +++ b/common/test/acceptance/tests/helpers.py @@ -379,19 +379,6 @@ def auto_auth(browser, username, email, staff, course_id): AutoAuthPage(browser, username=username, email=email, course_id=course_id, staff=staff).visit() -def get_url_with_changed_domain(url): - """ - Replaces .org with .io in the url - - Arguments: - url (str): The url to perform replace operation on. - - Returns: - str: The updated url - """ - return url.replace('.org/', '.io/') - - def assert_link(test, expected_link, actual_link): """ Assert that 'href' and text inside help DOM element are correct. @@ -414,10 +401,7 @@ def assert_opened_help_link_is_correct(test, url): """ test.browser.switch_to_window(test.browser.window_handles[-1]) # Assert that url in the browser is the same. - # Please note that .org domain in href attribute of help anchor DOM element - # is changed into .io domain. This is because browser is redirected from .org - # domain to .io domain. - test.assertEqual(get_url_with_changed_domain(url), test.browser.current_url) + test.assertEqual(url, test.browser.current_url) test.assertNotIn('Maze Found', test.browser.title) diff --git a/common/test/acceptance/tests/studio/test_studio_help.py b/common/test/acceptance/tests/studio/test_studio_help.py index 8828f4cf3c..dcfcfeee39 100644 --- a/common/test/acceptance/tests/studio/test_studio_help.py +++ b/common/test/acceptance/tests/studio/test_studio_help.py @@ -96,7 +96,7 @@ class SignInHelpTest(WebAppTest): """ sign_in_page = self.index_page.click_sign_in() # The href we want to see in anchor help element. - href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/' \ + href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' \ 'en/latest/getting_started/get_started.html' # Assert that help link is correct. @@ -128,7 +128,7 @@ class SignUpHelpTest(WebAppTest): """ sign_up_page = self.index_page.click_sign_up() # The href we want to see in anchor help element. - href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/' \ + href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' \ 'en/latest/getting_started/get_started.html' # Assert that help link is correct. @@ -159,7 +159,7 @@ class HomeHelpTest(StudioCourseTest): And help url should end with 'getting_started/get_started.html' """ # The href we want to see in anchor help element. - href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/' \ + href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' \ 'en/latest/getting_started/get_started.html' # Assert that help link is correct. @@ -179,7 +179,7 @@ class HomeHelpTest(StudioCourseTest): And help url should end with 'getting_started/get_started.html' """ # The href we want to see in anchor help element. - href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/' \ + href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' \ 'en/latest/getting_started/get_started.html' # Assert that help link is correct. @@ -215,7 +215,7 @@ class NewCourseHelpTest(WebAppTest): And help url should end with 'getting_started/get_started.html' """ # The href we want to see in anchor help element. - href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff' \ + href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course' \ '/en/latest/getting_started/get_started.html' # Assert that help link is correct. @@ -235,7 +235,7 @@ class NewCourseHelpTest(WebAppTest): And help url should end with 'getting_started/get_started.html' """ # The href we want to see in anchor help element. - href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/' \ + href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' \ 'en/latest/getting_started/get_started.html' # Assert that help link is correct. @@ -271,7 +271,7 @@ class NewLibraryHelpTest(WebAppTest): And help url should end with 'getting_started/get_started.html' """ # The href we want to see in anchor help element. - href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/' \ + href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' \ 'en/latest/getting_started/get_started.html' # Assert that help link is correct. @@ -291,7 +291,7 @@ class NewLibraryHelpTest(WebAppTest): And help url should end with 'getting_started/get_started.html' """ # The href we want to see in anchor help element. - href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/' \ + href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' \ 'en/latest/getting_started/get_started.html' # Assert that help link is correct. @@ -327,7 +327,7 @@ class LibraryTabHelpTest(WebAppTest): self.assertTrue(self.dashboard_page.has_new_library_button) click_css(self.dashboard_page, '#course-index-tabs .libraries-tab', 0, False) # The href we want to see in anchor help element. - href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/' \ + href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' \ 'en/latest/getting_started/get_started.html' # Assert that help link is correct. @@ -359,8 +359,8 @@ class LibraryHelpTest(StudioLibraryTest): """ self.library_page.visit() # The href we want to see in anchor help element. - href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/' \ - 'en/latest/course_components/libraries.html' + href = "http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/" \ + "en/latest/course_components/libraries.html" # Assert that help link is correct. assert_nav_help_link( @@ -381,7 +381,7 @@ class LibraryHelpTest(StudioLibraryTest): """ self.library_page.visit() # The href we want to see in anchor help element. - href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/' \ + href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' \ 'en/latest/course_components/libraries.html' # Assert that help link is correct. @@ -405,7 +405,7 @@ class LibraryHelpTest(StudioLibraryTest): """ self.library_user_page.visit() # The href we want to see in anchor help element. - href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/en/' \ + href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/' \ 'latest/course_components/libraries.html#give-other-users-access-to-your-library' # Assert that help link is correct. @@ -435,7 +435,7 @@ class LibraryImportHelpTest(StudioLibraryTest): And help url should end with 'creating_content/libraries.html#import-a-library' """ # The href we want to see in anchor help element. - href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/en/' \ + href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/' \ 'latest/course_components/libraries.html#import-a-library' # Assert that help link is correct. @@ -455,7 +455,7 @@ class LibraryImportHelpTest(StudioLibraryTest): And help url should end with 'creating_content/libraries.html#import-a-library' """ # The href we want to see in anchor help element. - href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/en/' \ + href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/' \ 'latest/course_components/libraries.html#import-a-library' # Assert that help link is correct. @@ -486,7 +486,7 @@ class LibraryExportHelpTest(StudioLibraryTest): And help url should end with 'creating_content/libraries.html#export-a-library' """ # The href we want to see in anchor help element. - href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/en/' \ + href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/' \ 'latest/course_components/libraries.html#export-a-library' # Assert that help link is correct. @@ -506,7 +506,7 @@ class LibraryExportHelpTest(StudioLibraryTest): And help url should end with 'creating_content/libraries.html#export-a-library' """ # The href we want to see in anchor help element. - href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/en/' \ + href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/' \ 'latest/course_components/libraries.html#export-a-library' # Assert that help link is correct. @@ -540,7 +540,7 @@ class NewProgramHelpTest(ProgramsConfigMixin, WebAppTest): And help url should end with 'index.html' """ self.program_page.click_new_program_button() - href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff' \ + href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course' \ '/en/latest/index.html' # Assert that help link is correct. @@ -575,7 +575,7 @@ class CourseOutlineHelpTest(StudioCourseTest): Then Help link should open. And help url should end with 'developing_course/course_outline.html' """ - href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff' \ + href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course' \ '/en/latest/developing_course/course_outline.html' # Assert that help link is correct. @@ -594,7 +594,7 @@ class CourseOutlineHelpTest(StudioCourseTest): Then Help link should open. And help url should end with 'developing_course/course_outline.html' """ - href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff' \ + href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course' \ '/en/latest/developing_course/course_outline.html' # Assert that help link is correct. @@ -630,7 +630,7 @@ class CourseUpdateHelpTest(StudioCourseTest): Then Help link should open. And help url should end with 'course_assets/handouts_updates.html' """ - href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/' \ + href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' \ 'en/latest/course_assets/handouts_updates.html' # Assert that help link is correct. @@ -664,7 +664,7 @@ class AssetIndexHelpTest(StudioCourseTest): Then Help link should open. And help url should end with 'course_assets/course_files.html' """ - href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/' \ + href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' \ 'en/latest/course_assets/course_files.html' # Assert that help link is correct. @@ -683,7 +683,7 @@ class AssetIndexHelpTest(StudioCourseTest): Then Help link should open. And help url should end with 'course_assets/course_files.html' """ - href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/' \ + href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' \ 'en/latest/course_assets/course_files.html' # Assert that help link is correct. @@ -718,7 +718,7 @@ class CoursePagesHelpTest(StudioCourseTest): Then Help link should open. And help url should end with 'course_assets/pages.html' """ - href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/' \ + href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' \ 'en/latest/course_assets/pages.html' # Assert that help link is correct. @@ -752,7 +752,7 @@ class UploadTextbookHelpTest(StudioCourseTest): Then Help link should open. And help url should end with 'course_assets/textbooks.html' """ - href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff' \ + href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course' \ '/en/latest/course_assets/textbooks.html' # Assert that help link is correct. @@ -771,7 +771,7 @@ class UploadTextbookHelpTest(StudioCourseTest): Then Help link should open. And help url should end with 'course_assets/textbooks.html' """ - href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff' \ + href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course' \ '/en/latest/course_assets/textbooks.html' # Assert that help link is correct. @@ -821,7 +821,7 @@ class StudioUnitHelpTest(ContainerBase): And help url should end with 'developing_course/course_units.html' """ unit_page = self.go_to_unit_page() - href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff' \ + href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course' \ '/en/latest/developing_course/course_units.html' # Assert that help link is correct. @@ -857,7 +857,7 @@ class SettingsHelpTest(StudioCourseTest): Then Help link should open. And help url should end with 'set_up_course/setting_up_student_view.html' """ - href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff' \ + href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course' \ '/en/latest/set_up_course/setting_up_student_view.html' # Assert that help link is correct. @@ -893,7 +893,7 @@ class GradingPageHelpTest(StudioCourseTest): Then Help link should open. And help url should end with 'grading/index.html' """ - href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/' \ + href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' \ 'en/latest/grading/index.html' # Assert that help link is correct. @@ -929,7 +929,7 @@ class CourseTeamSettingsHelpTest(StudioCourseTest): Then Help link should open. And help url should end with 'set_up_course/course_staffing.html#add-course-team-members' """ - href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/' \ + href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' \ 'en/latest/set_up_course/course_staffing.html#add-course-team-members' # Assert that help link is correct. @@ -966,7 +966,7 @@ class CourseGroupConfigurationHelpTest(StudioCourseTest): Then Help link should open. And help url should end with 'index.html' """ - href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/' \ + href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' \ 'en/latest/index.html' # Assert that help link is correct. @@ -986,7 +986,7 @@ class CourseGroupConfigurationHelpTest(StudioCourseTest): Then Help link should open. And help url should end with 'course_features/cohorts/cohorted_courseware.html' """ - href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/' \ + href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' \ 'en/latest/course_features/cohorts/cohorted_courseware.html' # Assert that help link is correct. @@ -1023,7 +1023,7 @@ class AdvancedSettingHelpTest(StudioCourseTest): Then Help link should open. And help url should end with 'index.html' """ - href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff' \ + href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course' \ '/en/latest/index.html' # Assert that help link is correct. @@ -1059,7 +1059,7 @@ class CertificatePageHelpTest(StudioCourseTest): Then Help link should open. And help url should end with 'set_up_course/creating_course_certificates.html' """ - href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff' \ + href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course' \ '/en/latest/set_up_course/creating_course_certificates.html' # Assert that help link is correct. @@ -1078,7 +1078,7 @@ class CertificatePageHelpTest(StudioCourseTest): Then Help link should open. And help url should end with 'set_up_course/creating_course_certificates.html' """ - href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff' \ + href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course' \ '/en/latest/set_up_course/creating_course_certificates.html' # Assert that help link is correct. @@ -1129,7 +1129,7 @@ class GroupExperimentConfigurationHelpTest(ContainerBase): And help url should end with 'content_experiments_configure.html#set-up-group-configurations-in-edx-studio' """ - href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/en/latest/course_features' \ + href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/latest/course_features' \ '/content_experiments/content_experiments_configure.html#set-up-group-configurations-in-edx-studio' # Assert that help link is correct. assert_side_bar_help_link( @@ -1165,7 +1165,7 @@ class ToolsImportHelpTest(StudioCourseTest): Then Help link should open. And help url should end with 'releasing_course/export_import_course.html#import-a-course' """ - href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/en/' \ + href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/' \ 'latest/releasing_course/export_import_course.html#import-a-course' # Assert that help link is correct. @@ -1184,7 +1184,7 @@ class ToolsImportHelpTest(StudioCourseTest): Then Help link should open. And help url should end with 'releasing_course/export_import_course.html#import-a-course' """ - href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/en/' \ + href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/' \ 'latest/releasing_course/export_import_course.html#import-a-course' # Assert that help link is correct. @@ -1221,7 +1221,7 @@ class ToolsExportHelpTest(StudioCourseTest): Then Help link should open. And help url should end with 'releasing_course/export_import_course.html#export-a-course' """ - href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/en/' \ + href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/' \ 'latest/releasing_course/export_import_course.html#export-a-course' # Assert that help link is correct. @@ -1240,7 +1240,7 @@ class ToolsExportHelpTest(StudioCourseTest): Then Help link should open. And help url should end with 'releasing_course/export_import_course.html#export-a-course' """ - href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/en/' \ + href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/' \ 'latest/releasing_course/export_import_course.html#export-a-course' # Assert that help link is correct. @@ -1271,7 +1271,7 @@ class StudioWelcomeHelpTest(WebAppTest): And help url should contain 'getting_started/get_started.html' """ # The url we want to see in anchor help element. - href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/' \ + href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' \ 'en/latest/getting_started/get_started.html' # Assert that help link is correct.