当前位置: 首页>>代码示例>>Python>>正文


Python auto_auth.AutoAuthPage类代码示例

本文整理汇总了Python中common.test.acceptance.pages.common.auto_auth.AutoAuthPage的典型用法代码示例。如果您正苦于以下问题:Python AutoAuthPage类的具体用法?Python AutoAuthPage怎么用?Python AutoAuthPage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了AutoAuthPage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: LibraryTabHelpTest

class LibraryTabHelpTest(AcceptanceTest):
    """
    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 be correct
        """
        self.assertTrue(self.dashboard_page.has_new_library_button)
        click_css(self.dashboard_page, '#course-index-tabs .libraries-tab', 0, False)
        expected_url = _get_expected_documentation_url('/getting_started/CA_get_started_Studio.html')

        # Assert that help link is correct.
        assert_nav_help_link(
            test=self,
            page=self.dashboard_page,
            href=expected_url
        )
开发者ID:mreyk,项目名称:edx-platform,代码行数:30,代码来源:test_studio_help.py

示例2: log_in_as_unique_user

 def log_in_as_unique_user(self):
     """
     Create a unique user and return the account's username and id.
     """
     username = "test_{uuid}".format(uuid=self.unique_id[0:6])
     auto_auth_page = AutoAuthPage(self.browser, username=username).visit()
     user_id = auto_auth_page.get_user_id()
     return username, user_id
开发者ID:mattpe,项目名称:edx-platform,代码行数:8,代码来源:test_learner_profile.py

示例3: auth

    def auth(self, enroll=True):
        """Authenticate, enrolling the user in the configured course if requested."""
        CourseFixture(**self.course_info).install()

        course_id = self.course_id if enroll else None
        auth_page = AutoAuthPage(self.browser, course_id=course_id)
        auth_page.visit()

        self.username = auth_page.user_info['username']
开发者ID:mreyk,项目名称:edx-platform,代码行数:9,代码来源:test_programs.py

示例4: log_in

 def log_in(self, user, is_staff=False):
     """
     Log in as the user that created the library.
     By default the user will not have staff access unless is_staff is passed as True.
     """
     auth_page = AutoAuthPage(
         self.browser,
         staff=is_staff,
         username=user.get('username'),
         email=user.get('email'),
         password=user.get('password')
     )
     auth_page.visit()
开发者ID:AlexxNica,项目名称:edx-platform,代码行数:13,代码来源:base_studio_test.py

示例5: NewLibraryHelpTest

class NewLibraryHelpTest(AcceptanceTest):
    """
    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 be correct
        """
        expected_url = _get_expected_documentation_url('/getting_started/CA_get_started_Studio.html')

        # Assert that help link is correct.
        assert_nav_help_link(
            test=self,
            page=self.dashboard_page,
            href=expected_url
        )

    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 Your Platform Studio' in the sidebar links
        Then Help link should open.
        And help url should be correct
        """
        expected_url = _get_expected_documentation_url('/getting_started/CA_get_started_Studio.html')

        # Assert that help link is correct.
        assert_side_bar_help_link(
            test=self,
            page=self.dashboard_page,
            href=expected_url,
            help_text='Getting Started with Your Platform Studio',
            as_list_item=True
        )
开发者ID:mreyk,项目名称:edx-platform,代码行数:50,代码来源:test_studio_help.py

示例6: log_in_as_unique_user

 def log_in_as_unique_user(self, email=None, full_name=None, password=None):
     """
     Create a unique user and return the account's username and id.
     """
     username = "test_{uuid}".format(uuid=self.unique_id[0:6])
     auto_auth_page = AutoAuthPage(
         self.browser,
         username=username,
         email=email,
         full_name=full_name,
         password=password
     ).visit()
     user_id = auto_auth_page.get_user_id()
     return username, user_id
开发者ID:cmscom,项目名称:edx-platform,代码行数:14,代码来源:test_account_settings.py

示例7: setUp

    def setUp(self):
        """
        Create a unique identifier for the course used in this test.
        """
        # Ensure that the superclass sets up
        super(XBlockAcidBase, self).setUp()

        # Define a unique course identifier
        self.course_info = {
            'org': 'test_org',
            'number': 'course_' + self.unique_id[:5],
            'run': 'test_' + self.unique_id,
            'display_name': 'Test Course ' + self.unique_id
        }

        self.outline = CourseOutlinePage(
            self.browser,
            self.course_info['org'],
            self.course_info['number'],
            self.course_info['run']
        )

        self.course_id = '{org}.{number}.{run}'.format(**self.course_info)

        self.setup_fixtures()

        self.auth_page = AutoAuthPage(
            self.browser,
            staff=False,
            username=self.user.get('username'),
            email=self.user.get('email'),
            password=self.user.get('password')
        )
        self.auth_page.visit()
开发者ID:AlexxNica,项目名称:edx-platform,代码行数:34,代码来源:test_studio_acid_xblock.py

示例8: setUp

    def setUp(self):
        """
        Initialization of pages and course fixture for video tests
        """
        super(VideoBaseTest, self).setUp()
        self.longMessage = True

        self.video = VideoPage(self.browser)
        self.tab_nav = TabNavPage(self.browser)
        self.courseware_page = CoursewarePage(self.browser, self.course_id)
        self.course_info_page = CourseInfoPage(self.browser, self.course_id)
        self.auth_page = AutoAuthPage(self.browser, course_id=self.course_id)

        self.course_fixture = CourseFixture(
            self.course_info['org'], self.course_info['number'],
            self.course_info['run'], self.course_info['display_name']
        )

        self.metadata = None
        self.assets = []
        self.contents_of_verticals = None
        self.youtube_configuration = {}
        self.user_info = {}

        # reset youtube stub server
        self.addCleanup(YouTubeStubConfig.reset)
开发者ID:jolyonb,项目名称:edx-platform,代码行数:26,代码来源:test_video_module.py

示例9: CreateLibraryTest

class CreateLibraryTest(AcceptanceTest):
    """
    Test that we can create a new content library on the studio home page.
    """

    def setUp(self):
        """
        Load the helper for the home page (dashboard page)
        """
        super(CreateLibraryTest, self).setUp()

        self.auth_page = AutoAuthPage(self.browser, staff=True)
        self.dashboard_page = DashboardPage(self.browser)

    def test_create_library(self):
        """
        From the home page:
            Click "New Library"
            Fill out the form
            Submit the form
            We should be redirected to the edit view for the library
            Return to the home page
            The newly created library should now appear in the list of libraries
        """
        unique_suffix = uuid4().hex[:4]
        name = "New Library Name " + unique_suffix
        org = "TestOrgX" + unique_suffix
        number = "TESTLIB_" + unique_suffix

        self.auth_page.visit()
        self.dashboard_page.visit()
        self.assertFalse(self.dashboard_page.has_library(name=name, org=org, number=number))
        self.assertTrue(self.dashboard_page.has_new_library_button())

        self.dashboard_page.click_new_library()
        self.assertTrue(self.dashboard_page.is_new_library_form_visible())
        self.dashboard_page.fill_new_library_form(name, org, number)
        self.assertTrue(self.dashboard_page.is_new_library_form_valid())
        self.dashboard_page.submit_new_library_form()

        # The next page is the library edit view; make sure it loads:
        lib_page = LibraryEditPage(self.browser, LibraryLocator(org, number))
        lib_page.wait_for_page()

        # Then go back to the home page and make sure the new library is listed there:
        self.dashboard_page.visit()
        self.assertTrue(self.dashboard_page.has_library(name=name, org=org, number=number))
开发者ID:Stanford-Online,项目名称:edx-platform,代码行数:47,代码来源:test_studio_home.py

示例10: setUp

 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()
开发者ID:mreyk,项目名称:edx-platform,代码行数:8,代码来源:test_studio_help.py

示例11: LoggedInPagesTest

class LoggedInPagesTest(AcceptanceTest):
    """
    Verify the pages in Studio that you can get to when logged in and do not have a course yet.
    """
    def setUp(self):
        super(LoggedInPagesTest, self).setUp()
        self.auth_page = AutoAuthPage(self.browser, staff=True)
        self.dashboard_page = DashboardPage(self.browser)
        self.home_page = HomePage(self.browser)

    def test_logged_in_no_courses(self):
        """
        Make sure that you can get to the dashboard and home pages without a course.
        """
        self.auth_page.visit()
        self.dashboard_page.visit()
        self.home_page.visit()
开发者ID:Lektorium-LLC,项目名称:edx-platform,代码行数:17,代码来源:test_studio_general.py

示例12: setUp

    def setUp(self):
        """
        Load the helper for the home page (dashboard page)
        """
        super(CreateLibraryTest, self).setUp()

        self.auth_page = AutoAuthPage(self.browser, staff=True)
        self.dashboard_page = DashboardPage(self.browser)
开发者ID:Stanford-Online,项目名称:edx-platform,代码行数:8,代码来源:test_studio_home.py

示例13: setUp

    def setUp(self):
        """
        Load the helper for the home page (dashboard page)
        """
        super(CreateCourseTest, self).setUp()

        self.auth_page = AutoAuthPage(self.browser, staff=True)
        self.dashboard_page = DashboardPage(self.browser)
        self.course_name = "New Course Name"
        self.course_org = "orgX"
        self.course_number = str(uuid.uuid4().get_hex().upper()[0:6])
        self.course_run = "2015_T2"
开发者ID:luisvasq,项目名称:edx-platform,代码行数:12,代码来源:test_studio_course_create.py

示例14: StudioCourseTest

class StudioCourseTest(UniqueCourseTest):
    """
    Base class for all Studio course tests.
    """

    def setUp(self, is_staff=False, test_xss=True):  # pylint: disable=arguments-differ
        """
        Install a course with no content using a fixture.
        """
        super(StudioCourseTest, self).setUp()
        self.test_xss = test_xss
        self.install_course_fixture(is_staff)

    def install_course_fixture(self, is_staff=False):
        """
        Install a course fixture
        """
        self.course_fixture = CourseFixture(
            self.course_info['org'],
            self.course_info['number'],
            self.course_info['run'],
            self.course_info['display_name'],
        )
        if self.test_xss:
            xss_injected_unique_id = XSS_INJECTION + self.unique_id
            test_improper_escaping = {u"value": xss_injected_unique_id}
            self.course_fixture.add_advanced_settings({
                "advertised_start": test_improper_escaping,
                "info_sidebar_name": test_improper_escaping,
                "cert_name_short": test_improper_escaping,
                "cert_name_long": test_improper_escaping,
                "display_organization": test_improper_escaping,
                "display_coursenumber": test_improper_escaping,
            })
            self.course_info['display_organization'] = xss_injected_unique_id
            self.course_info['display_coursenumber'] = xss_injected_unique_id
        self.populate_course_fixture(self.course_fixture)
        self.course_fixture.install()
        self.user = self.course_fixture.user
        self.log_in(self.user, is_staff)

    def populate_course_fixture(self, course_fixture):
        """
        Populate the children of the test course fixture.
        """
        pass

    def log_in(self, user, is_staff=False):
        """
        Log in as the user that created the course. The user will be given instructor access
        to the course and enrolled in it. By default the user will not have staff access unless
        is_staff is passed as True.

        Args:
            user(dict): dictionary containing user data: {'username': ..., 'email': ..., 'password': ...}
            is_staff(bool): register this user as staff
        """
        self.auth_page = AutoAuthPage(
            self.browser,
            staff=is_staff,
            username=user.get('username'),
            email=user.get('email'),
            password=user.get('password')
        )
        self.auth_page.visit()
开发者ID:AlexxNica,项目名称:edx-platform,代码行数:65,代码来源:base_studio_test.py

示例15: VideoBaseTest

class VideoBaseTest(UniqueCourseTest):
    """
    Base class for tests of the Video Player
    Sets up the course and provides helper functions for the Video tests.
    """

    def setUp(self):
        """
        Initialization of pages and course fixture for video tests
        """
        super(VideoBaseTest, self).setUp()
        self.longMessage = True

        self.video = VideoPage(self.browser)
        self.tab_nav = TabNavPage(self.browser)
        self.courseware_page = CoursewarePage(self.browser, self.course_id)
        self.course_info_page = CourseInfoPage(self.browser, self.course_id)
        self.auth_page = AutoAuthPage(self.browser, course_id=self.course_id)

        self.course_fixture = CourseFixture(
            self.course_info['org'], self.course_info['number'],
            self.course_info['run'], self.course_info['display_name']
        )

        self.metadata = None
        self.assets = []
        self.contents_of_verticals = None
        self.youtube_configuration = {}
        self.user_info = {}

        # reset youtube stub server
        self.addCleanup(YouTubeStubConfig.reset)

    def navigate_to_video(self):
        """ Prepare the course and get to the video and render it """
        self._install_course_fixture()
        self._navigate_to_courseware_video_and_render()

    def navigate_to_video_no_render(self):
        """
        Prepare the course and get to the video unit
        however do not wait for it to render, because
        the has been an error.
        """
        self._install_course_fixture()
        self._navigate_to_courseware_video_no_render()

    def _install_course_fixture(self):
        """ Install the course fixture that has been defined """
        if self.assets:
            self.course_fixture.add_asset(self.assets)

        chapter_sequential = XBlockFixtureDesc('sequential', 'Test Section')
        chapter_sequential.add_children(*self._add_course_verticals())
        chapter = XBlockFixtureDesc('chapter', 'Test Chapter').add_children(chapter_sequential)
        self.course_fixture.add_children(chapter)
        self.course_fixture.install()

        if len(self.youtube_configuration) > 0:
            YouTubeStubConfig.configure(self.youtube_configuration)

    def _add_course_verticals(self):
        """
        Create XBlockFixtureDesc verticals
        :return: a list of XBlockFixtureDesc
        """
        xblock_verticals = []
        _contents_of_verticals = self.contents_of_verticals

        # Video tests require at least one vertical with a single video.
        if not _contents_of_verticals:
            _contents_of_verticals = [[{'display_name': 'Video', 'metadata': self.metadata}]]

        for vertical_index, vertical in enumerate(_contents_of_verticals):
            xblock_verticals.append(self._create_single_vertical(vertical, vertical_index))

        return xblock_verticals

    def _create_single_vertical(self, vertical_contents, vertical_index):
        """
        Create a single course vertical of type XBlockFixtureDesc with category `vertical`.
        A single course vertical can contain single or multiple video modules.
        :param vertical_contents: a list of items for the vertical to contain
        :param vertical_index: index for the vertical display name
        :return: XBlockFixtureDesc
        """
        xblock_course_vertical = XBlockFixtureDesc('vertical', u'Test Vertical-{0}'.format(vertical_index))

        for video in vertical_contents:
            xblock_course_vertical.add_children(
                XBlockFixtureDesc('video', video['display_name'], metadata=video.get('metadata')))

        return xblock_course_vertical

    def _navigate_to_courseware_video(self):
        """ Register for the course and navigate to the video unit """
        self.auth_page.visit()
        self.user_info = self.auth_page.user_info
        self.courseware_page.visit()

#.........这里部分代码省略.........
开发者ID:jolyonb,项目名称:edx-platform,代码行数:101,代码来源:test_video_module.py


注:本文中的common.test.acceptance.pages.common.auto_auth.AutoAuthPage类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。