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); }
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."); }
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); }
public PostPage Create(Type template) { EditorPage editorPage = ClickOnAddArticle(); ArticleBase articleBase = editorPage.ClickOnTemplate(Templates.FindIndex(x => x == template)); articleBase.ClickOnMagicStick(2); articleBase.WriteTitle(Title); PreviewPage previewPage = articleBase.ClickOnPreviewBtn(); PostPage postPage = previewPage.ClickOnPublishBtn(); postPage.ValidatePostCreated(Title); var parsedTitle = new string(Title.ToCharArray().Where(c => char.IsLetter(c) || c == '-').ToArray()).Replace("posts", "").Replace("-", " "); Title = parsedTitle.Trim(); return(new PostPage(_browser)); }
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()); }
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)); }
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); }
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); }