コード例 #1
0
        public void CheckLetterDelete()
        {
            StartPage startPage = new StartPage(driver);
            EmailBox  emailBox  = new EmailBox(driver);

            startPage.Login();
            try
            {
                emailBox.ClickLetterCheckbox("Видалення");
                string xpath = "//span[text()='" + "Видалення" + "']/ancestor::div[@class='row new']//input";  //!!! name??
                if (driver.FindElement(By.XPath(xpath)).Displayed)
                {
                    IWebElement CheckBox = driver.FindElement(By.XPath(xpath));
                    emailBox.ClickDeleteBtn();
                    Actions action = new Actions(driver);
                    IAlert  alert  = driver.SwitchTo().Alert();
                    alert.Accept();
                    emailBox.CheckLetterPresense("Видалення");
                }
            }
            catch (NoSuchElementException exception)
            {
                Console.WriteLine("Sorry, we couldn't find a proper element");
            }
        }
コード例 #2
0
 private void EmailBox_GotFocus(object sender, EventArgs e)
 {
     if (EmailBox.Text == "Email")
     {
         EmailBox.Clear();
     }
 }
コード例 #3
0
 public void basic_emailbox_render()
 {
     var html = new EmailBox("foo").ToString();
     html.ShouldHaveHtmlNode("foo")
         .ShouldBeNamed(HtmlTag.Input)
         .ShouldHaveAttribute(HtmlAttribute.Type).WithValue(HtmlInputType.Email);
 }
コード例 #4
0
        public void LogInMail()
        {
            StartPage startPage = new StartPage(driver);
            EmailBox  emailBox  = new EmailBox(driver);

            startPage.LoginField.SendKeys("*****@*****.**");
            startPage.PasswordField.SendKeys("agena123");
            ////emailBox.createLetterButton.Click();
            //startPage.Login();
            Assert.Multiple(() =>   //Check credentias values
            {
                Assert.AreEqual("*****@*****.**", startPage.LoginField.GetAttribute("value"));
                Assert.AreEqual("agena123", startPage.PasswordField.GetAttribute("value"));
            });
            Assert.AreEqual("i.ua", startPage.PostSelector.GetAttribute("value"));
            Assert.IsFalse(startPage.RememberMe.Selected);
            startPage.LoginButton.Click();                             //Submit login
            Assert.AreEqual("Вхідні - I.UA ", driver.Title);
            Assert.AreEqual("*****@*****.**", emailBox.MailOwner.Text); //Inside login check
            //Assert.AreEqual("Ласкаво просимо на I.UA!", emailBox.NativeMail.Text);
            //Actions action = new Actions(driver);
            //action.MoveToElement(emailBox.Popup).Build().Perform();
            //string blocktext = emailBox.Popup.Text;
            //Assert.IsTrue(emailBox.Popup.Text.Contains("Шановний користувач"));
        }
コード例 #5
0
        public override void DoAction(EmailMessage message, EmailBox box, Pawn speaker)
        {
            IncidentDef def = null;

            switch (action)
            {
            case 0:
            {
                Utils.SendRaid(Find.FactionManager.OfMechanoids, 1.4f, Rand.Range(2, 5) * 60000);
                break;
            }

            case 1:
            {
                def = IncidentDefOfLocal.PsychicEmanatorShipPartCrash;
                def.Worker.TryExecute(StorytellerUtility.DefaultParmsNow(def.category, Find.AnyPlayerHomeMap));
                break;
            }

            case 2:
            {
                Utils.SendRaid(Find.FactionManager.OfMechanoids, 1.2f, Rand.Range(2, 7) * 60000);
                break;
            }

            case 3:
            {
                def = IncidentDefOfLocal.ResourcePodCrash;
                def.Worker.TryExecute(StorytellerUtility.DefaultParmsNow(def.category, Find.AnyPlayerHomeMap));
                break;
            }
            }
        }
コード例 #6
0
        public void emailbox_with_multiple_renders_multiple()
        {
            var html = new EmailBox("foo").Multiple(true).ToString();

            html.ShouldHaveHtmlNode("foo")
            .ShouldHaveAttribute(HtmlAttribute.Multiple).WithValue(HtmlAttribute.Multiple);
        }
コード例 #7
0
        public void emailbox_list_renders_list()
        {
            var html = new EmailBox("foo").List("list1").ToString();

            html.ShouldHaveHtmlNode("foo")
            .ShouldHaveAttribute(HtmlAttribute.List).WithValue("list1");
        }
コード例 #8
0
ファイル: Signup.xaml.cs プロジェクト: yogevm15/TriviaClient
        private void EmailBox_TextChanged(object sender, TextChangedEventArgs e)
        {
            TextBox textBox = sender as TextBox;

            if (String.IsNullOrEmpty(textBox.Text))
            {
                textBox.GetBindingExpression(TextBox.TextProperty);
                ValidationError validationError = new ValidationError(new NotEmptyValidationRule(), textBox.GetBindingExpression(TextBox.TextProperty));
                validationError.ErrorContent = "Field is required.";

                Validation.MarkInvalid(
                    textBox.GetBindingExpression(TextBox.TextProperty),
                    validationError);
            }
            else if (!IsValidEmail(EmailBox.Text))
            {
                EmailBox.GetBindingExpression(TextBox.TextProperty);
                ValidationError validationError = new ValidationError(new NotEmptyValidationRule(), EmailBox.GetBindingExpression(TextBox.TextProperty));
                validationError.ErrorContent = "Must be a valid email.";

                Validation.MarkInvalid(
                    EmailBox.GetBindingExpression(TextBox.TextProperty),
                    validationError);
            }
            else
            {
                Validation.ClearInvalid(textBox.GetBindingExpression(TextBox.TextProperty));
            }
        }
コード例 #9
0
        public void emailbox_without_multiple_does_not_render_multiple()
        {
            var html = new EmailBox("foo").Multiple(true).Multiple(false).ToString();

            html.ShouldHaveHtmlNode("foo")
            .ShouldNotHaveAttribute(HtmlAttribute.Multiple);
        }
コード例 #10
0
        private void button1_Click(object sender, EventArgs e)
        {
            string sql = "select user_name, user_code from tbl_user where user_email = "
                         + "'" + EmailBox.Text + "'" + " and " + "user_pw = "
                         + "'" + PasswordBox.Text + "'";

            DataTable dt = db.GetDBTable(sql);


            if (dt.Rows.Count == 0)
            {
                MessageBox.Show("회원정보가 없습니다.");
                EmailBox.Text    = "";
                PasswordBox.Text = "";
                EmailBox.Focus();
                return;
            }

            foreach (DataRow dr in dt.Rows)
            {
                username  = dr["USER_NAME"].ToString();
                user_code = Int32.Parse(dr["USER_CODE"].ToString());
                MessageBox.Show(username + "님 환영합니다.");
            }

            this.Visible = false;
            Form3 f3 = new Form3();

            f3.passvalue = username;
            f3.User_code = user_code;
            f3.ShowDialog();

            //textBox1.Text = sql;
            db.CloseDB();
        }
コード例 #11
0
        public IWebElement SurveyEmail(string email)
        {
            //select our drop-down and enters a parkcode
            SelectElement ParkSelector = new SelectElement(chromeDriver.FindElement(By.Id("ParkCode")));

            ParkSelector.SelectByValue("CVNP");

            //type an email for us and then clears any older entries then send email brought in and types it in SendKeys(email)
            WaitForElement(By.Id("EmailAddress"));
            EmailBox.Clear();
            EmailBox.SendKeys(email);

            //select from a drop down menu
            SelectElement StateSelector = new SelectElement(chromeDriver.FindElement(By.Id("State")));

            StateSelector.SelectByValue("OH");

            //select radio butons
            IList <IWebElement> radioSelect = chromeDriver.FindElements(By.Id("ActivityLevel"));

            radioSelect[0].Click();

            WaitForElement(By.Id("submit"));
            SubmitButton.Click();

            WaitForElement(By.Id("survey"));
            return(Survey);
        }
コード例 #12
0
        private void InputBox_OnKeyUp(object sender, KeyRoutedEventArgs e)
        {
            if (sender == PhoneNumberBox)
            {
                if (PhoneNumberBox.Text.Length == 10)
                {
                    EmailBox.Focus(FocusState.Programmatic);
                    return;
                }
            }

            if (e.Key == VirtualKey.Enter)
            {
                if (sender == NameBox)
                {
                    SurnameBox.Focus(FocusState.Programmatic);
                }
                if (sender == SurnameBox)
                {
                    CommandBar.Focus(FocusState.Programmatic);
                }
                else if (sender == EmailBox)
                {
                    PasswordBox.Focus(FocusState.Programmatic);
                }
                else if (sender == PasswordBox)
                {
                    PasswordRepeatBox.Focus(FocusState.Programmatic);
                }
                else if (sender == PasswordRepeatBox)
                {
                    CommandBar.Focus(FocusState.Programmatic);
                }
            }
        }
コード例 #13
0
ファイル: UnitTests.cs プロジェクト: 4ezy/MailClient
        public void ConnectionCheck()
        {
            EmailBox emailBox = new EmailBox("*****@*****.**", "Db64ce15345", "imap.gmail.com",
                                             993, "smtp.gmail.com", 465);

            Assert.AreEqual(true, emailBox.ConnectFull());
        }
コード例 #14
0
        /// <summary>
        /// marcar uma mensagem como lida ou não lida
        /// </summary>
        /// <param name="__objUpdate"></param>
        /// <param name="_status">valors possíveis "read" and "unread"</param>
        /// <returns></returns>
        public EmailBox UpdateStatusMessage(EmailBox __objUpdate, string __status = "read")
        {
            using (var _context = new Context())
            {
                //fonte: http://stackoverflow.com/questions/15336248/entity-framework-5-updating-a-record

                EmailBox _objOriginal = _context.EmailBoxes.Find(__objUpdate.Id);

                if (_objOriginal != null)
                {
                    __objUpdate.UpdateDate    = System.DateTime.Today;
                    __objUpdate.ReadingStatus = __status == "read" ? readingStatus.read :
                                                __status == "archived" ? readingStatus.archived :
                                                __status == "trash" ? readingStatus.trash :
                                                __status == "draft" ? readingStatus.draft :
                                                __status == "reply" ? readingStatus.reply :
                                                __status == "forward" ? readingStatus.forward :
                                                __status == "compose" ? readingStatus.compose :
                                                __status == "Unread" ? readingStatus.Unread : __objUpdate.ReadingStatus;

                    _context.Entry(_objOriginal).CurrentValues.SetValues(__objUpdate);

                    _context.SaveChanges();
                }
            }

            return(__objUpdate);
        }
コード例 #15
0
 private void emailLostFocus(object sender, RoutedEventArgs e)
 {
     if (EmailBox.Text == "")
     {
         user.Email = "Email";
         EmailBox.GetBindingExpression(TextBox.TextProperty).UpdateTarget();
     }
 }
コード例 #16
0
        public void basic_emailbox_render()
        {
            var html = new EmailBox("foo").ToString();

            html.ShouldHaveHtmlNode("foo")
            .ShouldBeNamed(HtmlTag.Input)
            .ShouldHaveAttribute(HtmlAttribute.Type).WithValue(HtmlInputType.Email);
        }
コード例 #17
0
 private void EmptyTextBox()
 {
     FirstNameBox.Clear();
     LastNameBox.Clear();
     EmailBox.Clear();
     PasswordBox.Clear();
     ConPasswordBox.Clear();
 }
コード例 #18
0
ファイル: UnitTests.cs プロジェクト: 4ezy/MailClient
        public void EmailDownload()
        {
            EmailBox emailBox = new EmailBox("*****@*****.**", "Db64ce15345", "imap.gmail.com",
                                             993, "smtp.gmail.com", 465);

            //emailBox.DownloadInboxMessages(0, 5);
            Assert.IsNotNull(emailBox.Inbox);
        }
コード例 #19
0
 private void ClearBoxes()
 {
     RegNumBox.Clear();
     NameBox.Clear();
     SurnameBox.Clear();
     EmailBox.Clear();
     PassBox.Clear();
     CourseTitleBox.Clear();
 }
コード例 #20
0
        public void emailbox_for_member_with_required_attibute_adds_required_attribute_using_custom_behavior()
        {
            Expression<Func<FakeModel, object>> expression = x => x.Email;
            var behaviors = new List<IBehaviorMarker> { new CustomRequiredHtml5Behavior() };

            var html = new EmailBox(expression.GetNameFor(), expression.GetMemberExpression(), behaviors).ToString();

            var element = html.ShouldHaveHtmlNode("Email");
            element.ShouldHaveAttribute(HtmlAttribute.Required).ValueShouldContain(HtmlAttribute.Required);
        }
コード例 #21
0
        private void EmailBox_Leave(object sender, EventArgs e)
        {
            EmailBox.Text = EmailBox.Text.TrimEnd(' ');

            if ((EmailBox.Text == "") || (!Regex.IsMatch(EmailBox.Text, "[a-z0-9!#$%&'*+/?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?")))
            {
                EmailWarningLabel.ForeColor = Color.Red;
            }
            EmailBox.Select(0, 0);
        }
コード例 #22
0
 public void Test_SendEmail()
 {
     var box = new EmailBox()
     {
         Subject    = "MailKit 测试发送邮件",
         To         = _to,
         Body       = "<p style='color:red'>测试一下红色字体的邮件</p>",
         IsBodyHtml = true,
     };
     //this._mailKitEmailSender.Send(box);
 }
コード例 #23
0
        public override void DoAction(EmailMessage message, EmailBox box, Pawn speaker)
        {
            EmailMessage msg = box.FormMessageFrom(message.Faction, "NiceCaravan_Explain".Translate(), "NiceCaravan_Subject".Translate());

            box.SendMessage(msg);

            message.Faction.TryAffectGoodwillWith(box.Owner, -15);

            Utils.SendRaid(message.Faction, 1.5f, 50000);
            Utils.SendRaid(message.Faction, 1.5f, 2 * 60000);
        }
コード例 #24
0
        public override void OnReceived(EmailMessage message, EmailBox box)
        {
            IncidentParms incidentParms = new IncidentParms();

            incidentParms.target          = Find.AnyPlayerHomeMap;
            incidentParms.faction         = message.Faction;
            incidentParms.raidArrivalMode = PawnsArrivalModeDefOf.EdgeWalkIn;
            incidentParms.points          = StorytellerUtility.DefaultThreatPointsNow(incidentParms.target);
            incidentParms.raidStrategy    = RaidStrategyDefOf.ImmediateAttack;

            Find.Storyteller.incidentQueue.Add(IncidentDefOf.RaidEnemy, Find.TickManager.TicksGame + TicksToSend, incidentParms);
        }
コード例 #25
0
        public override void ExtendedOneTimeSetUp()
        {
            driver.Navigate().GoToUrl("http://www.i.ua/");
            StartPage        startPage        = new StartPage(driver);
            EmailBox         emailBox         = startPage.Login();
            CreateLetterPage createLetterPage = new CreateLetterPage(driver);

            emailBox.CreateLetter();
            createLetterPage.AttachmentButton.Click();
            createLetterPage.ChooseFileButton.Click();
            DocumentUtils.Upload(driver, @"C:\Users\Sofiya\Documents\Visual Studio 2017\Projects\DOCUMENT_UTILS\Upload\Doc_to_Upload.txt");
        }
コード例 #26
0
        public EmailBox Add(EmailBox __obj)
        {
            using (var _context = new Context())
            {
                __obj.UpdateDate = System.DateTime.Now;
                __obj.AddDate    = System.DateTime.Now;

                _context.EmailBoxes.Add(__obj);
                _context.SaveChanges();
            }
            return(__obj);
        }
コード例 #27
0
        public void Test_SendEmail_Attachment_ChineseFileName()
        {
            var box = new EmailBox()
            {
                Subject    = "测试发送邮件以及附件_中文文件名",
                To         = _to,
                Body       = "<p style='color:red'>测试一下红色字体的邮件</p>",
                IsBodyHtml = true,
            };

            box.Attachments.Add(new PhysicalFileAttachment("D:\\测试文件.doc"));
            this._smtpEmailSender.Send(box);
        }
コード例 #28
0
ファイル: LetterEdit.cs プロジェクト: cjsonika/MyFirstRep
        public override void ExtendedOneTimeSetUp()
        {
            driver.Navigate().GoToUrl("http://www.i.ua/");
            StartPage        startPage        = new StartPage(driver);
            EmailBox         emailBox         = startPage.Login();
            CreateLetterPage createLetterPage = new CreateLetterPage(driver);

            //startPage.Login();
            Assert.AreEqual("*****@*****.**", emailBox.MailOwner.Text); //Inside login check
            emailBox.createLetterButton.Click();
            Assert.AreEqual("Новий лист - I.UA ", driver.Title);
            createLetterPage.CreateLetter(topic);
        }
コード例 #29
0
        public void Test_SendEmail_Attachment_LongLengthFileName()
        {
            var box = new EmailBox()
            {
                Subject    = "MailKit 测试发送邮件以及附件_多个文件",
                To         = _to,
                Body       = "<p style='color:red'>测试一下红色字体的邮件</p>",
                IsBodyHtml = true,
            };

            box.Attachments.Add(new PhysicalFileAttachment("D:\\测试文件123456789012345678901234567894444564645666666666666.doc"));
            this._mailKitEmailSender.Send(box);
        }
コード例 #30
0
        public void Test_SendEmail_Attachment()
        {
            var box = new EmailBox()
            {
                Subject    = "MailKit 测试发送邮件以及附件",
                To         = _to,
                Body       = "<p style='color:red'>测试一下红色字体的邮件</p>",
                IsBodyHtml = true,
            };

            box.Attachments.Add(new PhysicalFileAttachment("D:\\123.xlsx"));
            this._mailKitEmailSender.Send(box);
        }
コード例 #31
0
        public void emailbox_for_member_with_required_attibute_adds_required_attribute_using_custom_behavior()
        {
            Expression <Func <FakeModel, object> > expression = x => x.Email;
            var behaviors = new List <IBehaviorMarker> {
                new CustomRequiredHtml5Behavior()
            };

            var html = new EmailBox(expression.GetNameFor(), expression.GetMemberExpression(), behaviors).ToString();

            var element = html.ShouldHaveHtmlNode("Email");

            element.ShouldHaveAttribute(HtmlAttribute.Required).ValueShouldContain(HtmlAttribute.Required);
        }
コード例 #32
0
ファイル: Form1.cs プロジェクト: CMGeorges/Carnet_Adresse
 private void Cleared()
 {
     FirstNBox.Clear();
     LastNBox.Clear();
     MiddleNBox.Clear();
     PhoneBox.Clear();
     EmailBox.Clear();
     AddressBox1.Clear();
     AddressBox2.Clear();
     CityBox.Clear();
     StateBox.Clear();
     ZipBox.Clear();
     CountryBox.Clear();
 }
コード例 #33
0
ファイル: Email.cs プロジェクト: NewSpring/Rock
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            Controls.Clear();

            tbFromName = new RockTextBox();
            tbFromName.ID = string.Format( "tbFromName_{0}", this.ID );
            tbFromName.Label = "From Name";
            Controls.Add( tbFromName );

            lFromName = new RockLiteral();
            lFromName.ID = string.Format( "lFromName_{0}", this.ID );
            lFromName.Label = "From Name";
            Controls.Add( lFromName );

            ebFromAddress = new EmailBox();
            ebFromAddress.ID = string.Format( "ebFromAddress_{0}", this.ID );
            ebFromAddress.Label = "From Address";
            Controls.Add( ebFromAddress );

            lFromAddress = new RockLiteral();
            lFromAddress.ID = string.Format( "lFromAddress_{0}", this.ID );
            lFromAddress.Label = "From Address";
            Controls.Add( lFromAddress );

            ebReplyToAddress = new EmailBox();
            ebReplyToAddress.ID = string.Format( "ebReplyToAddress_{0}", this.ID );
            ebReplyToAddress.Label = "Reply To Address";
            Controls.Add( ebReplyToAddress );

            tbSubject = new RockTextBox();
            tbSubject.ID = string.Format( "tbSubject_{0}", this.ID );
            tbSubject.Label = "Subject";
            tbSubject.Help = "<span class='tip tip-lava'></span>";
            Controls.Add( tbSubject );

            htmlMessage = new HtmlEditor();
            htmlMessage.ID = string.Format( "htmlMessage_{0}", this.ID );
            //htmlMessage.AdditionalConfigurations = "autoParagraph: false,";
            htmlMessage.Help = "<span class='tip tip-lava'></span> <span class='tip tip-html'>";
            this.AdditionalMergeFields.ForEach( m => htmlMessage.MergeFields.Add( m ) );
            htmlMessage.Label = "Message";
            htmlMessage.Height = 600;
            Controls.Add( htmlMessage );

            tbTextMessage = new RockTextBox();
            tbTextMessage.ID = string.Format( "tbTextMessage_{0}", this.ID );
            tbTextMessage.Label = "Message (Text Version)";
            tbTextMessage.TextMode = TextBoxMode.MultiLine;
            tbTextMessage.Rows = 5;
            tbTextMessage.CssClass = "span12";
            Controls.Add( tbTextMessage );

            hfAttachments = new HiddenField();
            hfAttachments.ID = string.Format( "hfAttachments_{0}", this.ID );
            Controls.Add( hfAttachments );

            fuAttachments = new FileUploader();
            fuAttachments.ID = string.Format( "fuAttachments_{0}", this.ID );
            fuAttachments.Label = "Attachments";
            fuAttachments.FileUploaded += fuAttachments_FileUploaded;
            Controls.Add( fuAttachments );
        }
コード例 #34
0
 public void emailbox_with_multiple_renders_multiple()
 {
     var html = new EmailBox("foo").Multiple(true).ToString();
     html.ShouldHaveHtmlNode("foo")
         .ShouldHaveAttribute(HtmlAttribute.Multiple).WithValue(HtmlAttribute.Multiple);
 }
コード例 #35
0
 public void emailbox_list_renders_list()
 {
     var html = new EmailBox("foo").List("list1").ToString();
     html.ShouldHaveHtmlNode("foo")
         .ShouldHaveAttribute(HtmlAttribute.List).WithValue("list1");
 }
コード例 #36
0
 public void emailbox_without_multiple_does_not_render_multiple()
 {
     var html = new EmailBox("foo").Multiple(true).Multiple(false).ToString();
     html.ShouldHaveHtmlNode("foo")
         .ShouldNotHaveAttribute(HtmlAttribute.Multiple);
 }