예제 #1
0
        public override void Execute()
        {
            //Select Video file to be played
            StartStep();

            bool res2 = CL.EA.UI.Utils.EPG_Milestones_SelectMenuItem("Video");

            if (!res2)
            {
                FailStep(CL, "Failed to navigate to Videos");
            }
            CL.EA.UI.Utils.SendIR("SELECT");


            res2 = CL.EA.UI.Utils.EPG_Milestones_SelectMenuItem("All Videos");
            CL.EA.UI.Utils.SendIR("SELECT");
            if (!res2)
            {
                FailStep(CL, "Failed to navigate to All Videos");
            }


            string CurrentVideoFile;
            string FirstVideoFile;
            string timeStamp = "";

            res = CL.IEX.IR.SendIR("SELECT_DOWN", out timeStamp, 3);
            if (!res.CommandSucceeded)
            {
                FailStep(CL, res, "Failed to Send IR Key SELECT_DOWN");
            }
            CL.IEX.Wait(3);

            res = CL.IEX.MilestonesEPG.GetEPGInfo("title", out FirstVideoFile);
            if (!res.CommandSucceeded)
            {
                FailStep(CL, res, "Failed to Get video file Name");
            }

            if (!VideoFile.Equals(FirstVideoFile))
            {
                do
                {
                    CL.IEX.Wait(3);
                    res = CL.IEX.IR.SendIR("SELECT_UP", out timeStamp, 3);
                    if (!res.CommandSucceeded)
                    {
                        FailStep(CL, res, "Failed to Send IR Key SELECT_UP");
                    }
                    CL.IEX.Wait(3);

                    res = CL.IEX.MilestonesEPG.GetEPGInfo("title", out CurrentVideoFile);
                    if (!res.CommandSucceeded)
                    {
                        FailStep(CL, res, "Failed to Get video file Name");
                    }

                    if (VideoFile.Equals(CurrentVideoFile))
                    {
                        break;
                    }
                } while (!CurrentVideoFile.Equals(FirstVideoFile));
            }

            //Verify if the item is of type video content
            string videoContent = "";

            res = CL.IEX.MilestonesEPG.GetEPGInfo("object", out videoContent);
            if (!res.CommandSucceeded)
            {
                FailStep(CL, res, "Failed to Get video content");
            }

            if (videoContent != "[object VideoContent]")
            {
                FailStep(CL, "Not an video content");
            }


            //Verify is the item is playable
            string isPlayable = "";

            res = CL.IEX.MilestonesEPG.GetEPGInfo("isPlayable", out isPlayable);
            if (!res.CommandSucceeded)
            {
                FailStep(CL, res, "Failed to Get isPlayable");
            }

            if (isPlayable != "true")
            {
                FailStep(CL, "Content is not playable");
            }

            //Select the item
            CL.IEX.Wait(3);
            res = CL.IEX.IR.SendIR("SELECT", out timeStamp, 3);
            if (!res.CommandSucceeded)
            {
                FailStep(CL, res, "Failed to Send IR Key SELECT");
            }

            PassStep();
        }