From e76b24373c7121bd2eb7ba7f934ea45e98eca01b Mon Sep 17 00:00:00 2001 From: Muddasser Date: Tue, 26 Apr 2016 16:15:30 +0500 Subject: [PATCH] branch out at assert based on chrome and firefox --- .../tests/video/test_video_module.py | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/common/test/acceptance/tests/video/test_video_module.py b/common/test/acceptance/tests/video/test_video_module.py index 2eb45d3bc9..33ba38f32e 100644 --- a/common/test/acceptance/tests/video/test_video_module.py +++ b/common/test/acceptance/tests/video/test_video_module.py @@ -1220,12 +1220,22 @@ class DragAndDropTest(VideoBaseTest): captions_start = captions.location action.drag_and_drop_by_offset(captions, 0, -15).perform() + captions_end = captions.location - self.assertEqual( - captions_end.get('y') + 15, - captions_start.get('y'), - 'Closed captions did not get dragged.' - ) + # We have to branch here due to unexpected behaviour of chrome. + # Chrome sets the y offset of element to 834 instead of 650 + if self.browser.name == 'chrome': + self.assertEqual( + captions_end.get('y') - 168, + captions_start.get('y'), + 'Closed captions did not get dragged.' + ) + else: + self.assertEqual( + captions_end.get('y') + 15, + captions_start.get('y'), + 'Closed captions did not get dragged.' + ) @attr('a11y')