Beispiel #1
0
        public void VideoOtherValidations(string Title)
        {
            myManager.ActiveBrowser.NavigateTo(_Url + "/video-center/#/");
            Thread.Sleep(5000);
            myManager.ActiveBrowser.WaitUntilReady();
            myManager.ActiveBrowser.RefreshDomTree();

            ObjVideo objNewVideo = new ObjVideo(myManager);

            //Chnage filer to norsk
            HtmlDiv CountryDropDown = objNewVideo.CountryDropdown.As <HtmlDiv>();

            CountryDropDown.MouseClick();
            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();
            HtmlDiv SelectedCountry = objNewVideo.SelectedCountry.As <HtmlDiv>();

            SelectedCountry.MouseClick();

            //Searchfor the video
            myManager.ActiveBrowser.Actions.SetText(objNewVideo.SearchField, Title);
            myManager.ActiveBrowser.Actions.Click(objNewVideo.SearchButton);
            Thread.Sleep(5000);
            myManager.ActiveBrowser.RefreshDomTree();

            //Verify the first result
            HtmlAnchor FirstSearchResult = objNewVideo.FirstSearchResult.As <HtmlAnchor>();

            Assert.AreEqual(Title, FirstSearchResult.InnerText);
        }
Beispiel #2
0
        public void PostComment(string Comment)
        {
            ObjVideo objNewVideo = new ObjVideo(myManager);

            Thread.Sleep(5000);
            myManager.ActiveBrowser.WaitUntilReady();
            myManager.ActiveBrowser.RefreshDomTree();

            myManager.ActiveBrowser.Actions.SetText(objNewVideo.CommentTextArea, Comment);
            myManager.ActiveBrowser.Actions.Click(objNewVideo.SendComment);

            CommonFunctions.ActivityStreamCommentsValidator(myManager, myManager.ActiveBrowser, _Url, _VideoComment, _Club);
        }
Beispiel #3
0
        public void TestMethod_Video()
        {
            string navigateURL;

            ReadData();

            //Login to the system ---------------------
            myManager.ActiveBrowser.NavigateTo(_Url);
            CommonFunctions.HandleSpashScreen(myManager, myManager.ActiveBrowser);
            myManager.ActiveBrowser.WaitUntilReady();
            myManager.ActiveBrowser.RefreshDomTree();
            CommonFunctions.Login(myManager, myManager.ActiveBrowser, _Uname, _Password);
            Thread.Sleep(7000);
            //----------- End reagon

            //Navigate to Video Center-----------------------
            navigateURL = _Url + "/video-center/#/";
            myManager.ActiveBrowser.NavigateTo(navigateURL);
            Thread.Sleep(5000);
            myManager.ActiveBrowser.WaitUntilReady();
            myManager.ActiveBrowser.RefreshDomTree();
            //----------- End reagon

            //Add New Video
            ObjVideo objNewVideo = new ObjVideo(myManager);

            myManager.ActiveBrowser.Actions.Click(objNewVideo.UploadButton);
            Thread.Sleep(5000);
            myManager.ActiveBrowser.WaitUntilReady();
            myManager.ActiveBrowser.RefreshDomTree();


            //ClcikOn UploadVideoDialog
            //Add a Video
            var x = new ArtOfTest.WebAii.Win32.Dialogs.FileUploadDialog(myManager.ActiveBrowser, @"C:\Images\BMW.mp4", DialogButton.OPEN);

            myManager.DialogMonitor.Start();
            myManager.DialogMonitor.AddDialog(x);
            HtmlInputFile choose = myManager.ActiveBrowser.Find.ById <HtmlInputFile>("fuVideo");

            choose.Click();
            x.WaitUntilHandled(10000);
            //Sometimes the frame takes little time to show up
            Thread.Sleep(5000);
            //----------- End reagon

            //ClcikOn UploadImageDialog
            //Add a picture
            var xi = new ArtOfTest.WebAii.Win32.Dialogs.FileUploadDialog(myManager.ActiveBrowser, @"C:\Images\918.jpg", DialogButton.OPEN);

            myManager.DialogMonitor.Start();
            myManager.DialogMonitor.AddDialog(xi);
            HtmlInputFile chooseImage = myManager.ActiveBrowser.Find.ById <HtmlInputFile>("ctl00_plhFullWidthContentArea_ucNewVideo_puNewVideo_fuPreviewFrame");

            chooseImage.Click();
            xi.WaitUntilHandled(10000);
            //Sometimes the frame takes little time to show up
            Thread.Sleep(5000);
            //----------- End reagon

            //Addigng description
            ArtOfTest.WebAii.Core.Browser t1_frame = myManager.ActiveBrowser.Frames[0];
            Element TextEditor = t1_frame.Find.ByXPath("/html/body");

            myManager.ActiveBrowser.Actions.SetText(TextEditor, _VideoDescription);


            myManager.ActiveBrowser.Actions.SetText(objNewVideo.VIdeoTitle, _VideoTitle);

            switch (_Club.ToUpper())
            {
            case "CUSTOMER":
                myManager.ActiveBrowser.Actions.Check(objNewVideo.CustomerCheckBox, true);
                break;

            case "DEVELOPER":
                myManager.ActiveBrowser.Actions.Check(objNewVideo.DeveloperCheckBox, true);
                break;

            case "TECHNICAL":
                myManager.ActiveBrowser.Actions.Check(objNewVideo.TechnicalCheckBox, true);
                break;

            case "PARLIAMENT":
                myManager.ActiveBrowser.Actions.Check(objNewVideo.ParliamentCheckBox, true);
                break;

            default:
                myManager.ActiveBrowser.Actions.Check(objNewVideo.CustomerCheckBox, true);
                break;
            }

            myManager.ActiveBrowser.Actions.SelectDropDown(objNewVideo.LanguageDropdown, _VideoLanguage);

            myManager.ActiveBrowser.Actions.SetText(objNewVideo.VideoTag, _VideoTag);

            myManager.ActiveBrowser.Actions.Click(objNewVideo.Save);

            Thread.Sleep(5000);

            //Validate Activity stream
            CommonFunctions.ValideActivityStream(myManager, myManager.ActiveBrowser, _Url, _VideoTitle, _Club);

            Assert.AreEqual(VerifcationPlayVideo(), true, "Video is not playable");

            PostComment(_VideoComment);

            //VideoOtherValidations(_VideoTitle);
        }