Ejemplo n.º 1
0
            public void Castr_PnPost()
            {
                string urbanAirShipUrl = _params["Url"].ToString();
                var    user            = _params["Credentials"];

                _browser.Navigate(_config.Url);
                HomePage homePage = new HomePage(_browser);

                homePage.Login(_config.ConfigObject.Users.AdminUser);
                PostCreator postCreator = new PostCreator(_browser);

                postCreator.Create();
                CastrPage castrPage = homePage.GoToCastr();
                CastrPage newPosts  = castrPage.SelectStatus(Statuses.New);
                CastrPost post      = newPosts.ClickOnPost(postCreator.Title);

                post.SendPn(Platforms.mobile, 0);
                _browser.OpenNewTab($"{_config.Url}/management/push_notifications?test=test");
                PnDashBoardPage pnDashBoardPage = new PnDashBoardPage(_browser);

                Assert.True(pnDashBoardPage.ValidatePost(0, postCreator.Title));

                _browser.Navigate(urbanAirShipUrl);
                UrbanAirShipLoginPage urbanAirShipLoginPage = new UrbanAirShipLoginPage(_browser);

                urbanAirShipLoginPage.Login(user);
                Assert.True(urbanAirShipLoginPage.SearchPost(postCreator.Title));
            }
Ejemplo n.º 2
0
            public void Castr_FTB90_CheckIDPostsFromDiffrentDomains()
            {
                _browser.Navigate(_config.GlobalConfigObject["90Min"]["Url"].ToString());
                HomePage homePage = new HomePage(_browser);

                homePage.Login(_config.ConfigObject.Users.AdminUser);
                PostCreator postCreator = new PostCreator(_browser);

                postCreator.Create();
                var url = $"http://{_config.Env}.{_config.GlobalConfigObject["Ftb90"]["Url"]}";

                _browser.Navigate(url);
                HomePage homePageFtb = new HomePage(_browser);

                homePage.ClickOnConnectBtnWithCoockies();
                PostCreator postCreatorFtb90 = new PostCreator(_browser);
                PostPage    postPageFTb90    = postCreatorFtb90.Create(typeof(ArticleBase));
                CastrPage   castrPage        = homePageFtb.GoToCastr();
                CastrPage   newPosts         = new CastrPage(_browser);
                CastrPost   castrPostFTB90   = newPosts.ClickOnPost(postCreatorFtb90.Title);

                Assert.True(castrPostFTB90.ValidatePublishAlsoTo());
                CastrPost castrPost = newPosts.ClickOnPost(postCreator.Title);

                Assert.True(castrPostFTB90.ValidatePublishAlsoTo());
            }
Ejemplo n.º 3
0
            public void Castr_ResetAndFeatureAPost()
            {
                var feedUrl  = _params["PremierLeague"].ToString();
                var feedUrl2 = _params["ChampionLeague"].ToString();

                _browser.Navigate(_config.Url);
                HomePage homePage = new HomePage(_browser);

                homePage.Login(_config.ConfigObject.Users.AdminUser);
                PostCreator postCreator = new PostCreator(_browser);

                postCreator.Create();
                CastrPage castrPage = homePage.GoToCastr();
                CastrPage newPosts  = castrPage.SelectStatus(Statuses.New);
                CastrPost post      = newPosts.ClickOnPost(postCreator.Title);

                post.UnCheckLeague(0);
                post.PublishPostToFeed(Platforms.ftbpro, 1);
                CastrPage publishedPosts = newPosts.SelectStatus(Statuses.published);

                post = publishedPosts.ClickOnPost(postCreator.Title);
                post.ResetPost();
                newPosts = newPosts.SelectStatus(Statuses.New);
                post     = newPosts.ClickOnPost(postCreator.Title);
                post.PublishPostToFeed(Platforms.ftbpro, 0);

                _browser.Navigate($"{_config.Url}/{feedUrl}");
                FeedPage feedPage = new FeedPage(_browser);

                Assert.True(feedPage.ValidateArticleByTitle(postCreator.Title), $"Post {postCreator.Title} was not shown on {feedUrl} after it was reseted.");

                feedPage = new FeedPage(_browser);
                _browser.Navigate($"{_config.Url}/{feedUrl2}");
                Assert.True(feedPage.ValidateArticleByTitle(postCreator.Title), $"Post {postCreator.Title} was not shown on {feedUrl2} after it was reseted.");
            }
Ejemplo n.º 4
0
            public void Castr_CheckNewStatus()
            {
                _browser.Navigate(_config.Url);
                HomePage homePage = new HomePage(_browser);

                homePage.Login(_config.ConfigObject.Users.AdminUser);
                PostCreator postCreator = new PostCreator(_browser);

                postCreator.Create();
                CastrPage castrPage = homePage.GoToCastr();
                CastrPage newPosts  = castrPage.SelectStatus(Statuses.New);

                Assert.True(newPosts.SearchPostByTitle(postCreator.Title), "Post was not shown under 'New' after posted.");
            }
Ejemplo n.º 5
0
            public void Castr_Social_Networks_Facebook()
            {
                _browser.Navigate(_config.Url);
                HomePage homePage = new HomePage(_browser);

                homePage.Login(_config.ConfigObject.Users.AdminUser);
                PostCreator postCreator = new PostCreator(_browser);

                postCreator.Create();
                CastrPage castrPage = homePage.GoToCastr();
                CastrPage newPosts  = castrPage.SelectStatus(Statuses.New);
                CastrPost post      = newPosts.ClickOnPost(postCreator.Title);

                post.PublishToSocialNetwork(0, 2, 0);
                FacebookClient facebookClient = new FacebookClient();

                Assert.True(facebookClient.SearchPost(postCreator.Title), $"Post {postCreator.Title} was not created");
            }
Ejemplo n.º 6
0
            public void Castr_CheckPublishStatus()
            {
                _browser.Navigate(_config.Url);
                HomePage homePage = new HomePage(_browser);

                homePage.Login(_config.ConfigObject.Users.AdminUser);
                PostCreator postCreator = new PostCreator(_browser);

                postCreator.Create();
                CastrPage castrPage = homePage.GoToCastr();
                CastrPage newPosts  = castrPage.SelectStatus(Statuses.New);
                CastrPost post      = newPosts.ClickOnPost(postCreator.Title);

                post.PublishPost();
                CastrPage publishedPosts = castrPage.SelectStatus(Statuses.published);

                Assert.True(publishedPosts.SearchPostByTitle(postCreator.Title), "Was was not shown under 'Published' after published.");
            }
Ejemplo n.º 7
0
            public void Caster_Schedulr_PostBox()
            {
                _browser.Navigate(_config.Url);
                HomePage homePage = new HomePage(_browser);

                homePage.Login(_config.ConfigObject.Users.AdminUser);
                PostCreator postCreator = new PostCreator(_browser);

                postCreator.Create();
                CastrPage castrPage = homePage.GoToCastr();
                CastrPage newPosts  = castrPage.SelectStatus(Statuses.New);
                CastrPost post      = newPosts.ClickOnPost(postCreator.Title);

                post.PublishToSocialNetworksSchedul(0, 2, "16");
                _browser.Navigate($"{ _config.Url}/management/schedulr");
                SchedulrPage schdulrPage = new SchedulrPage(_browser);

                Assert.False(schdulrPage.ValidatePostFacebook(postCreator.Title) && schdulrPage.ValidatePostTwitter(postCreator.Title));
            }
Ejemplo n.º 8
0
            public void Castr_CheckArchiveStatus()
            {
                _browser.Navigate(_config.Url);
                HomePage homePage = new HomePage(_browser);

                homePage.Login(_config.ConfigObject.Users.AdminUser);
                PostCreator postCreator = new PostCreator(_browser);

                postCreator.Create();
                CastrPage castrPage = homePage.GoToCastr();
                CastrPage newPosts  = castrPage.SelectStatus(Statuses.New);
                CastrPost post      = newPosts.CheckPost(postCreator.Title);

                post.ArchivePost();
                Thread.Sleep(5000);
                CastrPage archivedPosts = newPosts.SelectStatus(Statuses.archived);

                Assert.True(archivedPosts.SearchPostByTitle(postCreator.Title), "Post was not shown under 'Archive' after archived.");
            }
Ejemplo n.º 9
0
            public void Castr_ValidatePostUrl()
            {
                _browser.Navigate(_config.Url);
                HomePage homePage = new HomePage(_browser);

                homePage.Login(_config.ConfigObject.Users.AdminUser);
                PostCreator postCreator = new PostCreator(_browser);
                PostPage    postPage    = postCreator.Create(typeof(ArticleBase));
                string      exUrl       = _browser.GetUrl();

                postPage.HoverOverOptions();
                CastrPage CasterPage = postPage.ClickOnOpenInCaster();

                _browser.SwitchToLastTab();
                CastrPost post  = new CastrPost(_browser);
                string    acUrl = post.GetPostUrl().Replace("https", "http");

                Assert.AreEqual(exUrl, acUrl);
            }
Ejemplo n.º 10
0
            public void Castr_Social_Networks_Twitter()
            {
                _browser.Navigate(_config.Url);
                HomePage homePage = new HomePage(_browser);

                homePage.Login(_config.ConfigObject.Users.AdminUser);
                PostCreator postCreator = new PostCreator(_browser);

                postCreator.Create();
                CastrPage castrPage = homePage.GoToCastr();
                CastrPage newPosts  = castrPage.SelectStatus(Statuses.New);
                CastrPost post      = newPosts.ClickOnPost(postCreator.Title);

                post.PublishToSocialNetwork(0, 2, 1);
                _browser.Navigate(_config.ConfigObject.TwitterUrl);
                TwitterAppPage twitterAppPage = new TwitterAppPage(_browser);
                PostPage       postPage2      = twitterAppPage.ClickOnTweetLink(postCreator.Title);

                Assert.True(postPage2.ValidatePostCreated(postCreator.Title), "User has not redircted to post after click on twitter link.");
            }
Ejemplo n.º 11
0
            public void Castr_CheckControlsAreDissabledOnPublishPost()
            {
                _browser.Navigate(_config.Url);
                HomePage homePage = new HomePage(_browser);

                homePage.Login(_config.ConfigObject.Users.AdminUser);
                PostCreator postCreator = new PostCreator(_browser);

                postCreator.Create();
                CastrPage castrPage = homePage.GoToCastr();
                CastrPage newPosts  = castrPage.SelectStatus(Statuses.New);
                CastrPost post      = newPosts.ClickOnPost(postCreator.Title);

                post.PublishPost();
                CastrPage publishedPosts = newPosts.SelectStatus(Statuses.published);

                post = publishedPosts.ClickOnPost(postCreator.Title);

                Assert.True(post.ValidateTextAreasDissabled() && post.ValidateInputDissabled() && post.ValidateControlsDissabled(), "Controls were not dissabled.");
            }
Ejemplo n.º 12
0
            public void Castr_FTB90_PublishAnIdPostFromFTB90Caster()
            {
                _browser.Navigate(_config.Url);
                HomePage homePage = new HomePage(_browser);

                homePage.Login(_config.ConfigObject.Users.AdminUser);
                PostCreator postCreator = new PostCreator(_browser);

                postCreator.Create();
                CastrPage castrPage = homePage.GoToCastr();
                CastrPage newPosts  = new CastrPage(_browser);

                newPosts.ClickOnPost(postCreator.Title);
                FtbPost castrPostFTB90 = new FtbPost(_browser);

                castrPostFTB90.CheckpublishToCategoryCb();
                castrPostFTB90.PublishPostToTeam(1, 0, new List <int> {
                    0, 1
                }, "l");
                castrPostFTB90.ValidateSucMsg();

                JsonHelper jsonHelper = new JsonHelper(179, postCreator.Title);

                Assert.True(jsonHelper.SearchArticleInFeed(), $"Post '{postCreator.Title}' was not published to team's feed.");

                jsonHelper = new JsonHelper(1, postCreator.Title);
                Assert.False(jsonHelper.SearchArticleInFeed(0), "Post apeared on an unchecked team's feed.");

                jsonHelper = new JsonHelper(2, postCreator.Title);
                Assert.False(jsonHelper.SearchArticleInFeed(0), "Post apeared on an unchecked team's feed.");

                jsonHelper = new JsonHelper("id", 179, "90Min", postCreator.Title);
                Assert.False(jsonHelper.SearchArticleInFeed(0), "Post apeared on 90Min team's feed.");

                jsonHelper = new JsonHelper("en", 179, "90Min", postCreator.Title);
                Assert.False(jsonHelper.SearchArticleInFeed(0), "Post apeared on 90Min team's feed.");

                jsonHelper = new JsonHelper("lists", postCreator.Title);
                Assert.True(jsonHelper.SearchArticleInFeed(), $"Post '{postCreator.Title}' was not published to List catageory feed.");
            }
Ejemplo n.º 13
0
            public void Caster_Schedulr_ValidateDate()
            {
                _browser.Navigate(_config.Url);
                var      curYear  = DateTime.Now.Year;
                HomePage homePage = new HomePage(_browser);

                homePage.Login(_config.ConfigObject.Users.AdminUser);
                PostCreator postCreator = new PostCreator(_browser);

                postCreator.Create();
                CastrPage castrPage = homePage.GoToCastr();
                CastrPage newPosts  = castrPage.SelectStatus(Statuses.New);
                CastrPost post      = newPosts.ClickOnPost(postCreator.Title);

                post.PublishToSocialNetworks(0, 2);
                _browser.Navigate($"{ _config.Url}/management/schedulr");
                SchedulrPage schdulrPage = new SchedulrPage(_browser);

                schdulrPage.SelectYear(curYear + 1);
                SchedulrPage schedulrPageNewDate = schdulrPage.ClickOnGoBtn();

                Assert.False(schedulrPageNewDate.ValidatePostFacebook(postCreator.Title, 0, false) && schedulrPageNewDate.ValidatePostTwitter(postCreator.Title, 0, false));
            }
Ejemplo n.º 14
0
            public void PartnersPage_ValidatePostsQueue()
            {
                var category = _params["Category"].ToString();

                _browser.Navigate(_config.Url);
                HomePage homePage = new HomePage(_browser);

                homePage.Login(_config.ConfigObject.Users.AdminUser);
                PostCreator   postCreator = new PostCreator(_browser);
                List <string> titles      = postCreator.Create(15).Select(t => t.Trim()).ToList();

                //titles.Reverse();
                _browser.Navigate($"{_config.Url}/management/castr");
                CastrPage castrPage = new CastrPage(_browser);

                castrPage.PublishToCategoryMultiple(titles, category);

                _browser.Navigate($"{_config.Url}/hubs/{category}");
                PartnersPage partnersPage = new PartnersPage(_browser);
                var          titlesInPage = partnersPage.GetTitles().Where((t, i) => i <= 15).ToList();

                titlesInPage.Reverse();
                Assert.True(titles.SequenceEqual(titlesInPage), $"Expected: {string.Join(",", titles)} {Environment.NewLine} Actual: {string.Join(",", titlesInPage)}");
            }
Ejemplo n.º 15
0
            public void Castr_CheckReset()
            {
                _browser.Navigate(_config.Url);
                HomePage homePage = new HomePage(_browser);

                homePage.Login(_config.ConfigObject.Users.AdminUser);
                PostCreator postCreator = new PostCreator(_browser);

                postCreator.Create();
                CastrPage castrPage = homePage.GoToCastr();
                CastrPage newPosts  = castrPage.SelectStatus(Statuses.New);
                CastrPost post      = newPosts.ClickOnPost(postCreator.Title);

                post.PublishPost();
                CastrPage publishedPosts = castrPage.SelectStatus(Statuses.published);

                post = publishedPosts.ClickOnPost(postCreator.Title);
                post.ResetPost();
                Assert.True(castrPage.ValidateSucMsg(), "Post reset suc message hasn't shown");

                CastrPage archivedPosts = publishedPosts.SelectStatus(Statuses.New);

                Assert.True(archivedPosts.SearchPostByTitle(postCreator.Title), "Post was not shown under 'New' after reseted.");
            }