Beispiel #1
0
        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()));
            }
        }
Beispiel #2
0
 private void SendMessage(string to, string subject, string message)
 {
     EnterPage.ClickCompose();
     ComposeMailPage.InputToField(to);
     ComposeMailPage.InputSubjectField(subject);
     ComposeMailPage.InputMessageField(message);
     ComposeMailPage.ClickSendButton();
 }
Beispiel #3
0
        public ActionResult Index()
        {
            WgArtists data  = new WgArtists();
            EnterPage model = new EnterPage();

            model = (from a in data.EnterPage select a).FirstOrDefault();

            return(View(model));
        }
Beispiel #4
0
        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();
        }
Beispiel #5
0
        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();
        }
Beispiel #6
0
        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");
        }
Beispiel #7
0
        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));
        }
Beispiel #8
0
        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));
        }
Beispiel #9
0
 public EnterPageVM(EnterPage page)
 {
     this.page            = page;
     LoginCommandProperty = new LoginCommand(page);
 }
Beispiel #10
0
 public EnterPageBO(IWebDriver driver)
 {
     EnterPage = new EnterPage(driver);
 }
 public LoginCommand(EnterPage page)
 {
     ops       = new Operations();
     this.page = page;
 }
Beispiel #12
0
        //
        // GET: /Enter/Create

        public ActionResult Create()
        {
            EnterPage ep = new EnterPage();

            return(View(ep));
        }