'Scenario: Ensure that editing of the group configuration can be canceled correctly.
Given I have a course with group configuration
When I go to the edit mode of the group configuration
And I set new name and description, add 2 additional groups
And I click button \'Cancel\'
Then I see that new changes were discarded'

def test_can_cancel_editing_of_group_configuration(self):

    self.course_fixture._update_xblock(self.course_fixture._course_location, {'metadata': {u'user_partitions': [create_user_partition_json(0, 'Name    of    the    Group    Configuration', 'Description    of    the    group    configuration.', [Group('0', 'Group    0'), Group('1', 'Group    1')]), create_user_partition_json(1, 'Name    of    second    Group    Configuration', 'Second    group    configuration.', [Group('0', 'Alpha'), Group('1', 'Beta'), Group('2', 'Gamma')])]}})
    self.page.visit()
    config = self.page.experiment_group_configurations[0]
    config.name = 'New    Group    Configuration    Name'
    config.description = 'New    Description    of    the    group    configuration.'
    config.add_group()
    config.add_group()
    config.cancel()
    self._assert_fields(config, name='Name    of    the    Group    Configuration', description='Description    of    the    group    configuration.', groups=['Group    0', 'Group    1'])
