Exemplo n.º 1
0
        public void ArticleViewDeleteButtonDashboard()
        {
            LoginPage loginuser = new LoginPage(this.driver);

            loginuser.LoginUser("*****@*****.**", "P@ssw@rd");
            loginuser.AssertLoginUser();

            CreateArticle newArticle = new CreateArticle(this.driver);

            newArticle.ArticleNavigateTo();
            newArticle.ArticleCreate("qwertyPetyaDelete", "browserPetya");
            ArticlesDashboard dash = new ArticlesDashboard(this.driver);

            dash.ViewArticleByTitle("qwertyPetyaDelete");

            DeleteArticle deleteArticle = new DeleteArticle(this.driver);

            deleteArticle.ArticleDeletefromList("qwertyPetyaDelete");
            dash.AssertDeleteArticleDashboard("qwertyPetyaDelete");
            dash.LogOut.Click();
            dash.AssertAvailableLoginButton();
        }
Exemplo n.º 2
0
        public void DeleteArticleFromListWithoutLogin()
        {
            LoginPage loginuser = new LoginPage(this.driver);

            //loginuser.LoginUser("*****@*****.**", "londa101");
            loginuser.LoginUser("*****@*****.**", "P@ssw@rd");

            CreateArticle newArticle = new CreateArticle(this.driver);

            newArticle.ArticleNavigateTo();
            newArticle.ArticleCreate("Deleted Article Test THREE", "Content Nury Test");
            ArticlesDashboard dash = new ArticlesDashboard(this.driver);

            dash.LogOut.Click();

            DeleteArticle newDeleteArticle = new DeleteArticle(this.driver);

            dash.ViewArticleByTitle("Deleted Article Test THREE");
            newDeleteArticle.ArticleDeleteButton("Deleted Article Test THREE");
            loginuser.AssertAccountLogin();
            dash.AssertAvailableLoginButton();
        }
Exemplo n.º 3
0
        public ActionResult RemoveArticleList()
        {
            string idString = DoRequest.GetFormString("visitid").Trim();

            if (string.IsNullOrEmpty(idString))
            {
                return(Json(new { error = true, message = "没有选择任何项" }));
            }

            int returnValue = -1;
            var res         = DeleteArticle.Do(idString);

            if (res != null && res.Header != null && res.Header.Result != null && res.Header.Result.Code != null)
            {
                returnValue = Utils.StrToInt(res.Header.Result.Code, -1);
            }
            if (returnValue == 0)
            {
                return(Json(new { error = false, message = "操作成功" }));
            }

            return(Json(new { error = true, message = "操作失败" }));
        }
Exemplo n.º 4
0
 public async Task <Unit> DeleteArticleAsync([FromBody] DeleteArticle deleteArticle)
 {
     return(await _mediator.Send(deleteArticle));
 }