當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。