Convert lettuce video tests specifically using youtube stub - #3492
Conversation
There was a problem hiding this comment.
It seems to me you shouldn't need time.sleep() since self.navigate_to_video calls self.video.wait_for_video_player_render(). What is the reasoning for using this? I may be misinterpreting.
There was a problem hiding this comment.
There is a timeout We wait a bit and see if YouTube responds. If not, then the switching to HTML5 happens. So that's 1.5 seconds. We wait for 3 second in the test to be completely sure that the switching finished.
There was a problem hiding this comment.
There was a problem hiding this comment.
This function should be taking care of waiting for the video to load so that we don't need to rely on time.sleep in the test.
There was a problem hiding this comment.
@muhammad-ammar Yes, it should works well without time.sleep(3.0). _wait_for_element, that is used inside wait_for_video_player_render, will wait for this 3 seconds under the hood (EmptyPromise(...,timeout=200).fulfill()).
|
Please add to this PR the changes to video.feature that will remove the equivalent lettuce tests. |
There was a problem hiding this comment.
Scenario: Video is rendered in Youtube mode when the YouTube Server responds quickly
|
@olmar please review this PR. |
There was a problem hiding this comment.
is it possible to import and use VIDEO_SOURCE_PORT and YOUTUBE_STUB_PORT values from settings?
like here
There was a problem hiding this comment.
As per my understanding its not possible.
|
👍 |
There was a problem hiding this comment.
self.youtube_configuration.update({
'time_to_response': 2.0,
'youtube_api_blocked': True,
});|
I left 2 small comments. Anyway, it looks good to merge 👍 . |
…ests Convert lettuce video tests specifically using youtube stub
No description provided.