- Make sure all UI elements in the player have unique ids associated with them. The bottom line is there should be someway to interact with the UI elements uniquely through your automation code. What I used to do is, once I identify different flows to automate for my Video player, I would create stories to add the required ids for the flows. The developers then used to pick up the story and add the missing ids for those UI elements in that flow.
- I was automating both Android and iOS video players. The Appium UI inspector is your best friend for knowing what ids are missing from the UI elements for both the players. It gives exact information on what ids are already present and what needs to be added. I always had the UI inspector open.
- You are going to run into this issue and I am saving you time and grief in advance. You will be tasked to automate the process of ensuring whether a stream is playing or not i.e how do you know a particular movie is playing on the player? For this, I used some simple logics.
- I will get the starting duration of the player which is 0:00 and then after 15 seconds will get the playing time duration again which would be about 0:15. Then I will do a comparison to ensure the time duration is not 0:00 still. This will to a certain extent tell me whether the movie is progressing or not
- I also had a logic where I will move the scrubber bar to the middle of the scrubber line and ensure the move still plays. For this, I get the total time duration of the movie which I can get via an id (since it is present on the screen), then I divide that in half, then I move the scrubber using its id to this time duration programmatically
We also had some config files that controls some of the aspects of the video player such as the amount of time after which the player controls will disappear from the screen after inactivity, the ability to see certain icons like Captions, Subtitles, Language etc on the screen and so on. I had a separate config file where I manipulated some of these default configs . For example - I set the time out for the player default controls to disappear to 2 mins instead of the default 5 seconds. This gave me enough time to validate various player elements in the UI when the player is first opened up.
When you run the tests in a CI/CD pipeline make sure the Jenkins machine you are using for example is connected directly to internet via an ethernet cable for more stable internet connection. Also ensure the test devices that are connected to your Jenkins machine are connected to stable Wi-Fi connection which is not spotty. This will avoid test failures due to poor internet connection.
Hopefully some of the above information helps you in your video streaming automation. Best of Luck!!!