Good response, Mr. “P” !
Everything Mr. “P” said is generally good advice. Providing a special test video with slow frames as he suggested could simplify your testing (they wouldn’t need to be as slow as 5 seconds each, but the basic idea is a good one). But if you can’t control the video, here’s another idea, using dynamically captured images:
To tell that a video is playing, have your script capture an image of the video playback region, then look for that image a moment later and verify that it’s no longer showing in that region of the screen. The script to do this might look something like this:
set videoRegion to (imageLocation("videoTopLeft"), imageLocation("videoBottomRight"))
set videoImagePath to "/tmp/videoImage.tiff"
-- capture an image of the playing video:
captureScreen (rectangle:videoRegion, name:videoImagePath)
-- wait briefly and check that the video region looks different:
wait 1/4 second
if imageFound(0,(image:videoImagePath, searchRectangle:videoRegion))
logWarning "Video doesn't seem to be playing"
end if
You could repeat this a few times to verify that the video continues to play, if you like.
To test the pause button, you could click “Pause”, then capture the paused video image and verify that you can find it again.
Dynamically capturing images in your script and then searching for them isn’t a technique that’s needed very often in Eggplant, but for situations like this it can be very useful.