'Test if we can move a component of content experiment successfully.
Given that I am a staff user
And I go to content experiment page
And I open the move dialogue modal
When I navigate to the unit in second section
Then I see move button is enabled
And when I click on the move button
Then I see move operation success message
And when I click on take me there link
Then I see moved component there
And when I undo move a component
Then I see that undo move operation success message'

def test_content_experiment(self):

    self.course_fixture.add_advanced_settings({u'advanced_modules': {'value': ['split_test']}})
    self.course_fixture._update_xblock(self.course_fixture._course_location, {'metadata': {u'user_partitions': [create_user_partition_json(0, 'Test    Group    Configuration', 'Description    of    the    group    configuration.', [Group('0', 'Group    A'), Group('1', 'Group    B')])]}})
    split_test = XBlockFixtureDesc('split_test', 'Test    Content    Experiment', metadata={'user_partition_id': 0})
    self.course_fixture.create_xblock(self.unit_page1.locator, split_test)
    unit_page = ContainerPage(self.browser, split_test.locator)
    unit_page.visit()
    group_a_locator = unit_page.displayed_children[0].locator
    self.course_fixture.create_xblock(group_a_locator, XBlockFixtureDesc('html', 'HTML    311'))
    self.course_fixture.create_xblock(group_a_locator, XBlockFixtureDesc('html', 'HTML    312'))
    group_container_page = ContainerPage(self.browser, group_a_locator)
    group_container_page.visit()
    components = group_container_page.displayed_children
    self.assertEqual(len(components), 2)
    self.source_component_display_name = 'HTML    311'
    self.verify_move_opertions(unit_page=group_container_page, source_component=components[0], operation='undo_move', component_display_names_after_operation=['HTML    311', 'HTML    312'], should_verify_publish_title=False)
    self.verify_move_opertions(unit_page=group_container_page, source_component=components[0], operation='move', component_display_names_after_operation=['HTML    21', 'HTML    22', 'HTML    311'], should_verify_publish_title=False)
