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


Python AdvancedSettingsPage.toggle_deprecated_settings方法代码示例

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


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

示例1: AdvancedSettingsValidationTest

# 需要导入模块: from common.test.acceptance.pages.studio.settings_advanced import AdvancedSettingsPage [as 别名]
# 或者: from common.test.acceptance.pages.studio.settings_advanced.AdvancedSettingsPage import toggle_deprecated_settings [as 别名]

#.........这里部分代码省略.........
                And he clicks 'save' button from the notification bar
                Then he is able to see the confirmation message
        """
        self.advanced_settings.set('Maximum Attempts', 5)
        confirmation_message = self.advanced_settings.confirmation_message
        self.assertEqual(
            confirmation_message,
            'Your policy changes have been saved.',
            'Settings must be saved successfully in order to have confirmation message'
        )

    def test_deprecated_settings_invisible_by_default(self):
        """
        Scenario: Test that advanced settings does not have deprecated settings by default
            Given a staff logs in to studio
            When this user goes to advanced settings page
                Then the user does not see the deprecated settings
                And sees 'Show Deprecated Settings' button
        """
        button_text = self.advanced_settings.deprecated_settings_button_text
        self.assertEqual(button_text, 'Show Deprecated Settings')
        self.assertFalse(self.advanced_settings.is_deprecated_setting_visible())

    def test_deprecated_settings_can_be_toggled(self):
        """
        Scenario: Test that advanced settings can toggle deprecated settings
            Given I am on the Advanced Course Settings page in Studio
            When I toggle the display of deprecated settings
                Then deprecated settings are then shown
            And I toggle the display of deprecated settings
                Then deprecated settings are not shown
        """

        self.advanced_settings.toggle_deprecated_settings()
        button_text = self.advanced_settings.deprecated_settings_button_text
        self.assertEqual(
            button_text,
            'Hide Deprecated Settings',
            "Button text should change to 'Hide Deprecated Settings' after the click"
        )
        self.assertTrue(self.advanced_settings.is_deprecated_setting_visible())
        self.advanced_settings.toggle_deprecated_settings()
        self.assertFalse(self.advanced_settings.is_deprecated_setting_visible())
        self.assertEqual(
            self.advanced_settings.deprecated_settings_button_text,
            'Show Deprecated Settings',
            "Button text should change to 'Show Deprecated Settings' after the click"
        )

    def test_multi_line_input(self):
        """
        Scenario: Test that advanced settings correctly shows the multi-line input
            Given I am on the Advanced Course Settings page in Studio
            When I create a JSON object as a value for "Discussion Topic Mapping"
                Then it is displayed as formatted
        """

        inputs = {
            "key": "value",
            "key_2": "value_2"
        }
        json_input = json.dumps(inputs)
        self.advanced_settings.set('Discussion Topic Mapping', json_input)
        self.assertEqual(
            self.advanced_settings.get('Discussion Topic Mapping'),
            '{\n    "key": "value",\n    "key_2": "value_2"\n}'
开发者ID:cmscom,项目名称:edx-platform,代码行数:70,代码来源:test_studio_settings.py


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