Exemple #1
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());
            }
Exemple #2
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");
            }
        public MenuPresenter(MainWindow mw)
        {
            _mainWindow = mw;

            _updPage = new UpdatePage();
            new UpdatePagePresenter(_updPage);

            _postPage = new PostPage();
            new PostPresenter(_postPage);

            _getInfoPage = new GetInfoPage();
            new GetInfoPresenter(_getInfoPage);

            _deletePage = new DeletePage();
            new DeletePresenter(_deletePage);

            _mainWindow.Menu_PostButton.Click    += Menu_PostButton_Click;
            _mainWindow.Menu_GetDataButton.Click += Menu_GetDataButton_Click;
            _mainWindow.Menu_UpdateButton.Click  += Menu_UpdateButton_Click;
            _mainWindow.Menu_DeleteButton.Click  += Menu_DeleteButton_Click;
            _mainWindow.Menu_DeleteButton.Click  += Menu_DeleteButton_Click1;

            var globalMenu = new System.Windows.Controls.ContextMenu();
            var exit       = new MenuItem {
                Header = "Exit"
            };

            exit.Click += Exit_Click;
            globalMenu.Items.Add(exit);
        }
Exemple #4
0
            public void Editor_List_FullFlow()
            {
                Auth0LoginPage loginPage     = new Auth0LoginPage(_browser);
                NewsRoomPage   newsRoomPage  = loginPage.LoginNewsRoom(_config.ConfigObject.Users.AdminUser);
                EditorPage     editorPage    = newsRoomPage.ClickOnEditorBtn();
                BsonArray      tagExValue    = _params["Tags"].AsBsonArray;
                BsonArray      titles        = _params["Titles"].AsBsonArray;
                string         body          = _params["Body"].ToString();
                ListsTemplate  listsTemplate = editorPage.ClickOnList();

                listsTemplate.WriteTitle("VIDEO:test list template");
                listsTemplate.SearchImage("cats");
                listsTemplate.DragImages();
                listsTemplate.SetSubTitles(titles);
                listsTemplate.SetBodyTextBoxsMmNews(body);
                listsTemplate.WriteTags(tagExValue);
                listsTemplate.ClickOnAscendingBtn();
                listsTemplate.ClickOnDscBtn();
                PreviewPage previewPage = listsTemplate.ClickOnPreviewBtn();
                PostPage    postPage    = previewPage.ClickOnPublishBtn();

                Assert.True(postPage.ValidatePostCreated("VIDEO:test list template"), "Post was not created");
                var errors = postPage.ValidateComponents(_params["Components"].AsBsonArray);

                Assert.True(string.IsNullOrEmpty(errors), errors);
            }
Exemple #5
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 #6
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 #7
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}");
            }
Exemple #8
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}");
            }
Exemple #9
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");
            }
Exemple #10
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]}");
            }
Exemple #11
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()}");
            }
Exemple #12
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 #13
0
            public void Editor_SlideShow_FullFlow()
            {
                BsonArray tagExValue = _params["Tags"].AsBsonArray;
                BsonArray titles     = _params["Titles"].AsBsonArray;
                string    body       = _params["Body"].ToString();

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

                homePage.Login(_config.ConfigObject.Users.AdminUser);
                EditorPage    editorPage = homePage.ClickOnAddArticle();
                SlideShowPage slideShow  = editorPage.ClickOnSlideShow();

                slideShow.WriteTitle("VIDEO:test slideshow template");
                slideShow.DragAndDropImages();
                slideShow.SetSubTitles(titles);
                slideShow.SetBodyTextBoxsSlide(body);
                slideShow.WriteTags(tagExValue);
                slideShow.ClickOnAscendingBtn();
                slideShow.ClickOnDscBtn();
                PreviewPage previewPage = slideShow.ClickOnPreviewBtn();
                PostPage    postPage    = previewPage.ClickOnPublishBtn();

                Assert.True(postPage.ValidatePostCreated("VIDEO:test slideshow template"), "Post was not created");
                var errors = postPage.ValidateComponents(_params["Components"].AsBsonArray);

                Assert.True(string.IsNullOrEmpty(errors), errors);
            }
Exemple #14
0
            public void Editor_TV_FullFlow()
            {
                _browser.Navigate(_config.Url);
                HomePage homePage = new HomePage(_browser);

                homePage.Login(_config.ConfigObject.Users.AdminUser);
                EditorPage editorPage = homePage.ClickOnAddArticle();
                TVPage     tVPage     = editorPage.ClickOnTVTemplate();

                tVPage.WriteTitle("Test TV Template");
                tVPage.SetEmbedCode(_params["JWembedCode"].ToString());
                tVPage.DragVideo();
                tVPage.ClickOnOkBtn();
                tVPage.SetSeoDesc();
                tVPage.WriteTags(new BsonArray(new List <string>()
                {
                    "Atest", "BTest", "CTest", "DTest"
                }));
                PreviewPage previewPage = tVPage.ClickOnPreviewBtn();
                PostPage    postPage    = previewPage.ClickOnPublishBtn();

                Assert.True(postPage.ValidatePostCreated("Test TV Template"), "The post was not created.");
                var errors = postPage.ValidateComponents(_params["Components"].AsBsonArray);

                Assert.True(string.IsNullOrEmpty(errors), errors);
            }
Exemple #15
0
            public void Editor_List_FullFlow()
            {
                BsonArray tagExValue = _params["Tags"].AsBsonArray;
                BsonArray titles     = _params["Titles"].AsBsonArray;
                string    body       = _params["Body"].ToString();

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

                homePage.Login(_config.ConfigObject.Users.AdminUser);
                EditorPage    editorPage    = homePage.ClickOnAddArticle();
                ListsTemplate listsTemplate = editorPage.ClickOnList();

                listsTemplate.WriteTitle("VIDEO:test list template");
                listsTemplate.DragImages();
                listsTemplate.SetSubTitles(titles);
                listsTemplate.SetBodyTextBoxs(body);
                listsTemplate.WriteTags(tagExValue);
                listsTemplate.ClickOnAscendingBtn();
                listsTemplate.ClickOnDscBtn();
                PreviewPage previewPage = listsTemplate.ClickOnPreviewBtn();
                PostPage    postPage    = previewPage.ClickOnPublishBtn();

                Assert.True(postPage.ValidatePostCreated("VIDEO:test list template"), "Post was not created");
            }
        public void PostPageLoaded()
        {
            var postPage = new PostPage(this.driver);

            postPage.NavigateTo();

            postPage.AssertPostPageIsLoaded("Create Article");
        }
 public void Test(string searchContext, int searchResultnumber)
 {
     HomePage.ClickOnStartLearningNow();
     HomePage.GoToDiscussSection();
     DiscussionsPage.MakeASearch(searchContext);
     DiscussionsPage.ClickOnSearchResult(searchResultnumber);
     Assert.Greater(PostPage.GetNumberOfAnswers(), 5);
 }
Exemple #18
0
 public MainWindowViewModel(NavigationService navigationService)
 {
     _postPage                  = new PostPage(MainWindowsCommands.ReadTemplate());
     _navigationService         = navigationService;
     ChangePage                 = new DelegateCommand();
     ChangePage.ExecuteCommand += new Action <object>(ChangePageCommand);
     _navigationService.Navigate(_postPage);
 }
        private async void CommentRefreshButton_Click(object sender, RoutedEventArgs e)
        {
            PostPage page = MainFrame.Content as PostPage;

            CommentRefreshButton.IsEnabled = false;
            await page.refreshComments();

            CommentRefreshButton.IsEnabled = true;
        }
Exemple #20
0
            public void CookiesDisclaimer_ValidateDisapears()
            {
                _browser.Navigate(_config.Url);
                HomePage homePage = new HomePage(_browser);
                PostPage postpage = homePage.ClickOnCoverStory();
                Cookies  cookies  = new Cookies(_browser);

                Assert.True(cookies.ValidateCookiesDisclaimerDisappears(5), "Cookies disclaimer wasn't found");
            }
Exemple #21
0
 public Post_FillMessage(PostPage _page)
 {
     InitializeComponent();
     //photoTask = new CameraCaptureTask();
     //photoTask.Completed+=new EventHandler<PhotoResult>(photoTask_Completed);
     //  Storyboard1.Begin();
     lb_Category_Photo.ItemsSource = list_Choosed;
     page = _page;
 }
        public void CreatePostSuccessfully()
        {
            var  postPage = new PostPage(this.driver);
            Post post     = AccessExcelData.GetPostTestData("CreatePostSuccessfully");

            postPage.NavigateTo();
            postPage.FillPostForm(post);

            postPage.AssertPostAdded();
        }
        public void CreatePostWithoutContent()
        {
            var  postPage = new PostPage(this.driver);
            Post post     = AccessExcelData.GetPostTestData("CreatePostWithoutContent");

            postPage.NavigateTo();
            postPage.FillPostForm(post);

            postPage.AssertErrorMessage("The Content field is required.");
        }
        public void CreatePostWithLongTitle()
        {
            var  postPage = new PostPage(this.driver);
            Post post     = AccessExcelData.GetPostTestData("CreatePostWithLongTitle");

            postPage.NavigateTo();
            postPage.FillPostForm(post);

            postPage.AssertErrorMessage("The field Title must be a string with a maximum length of 50.");
        }
Exemple #25
0
 public ApplicationPage()
 {
     InitializeComponent();
     postView     = new PostPage();
     postsView    = new PostsPage();
     submitPage   = new SubmitPostPage();
     memesPage    = new MemesPage();
     settingsPage = new SettingsPage();
     PageNavigationManager.SubpageContentControl = contentArea;
     PageNavigationManager.SwitchToSubpage(postsView);
 }
 public async void DisplayPosts()
 {
     try
     {
         PostPage page = new PostPage(AlbumVM);
         await PushAsync(page);
     }
     catch (Exception ex)
     {
         await Dialog.AlertAsync(ex.Message, "Erro", "Ok");
     }
 }
Exemple #27
0
        public void EditNewPostContent()
        {
            var  postPage = new PostPage(this.driver);
            Post post     = AccessExcelData.GetPostTestData("EditNewPostContent");


            postPage.NavigateToNewPost();
            postPage.EditPost();
            postPage.EditPostFormContent(post);
            postPage.EditArticlePost();

            postPage.AssertPostAdded();
        }
Exemple #28
0
        public void DeletePostSuccessfully()
        {
            var postPage = new PostPage(this.driver);


            postPage.NavigateToNewPost();
            postPage.DeletePost();
            postPage.DeleteArticlePost();



            postPage.AssertPostAdded();
        }
Exemple #29
0
        public void Init()
        {
            this.driver = new ChromeDriver();

            var  logPage  = new LoginPage(this.driver);
            var  postPage = new PostPage(this.driver);
            User user     = AccessExcelData.GetUserTestData("LoginAsAdmin");
            Post post     = AccessExcelData.GetPostTestData("CreatePostSuccessfully");

            logPage.NavigateTo();
            logPage.FillLoginForm(user);
            postPage.NavigateTo();
            postPage.FillPostForm(post);
        }
Exemple #30
0
        public void Test_ProfilePage_FindCalling()
        {
            // Arrange
            string filename = "ids.xlsx";
            string dir      = Directory.GetCurrentDirectory();
            string path     = Path.Combine(dir, filename);
            var    user     = Manager.GetUsers(path, "B")[0];

            // Action
            var         driver      = Routine.Init_driver();
            HomePage    homePage    = new HomePage(driver, "https://www.instagram.com");
            LoginPage   loginPage   = homePage.GoToLoginPage();
            ProfilePage profilePage = loginPage.Login(user.id, user.password);
            PostPage    post        = profilePage.Find_Calling(user);
        }