本文整理汇总了Python中common.test.acceptance.pages.studio.settings_group_configurations.GroupConfigurationsPage.create_experiment_group_configuration方法的典型用法代码示例。如果您正苦于以下问题:Python GroupConfigurationsPage.create_experiment_group_configuration方法的具体用法?Python GroupConfigurationsPage.create_experiment_group_configuration怎么用?Python GroupConfigurationsPage.create_experiment_group_configuration使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common.test.acceptance.pages.studio.settings_group_configurations.GroupConfigurationsPage
的用法示例。
在下文中一共展示了GroupConfigurationsPage.create_experiment_group_configuration方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: GroupConfigurationsTest
# 需要导入模块: from common.test.acceptance.pages.studio.settings_group_configurations import GroupConfigurationsPage [as 别名]
# 或者: from common.test.acceptance.pages.studio.settings_group_configurations.GroupConfigurationsPage import create_experiment_group_configuration [as 别名]
#.........这里部分代码省略.........
self.assertEqual(len(config.groups), 0)
self._assert_fields(
config,
cid="0", name="Name of the Group Configuration",
description="Description of the group configuration.",
groups=["Group 0", "Group 1"]
)
config = self.page.experiment_group_configurations[1]
self._assert_fields(
config,
name="Name of second Group Configuration",
description="Second group configuration.",
groups=["Alpha", "Beta", "Gamma"]
)
def test_can_create_and_edit_group_configuration(self):
"""
Scenario: Ensure that the group configuration can be created and edited correctly.
Given I have a course without group configurations
When I click button 'Create new Group Configuration'
And I set new name and description, change name for the 2nd default group, add one new group
And I click button 'Create'
Then I see the new group configuration is added and has correct data
When I edit the group group_configuration
And I change the name and description, add new group, remove old one and change name for the Group A
And I click button 'Save'
Then I see the group configuration is saved successfully and has the new data
"""
self.page.visit()
self.assertEqual(len(self.page.experiment_group_configurations), 0)
# Create new group configuration
self.page.create_experiment_group_configuration()
config = self.page.experiment_group_configurations[0]
config.name = "New Group Configuration Name"
config.description = "New Description of the group configuration."
config.groups[1].name = "New Group Name"
# Add new group
config.add_group() # Group C
# Save the configuration
self.assertEqual(config.get_text('.action-primary'), "Create")
self.assertFalse(config.delete_button_is_present)
config.save()
self._assert_fields(
config,
name="New Group Configuration Name",
description="New Description of the group configuration.",
groups=["Group A", "New Group Name", "Group C"]
)
# Edit the group configuration
config.edit()
# Update fields
self.assertTrue(config.id)
config.name = "Second Group Configuration Name"
config.description = "Second Description of the group configuration."
self.assertEqual(config.get_text('.action-primary'), "Save")
# Add new group
config.add_group() # Group D
# Remove group with name "New Group Name"
config.groups[1].remove()
# Rename Group A
config.groups[0].name = "First Group"