'Scenario: Check input error messages
Given I have created a Video component
Entering "123.webm" and "456.webm" source to field number 1 and 2 respectively should disable field 1 and 3
Then I see error message "Link types should be unique."
When I clear fields, input fields should be enabled
And I enter a "http://link.c" source to field number 1 should disable fields 2 and 3
Then I see error message "Incorrect url format."
Entering "http://goo.gl/pxxZrg" source to both field number 1 and 2 should disable fields 1 and 3
Then I see error message "Links should be unique."
When I clear fields, input fields should be enabled
And I enter a "http://youtu.be/t_not_exist" source to field number 1
Then I do not see error message
And I expect inputs are enabled'

def test_input_validation(self):

    self._create_video_component()
    self.edit_component()
    self.video.set_url_field('123.webm', 1)
    self.video.set_url_field('456.webm', 2)
    self.assertEqual(self.video.message('error'), 'Link    types    should    be    unique.')
    self.assertEqual(self.video.url_field_status(1, 3).values(), [False, False])
    self.video.clear_fields()
    self.assertEqual(self.video.url_field_status().values(), [True, True, True])
    self.video.set_url_field('http://link.c', 1)
    self.assertEqual(self.video.message('error'), 'Incorrect    url    format.')
    self.assertEqual(self.video.url_field_status(2, 3).values(), [False, False])
    self.video.set_url_field('http://goo.gl/pxxZrg', 1)
    self.video.set_url_field('http://goo.gl/pxxZrg', 2)
    self.assertEqual(self.video.message('error'), 'Links    should    be    unique.')
    self.assertEqual(self.video.url_field_status(1, 3).values(), [False, False])
    self.video.clear_fields()
    self.assertEqual(self.video.url_field_status().values(), [True, True, True])
    self.video.set_url_field('http://youtu.be/t_not_exist', 1)
    self.assertEqual(self.video.message('error'), '')
    self.assertEqual(self.video.url_field_status().values(), [True, True, True])
