Esempio n. 1
0
            public void Echo_ValidateEditLink()
            {
                var channelIndex = _params["ChannelIndex"].AsInt32;

                _browser.Navigate(_config.ConfigObject.Echo);
                Auth0LoginPage  loginPage       = new Auth0LoginPage(_browser);
                NewsRoomPage    newsRoomPage    = loginPage.LoginNewsRoom(_config.ConfigObject.Users.AdminUser);
                PostCreatorEcho postCreatorEcho = new PostCreatorEcho(_browser);
                string          title           = postCreatorEcho.CreatePost();
                PostPage        postPage        = new PostPage(_browser);

                _browser.SwitchToFirstTab();
                _browser.Refresh();
                EchoPage         echoPage         = new EchoPage(_browser);
                DistributionPage distributionPage = echoPage.SelectPost(title);

                distributionPage.ClickOnEditLink();
                _browser.SwitchToTab(2, 3);
                string editor      = "editor";
                string url         = _browser.GetUrl();
                var    urlSplitted = url.Split('/');
                var    parseTitle  = urlSplitted[4].Split('/');

                Assert.True(parseTitle[0].ToLower() == editor.ToLower(), $"Expected  was {editor} but actual is {parseTitle[0]}");
            }
Esempio n. 2
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);
        }
Esempio n. 3
0
            public void Echo_ValidateEditLinkInTheEchoPage()
            {
                var channelIndex = _params["ChannelIndex"].AsInt32;

                _browser.Navigate(_config.ConfigObject.Echo);
                Auth0LoginPage  loginPage       = new Auth0LoginPage(_browser);
                NewsRoomPage    newsRoomPage    = loginPage.LoginNewsRoom(_config.ConfigObject.Users.AdminUser);
                PostCreatorEcho postCreatorEcho = new PostCreatorEcho(_browser);
                string          title           = postCreatorEcho.CreatePost();
                PostPage        postPage        = new PostPage(_browser);

                _browser.SwitchToFirstTab();
                _browser.Refresh();
                EchoPage echoPage = new EchoPage(_browser);

                echoPage.ClickOnEditButtonInEcho(title);
                _browser.SwitchToTab(2, 3);
                string url         = _browser.GetUrl();
                var    urlSplitted = url.Split('/');
                var    parseTitle  = urlSplitted[4].Split('/');

                Assert.True(parseTitle[0].ToLower() == "editor", $"Expected was editor but actual is {parseTitle[0]}");

                ArticleBase article     = new ArticleBase(_browser);
                var         titleEditor = article.GetTitleValue().ToLower();

                Assert.True(titleEditor == title.ToLower(), $"Expected title was {title.ToLower()}. Actual: {titleEditor}");
            }
Esempio n. 4
0
            public void Echo_ValidateEnglishFilter()
            {
                var language        = _params["Language"].ToString();
                var languageChannel = _params["LanguageChannel"].ToString();
                var channelIndex    = _params["ChannelIndex"].AsInt32;

                _browser.Navigate(_config.ConfigObject.Echo);
                Auth0LoginPage  loginPage       = new Auth0LoginPage(_browser);
                NewsRoomPage    newsRoomPage    = loginPage.LoginNewsRoom(_config.ConfigObject.Users.AdminUser);
                EchoPage        echoPage        = new EchoPage(_browser);
                PostCreatorEcho postCreatorEcho = new PostCreatorEcho(_browser);
                string          title           = postCreatorEcho.CreatePost();
                PostPage        postPage        = new PostPage(_browser);

                _browser.SwitchToFirstTab();
                _browser.Refresh();
                echoPage = new EchoPage(_browser);
                DistributionPage distributionPage = echoPage.SelectPost(title);

                distributionPage.SelectChannelByIndex(channelIndex);
                distributionPage.ClickOnPublishBtn();
                echoPage = echoPage.ClickOnEchoBtn();
                echoPage.ClickOnLangnugeFilter();
                echoPage         = echoPage.ClickOnLanguage(language);
                distributionPage = echoPage.SelectPost(title);
                Assert.True(distributionPage.ValidateChannelLanguage(languageChannel), $"The post {title} was not in {languageChannel}");
            }
Esempio n. 5
0
            public void Echo_UnpblishPost()
            {
                var channelIndex = _params["ChannelIndex"].AsInt32;

                _browser.Navigate(_config.ConfigObject.Echo);
                Auth0LoginPage  loginPage       = new Auth0LoginPage(_browser);
                NewsRoomPage    newsRoomPage    = loginPage.LoginNewsRoom(_config.ConfigObject.Users.AdminUser);
                PostCreatorEcho postCreatorEcho = new PostCreatorEcho(_browser);
                string          title           = postCreatorEcho.CreatePost();
                PostPage        postPage        = new PostPage(_browser);

                _browser.SwitchToFirstTab();
                _browser.Refresh();
                EchoPage         echoPage         = new EchoPage(_browser);
                DistributionPage distributionPage = echoPage.SelectPost(title);

                distributionPage.SelectChannelByIndex(channelIndex);
                distributionPage.ClickOnPublishBtn();
                distributionPage.WaitForPublishedSatatus();
                distributionPage.UnpublishPost();
                _browser.Navigate(_config.Url);
                HomePage homePage = new HomePage(_browser);

                Assert.False(homePage.ValidateMoreNewsTitle(title), "The title was not appear on the grid section");
            }
Esempio n. 6
0
            public void Echo_FeaturePostToTwoCategories()
            {
                var channelIndex1 = _params["ChannelIndex1"].AsInt32;
                var channelIndex2 = _params["ChannelIndex2"].AsInt32;

                _browser.Navigate(_config.ConfigObject.Echo);
                Auth0LoginPage  loginPage       = new Auth0LoginPage(_browser);
                NewsRoomPage    newsRoomPage    = loginPage.LoginNewsRoom(_config.ConfigObject.Users.AdminUser);
                PostCreatorEcho postCreatorEcho = new PostCreatorEcho(_browser);
                string          title           = postCreatorEcho.CreatePost();
                PostPage        postPage        = new PostPage(_browser);

                _browser.SwitchToFirstTab();
                _browser.Refresh();
                EchoPage         echoPage         = new EchoPage(_browser);
                DistributionPage distributionPage = echoPage.SelectPost(title);

                distributionPage.SelectChannelByIndex(channelIndex1);
                distributionPage.SelectChannelDPOpen(channelIndex2);
                distributionPage.ClickOnPublishBtn();
                distributionPage.WaitForPublishedSatatus();
                _browser.Navigate(_config.Url);
                HomePage homePage = new HomePage(_browser);

                Assert.True(homePage.ValidateTitleApearsInGrid(title), $"Expected {title} was not found");
                Assert.True(homePage.ValidateMoreNewsTitle(title), "The title was not appear on the grid section");
            }
Esempio n. 7
0
            public void Echo_FeaturePostToCoverStory()
            {
                var channelIndex = _params["ChannelIndex"].AsInt32;

                _browser.Navigate(_config.ConfigObject.Echo);
                Auth0LoginPage  loginPage       = new Auth0LoginPage(_browser);
                NewsRoomPage    newsRoomPage    = loginPage.LoginNewsRoom(_config.ConfigObject.Users.AdminUser);
                PostCreatorEcho postCreatorEcho = new PostCreatorEcho(_browser);
                string          title           = postCreatorEcho.CreatePost();
                PostPage        postPage        = new PostPage(_browser);

                _browser.SwitchToFirstTab();
                _browser.Refresh();
                EchoPage         echoPage         = new EchoPage(_browser);
                DistributionPage distributionPage = echoPage.SelectPost(title);

                distributionPage.SelectChannelByIndex(channelIndex);
                distributionPage.ClickOnPublishBtn();
                distributionPage.WaitForPublishedSatatus();
                echoPage = distributionPage.ClickOnEchoBtn();
                _browser.OpenNewTab(_config.Url);
                HomePage homePage = new HomePage(_browser);

                Assert.True(homePage.GetCoverText() == title, $"Expected title was {title} but actual is {homePage.GetCoverText()}");
            }
Esempio n. 8
0
            public void Echo_ValidateNewSatatusFilter()
            {
                _browser.Navigate(_config.ConfigObject.Echo);
                Auth0LoginPage loginPage    = new Auth0LoginPage(_browser);
                NewsRoomPage   newsRoomPage = loginPage.LoginNewsRoom(_config.ConfigObject.Users.AdminUser);
                EchoPage       echoPage     = new EchoPage(_browser);

                echoPage.ClickOnSatusFilter();
                echoPage = echoPage.ClickOnStatus("New");
                Assert.True(echoPage.ValidateStatusses("New"), "The satatus of the post is wrong");
            }
Esempio n. 9
0
            public void Echo_ValidateLogoutLink()
            {
                _browser.Navigate(_config.ConfigObject.Echo);
                Auth0LoginPage loginPage    = new Auth0LoginPage(_browser);
                NewsRoomPage   newsRoomPage = loginPage.LoginNewsRoom(_config.ConfigObject.Users.AdminUser);
                EchoPage       echoPage     = new EchoPage(_browser);

                echoPage.ClickOnLogoutButton();
                loginPage = new Auth0LoginPage(_browser);
                Assert.True(loginPage.ValidateAuto0Page());
            }
Esempio n. 10
0
            public void Echo_ValidateStatusFilterList()
            {
                var status = _params["StatusList"].AsBsonArray;

                _browser.Navigate(_config.ConfigObject.Echo);
                Auth0LoginPage loginPage    = new Auth0LoginPage(_browser);
                NewsRoomPage   newsRoomPage = loginPage.LoginNewsRoom(_config.ConfigObject.Users.AdminUser);
                EchoPage       echoPage     = new EchoPage(_browser);

                echoPage.ClickOnSatusFilter();
                Assert.True(echoPage.ValidateStatusFilterList(status), "The status in dropdown didn't match the expected result.");
            }
Esempio n. 11
0
            public void Echo_ValidatePostCreation()
            {
                _browser.Navigate(_config.ConfigObject.Echo);
                Auth0LoginPage  loginPage       = new Auth0LoginPage(_browser);
                NewsRoomPage    newsRoomPage    = loginPage.LoginNewsRoom(_config.ConfigObject.Users.AdminUser);
                PostCreatorEcho postCreatorEcho = new PostCreatorEcho(_browser);
                string          title           = postCreatorEcho.CreatePost();

                _browser.SwitchToFirstTab();
                _browser.Refresh();
                EchoPage echoPage = new EchoPage(_browser);

                Assert.True(echoPage.ValidatePostCreation(title), $"post {title} is not shown on echo page.");
            }
Esempio n. 12
0
            public void Echo_ValidateDomain()
            {
                _browser.Navigate(_config.ConfigObject.Echo);
                Auth0LoginPage  loginPage       = new Auth0LoginPage(_browser);
                NewsRoomPage    newsRoomPage    = loginPage.LoginNewsRoom(_config.ConfigObject.Users.AdminUser);
                PostCreatorEcho postCreatorEcho = new PostCreatorEcho(_browser);
                string          title           = postCreatorEcho.CreatePost();
                PostPage        postPage        = new PostPage(_browser);

                _browser.SwitchToFirstTab();
                _browser.Refresh();
                EchoPage echoPage = new EchoPage(_browser);

                Assert.True(echoPage.ValidateDomain($"{_config.SiteName.ToLower()}.com", title), $"The domain for {title} was diffrent than expected.");
            }
Esempio n. 13
0
            public void Echo_ValidateStatusNew()
            {
                _browser.Navigate(_config.ConfigObject.Echo);
                Auth0LoginPage  loginPage       = new Auth0LoginPage(_browser);
                NewsRoomPage    newsRoomPage    = loginPage.LoginNewsRoom(_config.ConfigObject.Users.AdminUser);
                PostCreatorEcho postCreatorEcho = new PostCreatorEcho(_browser);
                string          title           = postCreatorEcho.CreatePost();
                PostPage        postPage        = new PostPage(_browser);

                _browser.SwitchToFirstTab();
                _browser.Refresh();
                EchoPage echoPage = new EchoPage(_browser);

                Assert.True(echoPage.ValidateSatatus("New", title), $"The status for {title} was diffrent then New.");
            }
Esempio n. 14
0
            public void Echo_ValidateAuthorName()
            {
                _browser.Navigate(_config.ConfigObject.Echo);
                Auth0LoginPage  loginPage       = new Auth0LoginPage(_browser);
                NewsRoomPage    newsRoomPage    = loginPage.LoginNewsRoom(_config.ConfigObject.Users.AdminUser);
                PostCreatorEcho postCreatorEcho = new PostCreatorEcho(_browser);
                string          title           = postCreatorEcho.CreatePost();
                PostPage        postPage        = new PostPage(_browser);
                string          authorName      = postPage.GetAuthorName();

                _browser.SwitchToFirstTab();
                _browser.Refresh();
                EchoPage echoPage = new EchoPage(_browser);

                Assert.True(echoPage.ValidateAuthor(authorName, title), $"The author name for {title} was diffrent than expected.");
            }
Esempio n. 15
0
            public void Echo_ValidateStatusPublished()
            {
                var channelIndex = _params["ChannelIndex"].AsInt32;

                _browser.Navigate(_config.ConfigObject.Echo);
                Auth0LoginPage  loginPage       = new Auth0LoginPage(_browser);
                NewsRoomPage    newsRoomPage    = loginPage.LoginNewsRoom(_config.ConfigObject.Users.AdminUser);
                PostCreatorEcho postCreatorEcho = new PostCreatorEcho(_browser);
                string          title           = postCreatorEcho.CreatePost();
                PostPage        postPage        = new PostPage(_browser);

                _browser.SwitchToFirstTab();
                _browser.Refresh();
                EchoPage         echoPage         = new EchoPage(_browser);
                DistributionPage distributionPage = echoPage.SelectPost(title);

                distributionPage.SelectChannelByIndex(channelIndex);
                distributionPage.ClickOnPublishBtn();
                echoPage = echoPage.ClickOnEchoBtn();
                Assert.True(echoPage.ValidateSatatus("Published", title), $"The status for {title} was diffrent then Published.");
            }
Esempio n. 16
0
            public void Echo_FeaturePostToTopStories()
            {
                var channelIndex = _params["ChannelIndex"].AsInt32;

                _browser.Navigate(_config.ConfigObject.Echo);
                Auth0LoginPage  loginPage       = new Auth0LoginPage(_browser);
                NewsRoomPage    newsRoomPage    = loginPage.LoginNewsRoom(_config.ConfigObject.Users.AdminUser);
                PostCreatorEcho postCreatorEcho = new PostCreatorEcho(_browser);
                string          title           = postCreatorEcho.CreatePost();
                PostPage        postPage        = new PostPage(_browser);

                _browser.SwitchToFirstTab();
                _browser.Refresh();
                EchoPage         echoPage         = new EchoPage(_browser);
                DistributionPage distributionPage = echoPage.SelectPost(title);

                distributionPage.SelectChannelByIndex(channelIndex);
                distributionPage.ClickOnPublishBtn();
                _browser.OpenNewTab(_config.Url);
                HomePage homePage = new HomePage(_browser);

                Assert.True(homePage.ValidateTopStoriesTitle(title), $"Expected {title} was not found");
            }
Esempio n. 17
0
            public void Echo_RepublishPostToNewAFeed()
            {
                var channelIndex1 = _params["ChannelIndex1"].AsInt32;
                var channelIndex2 = _params["ChannelIndex2"].AsInt32;

                _browser.Navigate(_config.ConfigObject.Echo);
                Auth0LoginPage  loginPage       = new Auth0LoginPage(_browser);
                NewsRoomPage    newsRoomPage    = loginPage.LoginNewsRoom(_config.ConfigObject.Users.AdminUser);
                PostCreatorEcho postCreatorEcho = new PostCreatorEcho(_browser);
                string          title           = postCreatorEcho.CreatePost();
                PostPage        postPage        = new PostPage(_browser);

                _browser.SwitchToFirstTab();
                _browser.Refresh();
                EchoPage         echoPage         = new EchoPage(_browser);
                DistributionPage distributionPage = echoPage.SelectPost(title);

                distributionPage.SelectChannelByIndex(channelIndex1);
                distributionPage.ClickOnPublishBtn();
                distributionPage.WaitForPublishedSatatus();
                _browser.OpenNewTab(_config.Url);
                HomePage homePage = new HomePage(_browser);

                Assert.True(homePage.ValidateMoreNewsTitle(title), $"Expected {title} was not found");

                _browser.SwitchToFirstTab();
                _browser.Refresh();
                echoPage = new EchoPage(_browser);
                distributionPage.ClickOnNewButton();
                distributionPage.SelectChannelByIndex(channelIndex2);
                distributionPage.ClickOnPublishBtn();
                _browser.OpenNewTab($"{_config.Url}/channels/latest");
                FeedPage feedPage = new FeedPage(_browser);

                _browser.Refresh();
                Assert.True(feedPage.ValidatePostTitleInFeedPage(title), $"Expected {title} was not found");
            }