public ActionResult Edit(EnterPage page, HttpPostedFileBase file) { try { //EnterPage ep = db.EnterPage.First(); // Verify that the user selected a file if (file != null && file.ContentLength > 0) { // extract only the fielname var fileName = Path.GetFileName(file.FileName); // store the file inside ~/App_Data/uploads folder string newFileName = DateTime.Now.ToFileTimeUtc().ToString() + "_" + fileName; var path = Path.Combine(Server.MapPath("~/Content/uploads"), newFileName); file.SaveAs(path); page.Image = "/Content/uploads/" + newFileName; } db.Entry(page).State = EntityState.Modified; //ep.Text = page.Text; db.SaveChanges(); return(RedirectToAction("Index", "Admin")); } catch { return(View(db.EnterPage.First())); } }
private void SendMessage(string to, string subject, string message) { EnterPage.ClickCompose(); ComposeMailPage.InputToField(to); ComposeMailPage.InputSubjectField(subject); ComposeMailPage.InputMessageField(message); ComposeMailPage.ClickSendButton(); }
public ActionResult Index() { WgArtists data = new WgArtists(); EnterPage model = new EnterPage(); model = (from a in data.EnterPage select a).FirstOrDefault(); return(View(model)); }
public void TestMethod2() { EnterPage.ClickCompose(); ComposeMailPage.InputToField(TestConfiguration.Email); ComposeMailPage.InputSubjectField(TestConfiguration.MailSubject); ComposeMailPage.InputMessageField(TestConfiguration.Message); ComposeMailPage.ClickCloseButton(); EnterPage.GoToDraftFolder(); DraftMailPage.OpenMail(); //Assert.AreEqual(ComposeMailPage.GetSubjectText(), TestConfiguration.MailSubject, "Wrong subject"); Assert.AreEqual(ComposeMailPage.GetMessageText(), TestConfiguration.Message, "Wrong message"); ComposeMailPage.ClickSendButton(); }
public async Task TestMethod1() { EnterPage.ClickCompose(); ComposeMailPage.InputToField(TestConfiguration.Email); ComposeMailPage.InputSubjectField(TestConfiguration.MailSubject); ComposeMailPage.InputMessageField(TestConfiguration.Message); ComposeMailPage.ClickSendButton(); EnterPage.GoToSendFolder(); SentMailPage.OpenMail(); Assert.AreEqual(OpenedMailPage.GetSubjectText(), TestConfiguration.MailSubject, "Wrong subject"); Assert.AreEqual(OpenedMailPage.GetMessageText(), TestConfiguration.Message, "Wrong message"); OpenedMailPage.DeleteMail(); }
public void TestMethod4() { EnterPage.ClickCompose(); ComposeMailPage.InputToField(TestConfiguration.IncorrectEmail); ComposeMailPage.InputSubjectField(TestConfiguration.MailSubject); ComposeMailPage.InputMessageField(TestConfiguration.Message); ComposeMailPage.ClickSendButton(); Assert.AreEqual(ComposeMailPage.GetErrorMessageHeader(), TestConfiguration.ErrorMessageHeader, "Wrong error message header"); ComposeMailPage.CloseError(); ComposeMailPage.EnableToField(); ComposeMailPage.ClickDeleteWrongEmailButton(); ComposeMailPage.InputToField(TestConfiguration.IncorrectEmail); EnterPage.GoToSendFolder(); SentMailPage.OpenMail(); //Assert.AreEqual(OpenedMailPage.GetSubjectText(), TestConfiguration.MailSubject, "Wrong subject"); Assert.AreEqual(OpenedMailPage.GetMessageText(), TestConfiguration.Message, "Wrong message"); }
public void TestMethod3() { EnterPage.GoToInboxFolder(); for (int i = 0; i < TestConfiguration.NumberOfMailsToCheck; i++) { InboxPage.MarkCheckbox(i); } InboxPage.MarkAsImportant(); EnterPage.ClickMoreButton(); EnterPage.GoToImportantFolder(); Assert.IsTrue(ImportantPage.CheckCount(TestConfiguration.NumberOfMailsToCheck)); for (int i = 0; i < TestConfiguration.NumberOfMailsToCheck; i++) { ImportantPage.MarkCheckbox(i); } ImportantPage.ClickDeleteButton(); EnterPage.GoToTrashFolder(); Assert.IsTrue(BinPage.CheckCount(TestConfiguration.NumberOfMailsToCheck)); }
public ActionResult Create(EnterPage page, HttpPostedFileBase file) { if (ModelState.IsValid) { // Verify that the user selected a file if (file != null && file.ContentLength > 0) { // extract only the fielname var fileName = Path.GetFileName(file.FileName); // store the file inside ~/App_Data/uploads folder string newFileName = DateTime.Now.ToFileTimeUtc().ToString() + "_" + fileName; var path = Path.Combine(Server.MapPath("~/Content/uploads"), newFileName); file.SaveAs(path); page.Image = "/Content/uploads/" + newFileName; } db.EnterPage.Add(page); db.SaveChanges(); return(RedirectToAction("Index", "Admin")); } return(View(page)); }
public EnterPageVM(EnterPage page) { this.page = page; LoginCommandProperty = new LoginCommand(page); }
public EnterPageBO(IWebDriver driver) { EnterPage = new EnterPage(driver); }
public LoginCommand(EnterPage page) { ops = new Operations(); this.page = page; }
// // GET: /Enter/Create public ActionResult Create() { EnterPage ep = new EnterPage(); return(View(ep)); }