'Scenario: Multiple videos with bumper in sequentials all load and work, switching between sequentials
Given it has videos "A,B" in "Youtube" and "HTML5" modes in position "1" of sequential
And video "C" in "Youtube" mode in position "2" of sequential
When I open sequential position "1"
Then I see video "B" has a poster
When I click on it
Then I see video bumper is playing
When I skip the bumper
Then I see the main video
When I click on video "A"
Then the main video starts playing
When I open sequential position "2"
And click on the poster
Then the main video starts playing
Then I see that the main video starts playing once I go back to position "2" of sequential
When I reload the page
Then I see that the main video starts playing when I click on the poster'

def test_video_bumper_render(self):

    additional_data = {u'video_bumper': {u'value': {'transcripts': {}, 'video_id': 'video_001'}}}
    self.contents_of_verticals = [[{'display_name': 'A'}, {'display_name': 'B', 'metadata': self.metadata_for_mode('html5')}], [{'display_name': 'C'}]]
    tab1_video_names = ['A', 'B']
    tab2_video_names = ['C']
    def execute_video_steps(video_names):
        '\n                                                Execute    video    steps\n                                                '
        for video_name in video_names:
            self.video.use_video(video_name)
            self.assertTrue(self.video.is_poster_shown)
            self.video.click_on_poster()
            self.video.wait_for_video_player_render(autoplay=True)
            self.assertIn(self.video.state, ['playing', 'buffering', 'finished'])
    self.course_fixture.add_advanced_settings(additional_data)
    self.navigate_to_video_no_render()
    self.video.use_video('B')
    self.assertTrue(self.video.is_poster_shown)
    self.video.click_on_poster()
    self.video.wait_for_video_bumper_render()
    self.assertIn(self.video.state, ['playing', 'buffering', 'finished'])
    self.video.click_player_button('skip_bumper')
    self.video.wait_for_video_player_render()
    self.assertIn(self.video.state, ['playing', 'buffering', 'finished'])
    self.video.use_video('A')
    execute_video_steps(['A'])
    self.courseware_page.go_to_sequential_position(2)
    execute_video_steps(tab2_video_names)
    self.courseware_page.go_to_sequential_position(1)
    execute_video_steps(tab1_video_names)
    self.video.browser.refresh()
    execute_video_steps(tab1_video_names)
