Example #1
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);
        }
        public void TestMethod_BlogCustomer()
        {
            //Read the datasheet
            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);

            //Navigate to blogs
            string navigateURL;

            navigateURL = _Url + "/home-blogs/";
            Thread.Sleep(5000);
            myManager.ActiveBrowser.WaitUntilReady();
            myManager.ActiveBrowser.RefreshDomTree();

            //AddNewBlog
            NewBlogCommon objNewBlog = new NewBlogCommon();

            objNewBlog.CreateNewBlog(navigateURL, myManager.ActiveBrowser, myManager, _BlogTitle, _BlogDescription, _Club, _BlogTag);

            //Validate the blog in Activity stream
            CommonFunctions.ValideActivityStream(myManager, myManager.ActiveBrowser, _Url, _BlogTitle, _Club);
            //Validate the blog in blog page
            CommonFunctions.ValidateBlog(myManager, _BlogTitle);

            //addcomment
            objNewBlog.addcomment(myManager.ActiveBrowser, myManager, _BlogComment);
            //validate comment
            CommonFunctions.ActivityStreamCommentsValidator(myManager, myManager.ActiveBrowser, _Url, _BlogComment, _Club);

            //Logout
            CommonFunctions.Logout(myManager, myManager.ActiveBrowser);
            ObjLoginLanguage login = new ObjLoginLanguage(myManager);

            login.loginLink.Wait.ForExists(5000);

            //myManager.Dispose();
        }
        public void TestMethod_BlogParliament()
        {
            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 parliament blog -----------------------
            navigateURL = _Url + "/the-parliament/";
            myManager.ActiveBrowser.NavigateTo(navigateURL);
            Thread.Sleep(5000);
            myManager.ActiveBrowser.WaitUntilReady();
            myManager.ActiveBrowser.RefreshDomTree();
            //----------- End reagon

            //Add new Blog
            CreateBlog objNewblog = new CreateBlog(myManager);

            myManager.ActiveBrowser.Actions.Click(objNewblog.TPnewblog);
            Thread.Sleep(5000);
            myManager.ActiveBrowser.WaitUntilReady();
            myManager.ActiveBrowser.RefreshDomTree();

            myManager.ActiveBrowser.Actions.SetText(objNewblog.TPBlogTitle, _BlogTitle);

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

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

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


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

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

            //This functionality is temporalyremoved will be implemented in the future
            //--------------------------------------------------------------------------
            //myManager.ActiveBrowser.Actions.Check(objNewblog.TPfrontpagenews, _FrontPageNews);
            //myManager.ActiveBrowser.Actions.Click(objNewblog.TPdisplayuntill);
            //myManager.ActiveBrowser.Actions.SetText(objNewblog.TPdisplayuntill, _displayUntill);
            //myManager.ActiveBrowser.Actions.Click(objNewblog.TPdisplayuntill);
            //--------------------------------------------------------------------------

            //Selecting the pulish Subsidiary
            if (_Subsidiary != "")
            {
                selectSubsidiary(_Subsidiary);
            }
            //----------- End reagon

            //Selecting the pulish Subsidiary
            if (_areas != "")
            {
                selectArea(_areas);
            }
            Thread.Sleep(5000);
            //----------- End reagon


            //Publish or Draft
            if (_publish == true)
            {
                myManager.ActiveBrowser.Actions.Click(objNewblog.saveandPublish);
            }
            else if (_draft == true)
            {
                myManager.ActiveBrowser.Actions.Click(objNewblog.saveDraft);
            }
            else
            {
                myManager.ActiveBrowser.Actions.Click(objNewblog.saveandPublish);
            }

            Thread.Sleep(5000);
            myManager.ActiveBrowser.WaitUntilReady();
            myManager.ActiveBrowser.RefreshDomTree();
            //----------- End reagon


            TPBlogArchiveValidation(_BlogTitle);
            TPBlogvalidationCarasoel(_BlogTitle);

            Thread.Sleep(5000);
            CommonFunctions.ValideActivityStream(myManager, myManager.ActiveBrowser, _Url, _BlogTitle, "PARLIAMENT");

            //after the activity stream validation the test screen will be on the added blog

            //Adding a Comment to the blog

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

            myManager.ActiveBrowser.Actions.SetText(objNewblog.TPBlogComment, _TPBlogComment);
            myManager.ActiveBrowser.Actions.Click(objNewblog.TPBlogCommentPostButton);

            CommonFunctions.ActivityStreamCommentsValidator(myManager, myManager.ActiveBrowser, _Url, _TPBlogComment, "PARLIAMENT");
        }