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


Python ContainerPage.wait_for_page方法代码示例

本文整理汇总了Python中common.test.acceptance.pages.studio.container.ContainerPage.wait_for_page方法的典型用法代码示例。如果您正苦于以下问题:Python ContainerPage.wait_for_page方法的具体用法?Python ContainerPage.wait_for_page怎么用?Python ContainerPage.wait_for_page使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在common.test.acceptance.pages.studio.container.ContainerPage的用法示例。


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

示例1: _studio_add_content

# 需要导入模块: from common.test.acceptance.pages.studio.container import ContainerPage [as 别名]
# 或者: from common.test.acceptance.pages.studio.container.ContainerPage import wait_for_page [as 别名]
    def _studio_add_content(self, studio_course_outline, html_content):
        """
        Add content to first section on studio course page.
        """
        # create a unit in course outline
        studio_course_outline.visit()
        subsection = studio_course_outline.section_at(0).subsection_at(0)
        subsection.expand_subsection()
        subsection.add_unit()

        # got to unit and create an HTML component and save (not publish)
        unit_page = ContainerPage(self.browser, None)
        unit_page.wait_for_page()
        add_html_component(unit_page, 0)
        unit_page.wait_for_element_presence('.edit-button', 'Edit button is visible')
        click_css(unit_page, '.edit-button', 0, require_notification=False)
        unit_page.wait_for_element_visibility('.modal-editor', 'Modal editor is visible')
        type_in_codemirror(unit_page, 0, html_content)
        click_css(unit_page, '.action-save', 0)
开发者ID:digitalsatori,项目名称:edx-platform,代码行数:21,代码来源:test_lms_dashboard_search.py

示例2: _studio_add_content

# 需要导入模块: from common.test.acceptance.pages.studio.container import ContainerPage [as 别名]
# 或者: from common.test.acceptance.pages.studio.container.ContainerPage import wait_for_page [as 别名]
    def _studio_add_content(self, section_index):
        """
        Add content on studio course page under specified section
        """

        self._auto_auth(self.STAFF_USERNAME, self.STAFF_EMAIL, True)
        # create a unit in course outline
        self.studio_course_outline.visit()
        subsection = self.studio_course_outline.section_at(section_index).subsection_at(0)
        subsection.expand_subsection()
        subsection.add_unit()

        # got to unit and create an HTML component and save (not publish)
        unit_page = ContainerPage(self.browser, None)
        unit_page.wait_for_page()
        add_html_component(unit_page, 0)
        unit_page.wait_for_element_presence('.edit-button', 'Edit button is visible')
        click_css(unit_page, '.edit-button', 0, require_notification=False)
        unit_page.wait_for_element_visibility('.modal-editor', 'Modal editor is visible')
        type_in_codemirror(unit_page, 0, self.HTML_CONTENT)
        click_css(unit_page, '.action-save', 0)
开发者ID:digitalsatori,项目名称:edx-platform,代码行数:23,代码来源:test_lms_courseware_search.py

示例3: HTMLComponentEditorTests

# 需要导入模块: from common.test.acceptance.pages.studio.container import ContainerPage [as 别名]
# 或者: from common.test.acceptance.pages.studio.container.ContainerPage import wait_for_page [as 别名]
class HTMLComponentEditorTests(ContainerBase):
    """
    Feature: CMS.Component Adding
    As a course author, I want to be able to add and edit HTML component
    """
    shard = 18

    def setUp(self, is_staff=True):
        """
        Create a course with a section, subsection, and unit to which to add the component.
        """
        super(HTMLComponentEditorTests, self).setUp(is_staff=is_staff)
        self.unit = self.go_to_unit_page()
        self.container_page = ContainerPage(self.browser, None)
        self.xblock_wrapper = XBlockWrapper(self.browser, None)
        self.component = None
        self.html_editor = None
        self.iframe = None

    def populate_course_fixture(self, course_fixture):
        """
        Adds a course fixture
        """
        course_fixture.add_children(
            XBlockFixtureDesc('chapter', 'Test Section').add_children(
                XBlockFixtureDesc('sequential', 'Test Subsection').add_children(
                    XBlockFixtureDesc('vertical', 'Test Unit')
                )
            )
        )

    def _add_content(self, content):
        """
        Set and save content in editor and assert its presence in container page's html

        Args:
            content(str): Verifiable content
        """
        self.html_editor.set_raw_content(content)
        self.html_editor.save_content()
        self.container_page.wait_for_page()

    def _add_component(self, sub_type):
        """
        Add sub-type of HTML component in studio

        Args:
            sub_type(str): Sub-type of HTML component
        """
        add_component(self.container_page, 'html', sub_type)
        self.component = self.unit.xblocks[1]
        self.html_editor = HtmlXBlockEditorView(self.browser, self.component.locator)
        self.iframe = HTMLEditorIframe(self.browser, self.component.locator)

    def test_user_can_view_metadata(self):
        """
        Scenario: User can view metadata
        Given I have created a Blank HTML Page
            And I edit and select Settings
                Then I see the HTML component settings
        """

        # Add HTML Text type component
        self._add_component('Text')
        self.container_page.edit()
        self.html_editor.open_settings_tab()
        display_name_value = self.html_editor.get_default_settings()[0]
        display_name_key = self.html_editor.keys[0]
        self.assertEqual(
            ['Display Name', 'Text'],
            [display_name_key, display_name_value],
            "Settings not found"
        )
        editor_value = self.html_editor.get_default_settings()[1]
        editor_key = self.html_editor.keys[1]
        self.assertEqual(
            ['Editor', 'Visual'],
            [editor_key, editor_value],
            "Settings not found"
        )

    def test_user_can_modify_display_name(self):
        """
        Scenario: User can modify display name
        Given I have created a Blank HTML Page
            And I edit and select Settings
        Then I can modify the display name
            And my display name change is persisted on save
        """
        # Add HTML Text type component
        self._add_component('Text')
        self.container_page.edit()
        self.html_editor.open_settings_tab()
        self.html_editor.set_field_val('Display Name', 'New Name')
        self.html_editor.save_settings()
        component_name = self.unit.xblock_titles[0]
        self.assertEqual(component_name, 'New Name', "Component name is not as edited")

    def test_link_plugin_sets_url_correctly(self):
        """
#.........这里部分代码省略.........
开发者ID:digitalsatori,项目名称:edx-platform,代码行数:103,代码来源:test_studio_html_editor.py


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