Exemple #1
0
        public string CreatePost()
        {
            EchoPage   echoPage   = new EchoPage(_browser);
            EditorPage editorPage = echoPage.ClickOnEditorBtn();

            ArticleBase articleBase = editorPage.ClickOnArticle();

            articleBase.WriteTitle(_title);
            articleBase.SearchImage("cats");
            CropImagePopUp cropImagePopUp = articleBase.DragImage(0);

            cropImagePopUp.ClickOnCropImageBtn();
            cropImagePopUp.ClickOnEditokBtn();
            articleBase.WriteDec(CreateRendomText());
            _browser.BrowserHelper.WaitUntillTrue(() =>
            {
                _browserHelper.WaitUntillTrue(() => {
                    articleBase.WriteTags(new BsonArray(new List <string>()
                    {
                        "Atest", "BTest", "CTest"
                    }));
                    return(articleBase.GetTagsValue().Count >= 3);
                });

                return(articleBase.GetTagsValue().Count > 0);
            }, "Failed to add tags");
            PreviewPage previewPage = articleBase.ClickOnPreviewBtn();
            PostPage    postPage    = previewPage.ClickOnPublishBtn();

            return(_title);
        }
Exemple #2
0
            public void Editor_Article_FullFlow()
            {
                Auth0LoginPage loginPage    = new Auth0LoginPage(_browser);
                NewsRoomPage   newsRoomPage = loginPage.LoginNewsRoom(_config.ConfigObject.Users.AdminUser);
                EditorPage     editorPage   = newsRoomPage.ClickOnEditorBtn();
                BsonArray      tagExValue   = _params["Tags"].AsBsonArray;
                string         body         = _params["Body"].ToString();
                ArticleBase    articleBase  = editorPage.ClickOnArticle();

                articleBase.WriteTitle("VIDEO:test article template");
                articleBase.SearchImage("cats");
                CropImagePopUp cropImagePopUp = articleBase.DragImage(0);

                cropImagePopUp.ClickOnCropImageBtn();
                cropImagePopUp.ClickOnEditokBtn();
                articleBase.WriteDec(body);
                articleBase.WriteTags(tagExValue);
                PreviewPage previewPage = articleBase.ClickOnPreviewBtn();
                PostPage    postPage    = previewPage.ClickOnPublishBtn();

                Assert.True(postPage.ValidatePostCreated("VIDEO:test article template"));
                var errors = postPage.ValidateComponents(_params["Components"].AsBsonArray);

                Assert.True(string.IsNullOrEmpty(errors), errors);
            }
Exemple #3
0
            public void PostPage_ValidateUiComponentsExistOnPage()
            {
                var       postTitle  = "VIDEO:Test post article";
                BsonArray components = _params["Components"].AsBsonArray;

                _browser.Navigate(_config.Url);
                HomePage            homePage            = new HomePage(_browser);
                FaceBookconnectPage faceBookconnectPage = homePage.ClickOnConnectBtn();
                HomePage            homePageConnected   = faceBookconnectPage.Login(_config.ConfigObject.Users.AdminUser);

                homePageConnected.ValidateUserProfilePic();
                EditorPage  editorPage  = homePageConnected.ClickOnAddArticle();
                ArticleBase articleBase = editorPage.ClickOnArticle();

                articleBase.ClickOnMagicStick(2);
                articleBase.WriteTitle(postTitle);
                PreviewPage previewPage = articleBase.ClickOnPreviewBtn();

                _browser.ProxyApi.NewHar();
                PostPage postPage = previewPage.ClickOnPublishBtn();
                var      postId   = postPage.GetPostId();
                var      errors   = postPage.ValidateComponents(components);

                Assert.True(string.IsNullOrEmpty(errors), errors);

                var counterRequest = _browser.ProxyApi.GetRequests().Where(r => r.Url.Contains("counter") && r.Url.Contains("reads") && r.Url.Contains(postId));

                Assert.True(counterRequest.Count() != 0, "A request to counter reads service was not sent.");
            }
Exemple #4
0
            public void Editor_Article_ValidatePlayBuzzComponenet()
            {
                _browser.Navigate(_config.Url);
                HomePage homePage = new HomePage(_browser);

                homePage.Login(_config.ConfigObject.Users.AdminUser);
                EditorPage  editorPage  = homePage.ClickOnAddArticle();
                ArticleBase articleBase = editorPage.ClickOnArticle();

                articleBase.ClickOnPlayBuzzCBX();
                articleBase.SetPlayBuzzURL("http://www.playbuzz.com/meliak10/when-and-where-in-time-should-you-live");
            }
Exemple #5
0
            public void ArticleValidateInputFields()
            {
                HomePage            homePage            = new HomePage(_browser);
                FaceBookconnectPage faceBookconnectPage = homePage.ClickOnConnectBtn();
                HomePage            homePageConnected   = faceBookconnectPage.Login(_config.ConfigObject.Users.AdminUser);

                homePageConnected.ValidateUserProfilePic();
                EditorPage  editorPage  = homePageConnected.ClickOnAddArticle();
                ArticleBase articleBase = editorPage.ClickOnArticle();

                var errors = articleBase.ValidateFildes();

                Assert.IsTrue(errors == "", errors);
            }
Exemple #6
0
            public void ValidateBodyTextfieled()
            {
                var bodyExValue = _params["bodyExValue"].ToString();

                HomePage            homePage            = new HomePage(_browser);
                FaceBookconnectPage faceBookconnectPage = homePage.ClickOnConnectBtn();
                HomePage            homePageConnected   = faceBookconnectPage.Login(_config.ConfigObject.Users.AdminUser);

                homePageConnected.ValidateUserProfilePic();
                EditorPage  editorPage  = homePageConnected.ClickOnAddArticle();
                ArticleBase articleBase = editorPage.ClickOnArticle();

                articleBase.WriteDec(bodyExValue);
                var bodyAcValue = articleBase.GetBodyValue();

                Assert.AreEqual(bodyExValue, bodyAcValue);
            }
Exemple #7
0
            public void PreviewButtonCheckEditButton()
            {
                HomePage            homePage            = new HomePage(_browser);
                FaceBookconnectPage faceBookconnectPage = homePage.ClickOnConnectBtn();
                HomePage            homePageConnected   = faceBookconnectPage.Login(_config.ConfigObject.Users.AdminUser);

                homePageConnected.ValidateUserProfilePic();
                EditorPage  editorPage  = homePageConnected.ClickOnAddArticle();
                ArticleBase articleBase = editorPage.ClickOnArticle();

                articleBase.ClickOnMagicStick(2);
                articleBase.WriteTitle("VIDEO:Title Title Title");
                PreviewPage previewPage     = articleBase.ClickOnPreviewBtn();
                ArticleBase articleBaseEdit = previewPage.ClickOnEditButton();

                Assert.IsTrue(articleBaseEdit.ValidateEditMode());
            }
Exemple #8
0
            public void DragAndDropAcoverImage()
            {
                HomePage            homePage            = new HomePage(_browser);
                FaceBookconnectPage faceBookconnectPage = homePage.ClickOnConnectBtn();
                HomePage            homePageConnected   = faceBookconnectPage.Login(_config.ConfigObject.Users.AdminUser);

                homePageConnected.ValidateUserProfilePic();
                EditorPage     editorPage     = homePageConnected.ClickOnAddArticle();
                ArticleBase    articleBase    = editorPage.ClickOnArticle();
                CropImagePopUp cropImagePopUp = articleBase.DragImage(0);

                cropImagePopUp.ClickOnCropImageBtn();
                cropImagePopUp.ClickOnEditokBtn();

                Assert.IsTrue(articleBase.ValidateContainerImage(), "Container image was not exsists on image fieled after dragging.");
                Assert.IsTrue(articleBase.ValidateDeleteButtonCoverimage(), "Delete button on cover image was not exsist.");
            }
Exemple #9
0
            public void ValidateTagsTextBoxSugestionsTags()
            {
                string shortTag = _params["ShortTag"].ToString();
                string tag      = _params["Tag"].ToString();

                HomePage            homePage            = new HomePage(_browser);
                FaceBookconnectPage faceBookconnectPage = homePage.ClickOnConnectBtn();
                HomePage            homePageConnected   = faceBookconnectPage.Login(_config.ConfigObject.Users.AdminUser);

                homePageConnected.ValidateUserProfilePic();
                EditorPage  editorPage  = homePageConnected.ClickOnAddArticle();
                ArticleBase articleBase = editorPage.ClickOnArticle();

                articleBase.WriteShortTags(shortTag);

                Assert.True(articleBase.ValidateAutoComplete(tag), $"Expected Tag {tag} was not shown on the suggestions.");
            }
Exemple #10
0
            public void PublishButton()
            {
                var                 postTitle           = "VIDEO:Test post article";
                HomePage            homePage            = new HomePage(_browser);
                FaceBookconnectPage faceBookconnectPage = homePage.ClickOnConnectBtn();
                HomePage            homePageConnected   = faceBookconnectPage.Login(_config.ConfigObject.Users.AdminUser);

                homePageConnected.ValidateUserProfilePic();
                EditorPage  editorPage  = homePageConnected.ClickOnAddArticle();
                ArticleBase articleBase = editorPage.ClickOnArticle();

                articleBase.ClickOnMagicStick(2);
                articleBase.WriteTitle(postTitle);
                PreviewPage previewPage = articleBase.ClickOnPreviewBtn();
                PostPage    postPage    = previewPage.ClickOnPublishBtn();

                Assert.IsTrue(postPage.ValidatePostCreated(postTitle));
            }
Exemple #11
0
            public void ImageSearchValidateMaxSearchResultsAndContent()
            {
                int    maxResults = _params["MaxResults"].ToInt32();
                string search     = _params["Search"].ToString();

                HomePage            homePage            = new HomePage(_browser);
                FaceBookconnectPage faceBookconnectPage = homePage.ClickOnConnectBtn();
                HomePage            homePageConnected   = faceBookconnectPage.Login(_config.ConfigObject.Users.AdminUser);

                homePageConnected.ValidateUserProfilePic();
                EditorPage  editorPage  = homePageConnected.ClickOnAddArticle();
                ArticleBase articleBase = editorPage.ClickOnArticle();

                articleBase.SearchImage(search);

                Assert.AreEqual(articleBase.ValidateImageSearchResults(maxResults), maxResults);
                Assert.True(articleBase.ValidateImageContenet(search), "Results weren't related to the srearch");
            }
Exemple #12
0
            public void Editor_Article_ValidateTitleTextfieled()
            {
                var titleExValue = _params["titleExValue"].ToString();

                _browser.Navigate(_config.Url);
                HomePage            homePage            = new HomePage(_browser);
                FaceBookconnectPage faceBookconnectPage = homePage.ClickOnConnectBtn();
                HomePage            homePageConnected   = faceBookconnectPage.Login(_config.ConfigObject.Users.AdminUser);

                homePageConnected.ValidateUserProfilePic();
                EditorPage  editorPage  = homePageConnected.ClickOnAddArticle();
                ArticleBase articleBase = editorPage.ClickOnArticle();

                articleBase.WriteTitle(titleExValue);
                var titleAcValue = articleBase.GetTitleValue();

                Assert.AreEqual(titleExValue, titleAcValue);
            }
Exemple #13
0
            public void EI_Article_FullFlow()
            {
                _browser.Navigate(_config.Url + "/management");
                Auth0LoginPage loginPage      = new Auth0LoginPage(_browser);
                ManagementPage managementPage = loginPage.LoginEI(_config.ConfigObject.Users.AdminUser);

                managementPage.ClickOnEditorButton();
                EditorPage editorPage = new EditorPage(_browser);

                editorPage.ClickOnArticle();
                ArticleBase articleBase = new ArticleBase(_browser);

                articleBase.FillArticleTemplate();
                PostPage postPage = new PostPage(_browser);

                postPage.ValidateComponents(new BsonArray {
                    ".logo-img", ".post-cover__media img", ".post-article__post-title__title", ".post-content", ".post-side-content", "transfer-news--container", ".post-side-content__external-widget.external-widget.external-widget--taboola", ".post-metadata", ".reactions__list", ".share-component--post-cover", ".share-component--post-bottom", ".trc_rbox.thumbnails-b.trc-content-sponsored", ".post-after .trc-content-sponsored", ".user-menu__link", ".edition-component.has-dropdown", ".new-article", ".main-sidenav-toggle", "#site-header"
                });
            }
Exemple #14
0
            public void ValidateTagsTextBoxInsertSingleTag()
            {
                BsonArray tagExValue = _params["Tag"].AsBsonArray;

                HomePage            homePage            = new HomePage(_browser);
                FaceBookconnectPage faceBookconnectPage = homePage.ClickOnConnectBtn();
                HomePage            homePageConnected   = faceBookconnectPage.Login(_config.ConfigObject.Users.AdminUser);

                homePageConnected.ValidateUserProfilePic();
                EditorPage  editorPage  = homePageConnected.ClickOnAddArticle();
                ArticleBase articleBase = editorPage.ClickOnArticle();

                articleBase.WriteTags(tagExValue);
                articleBase.ClickOnMagicStick(2);
                articleBase.WriteTitle("VIDEO:Title Title Title");
                PreviewPage previewPage = articleBase.ClickOnPreviewBtn();
                PostPage    postPage    = previewPage.ClickOnPublishBtn();
                string      errors      = postPage.ValidateTagsOnSourcePage(tagExValue);

                Assert.IsTrue(string.IsNullOrEmpty(errors), errors);
            }
Exemple #15
0
            public void ValidateUiComponentsExistOnPage()
            {
                var       postTitle  = "VIDEO:Test post article";
                BsonArray components = _params["Components"].AsBsonArray;

                HomePage            homePage            = new HomePage(_browser);
                FaceBookconnectPage faceBookconnectPage = homePage.ClickOnConnectBtn();
                HomePage            homePageConnected   = faceBookconnectPage.Login(_config.ConfigObject.Users.AdminUser);

                homePageConnected.ValidateUserProfilePic();
                EditorPage  editorPage  = homePageConnected.ClickOnAddArticle();
                ArticleBase articleBase = editorPage.ClickOnArticle();

                articleBase.ClickOnMagicStick(2);
                articleBase.WriteTitle(postTitle);
                PreviewPage previewPage = articleBase.ClickOnPreviewBtn();
                PostPage    postPage    = previewPage.ClickOnPublishBtn();

                var errors = postPage.ValidateComponents(components);

                Assert.True(string.IsNullOrEmpty(errors), errors);
            }