本文整理汇总了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}'