Are you adding this code to your target page and trying to call it from your FuncUnit tests? I would probably just create this function in your test since it is only used there.
- var playVideo = function(selector){
- var video = S(selector);
- video[0].play();
- }
- test("Play video", function () {
- playVideo('#myVideo')
- });
You can access the target window with S.win. So if this method is defined in the target page you could call it like this:
But like I said, if this is a function used only in testing, it's probably best to keep it in your test files.