コード例 #1
0
        public void ContactRemovalFromMainPageTest()
        {
            // prepare
            app.Contacts.IsContactCreate();
            List <EntryData> oldEntries  = app.Contacts.GetEntriesList();
            EntryData        toBeRemoved = oldEntries[0];

            // action
            app.Contacts.RemoveFromMainPage(0);

            Assert.AreEqual(oldEntries.Count - 1, app.Contacts.GetContactCount());

            List <EntryData> newEntries = app.Contacts.GetEntriesList();

            oldEntries.RemoveAt(0);
            oldEntries.Sort();
            newEntries.Sort();

            // verification
            Assert.AreEqual(oldEntries, newEntries);

            foreach (EntryData entry in newEntries)
            {
                Assert.AreEqual(entry.Id, toBeRemoved.Id);
            }
        }
コード例 #2
0
        public void TheAddressBookEntryEditTest()
        {
            app.Navigator.OpenHomePage();
            app.Auth.Login(new AccountData("admin", "secret"));
            app.Contacts.ClickToHomePage();
            app.Contacts.SelectContact(1);
            app.Contacts.ClickDetailsButton();
            app.Contacts.ClickModifyButton();
            EntryData entry = new EntryData("new Михаил");

            entry.Lastname   = "Трубицин new";
            entry.Middlename = "New";
            entry.Nickname   = "zzz автотестов";
            entry.Title      = "Это zzz";
            entry.Company    = "yyy компании";
            entry.Address    = "";
            entry.Home       = "1564df5g6";
            entry.Mobile     = "3df9iuh53789";
            entry.Work       = "4564";
            entry.Fax        = "3gdfg3";
            entry.Email      = "email1dfgil.ru";
            entry.Email2     = "emaildfgfdgil.ru";
            entry.Email3     = "emadfgfdgl.ru";
            entry.Homepage   = "wwwdfgfdgdfgpb.ru";
            entry.Address2   = "195000dfgdfgdfлотский переулок 12";
            entry.Phone2     = "81dfgfdg-456";
            entry.Notes      = "Комментарий dfgdfgне уверен точно";
            app.Contacts.FillEntryForm(entry);
            app.Contacts.ClickUpdateButton();
            app.Contacts.ClickToHomePage();
            app.Auth.Logout();
        }
コード例 #3
0
        public void ContactModifyFromDetailTest()
        {
            // prepare
            app.Contacts.IsContactCreate();

            List <EntryData> oldEntry = app.Contacts.GetEntriesList();
            EntryData        oldDate  = oldEntry[0];
            EntryData        newEntry = new EntryData("New Иван");

            newEntry.Lastname = "New Петров";

            // action
            app.Contacts.ModifyFromDetailTest(newEntry, 0);
            oldEntry[0].Firstname = newEntry.Firstname;
            oldEntry[0].Lastname  = newEntry.Lastname;

            Assert.AreEqual(oldEntry.Count, app.Contacts.GetContactCount());

            List <EntryData> newEntryMod = app.Contacts.GetEntriesList();

            oldEntry.Sort();
            newEntryMod.Sort();

            // verification
            foreach (EntryData entry in newEntryMod)
            {
                if (entry.Id == oldDate.Id)
                {
                    Assert.AreEqual(newEntry.Firstname, entry.Firstname);
                    Assert.AreEqual(newEntry.Lastname, entry.Lastname);
                }
            }
        }
コード例 #4
0
 public ContactHelper ModifyFromDetailTest(EntryData newEntry, int index)
 {
     TableDetails(index);
     DetailsModify();
     Modify(newEntry);
     return(this);
 }
コード例 #5
0
        public void TheAddressBookEntryCreationTest()
        {
            app.Navigator.OpenHomePage();
            app.Auth.Login(new AccountData("admin", "secret"));
            app.Navigator.GoToEntryPage();
            EntryData entry = new EntryData("Михаил");

            entry.Lastname   = "Трубицин";
            entry.Middlename = "Юрьевич";
            entry.Nickname   = "Король автотестов";
            entry.Title      = "Это заголовок";
            entry.Company    = "Название компании";
            entry.Address    = "344000 Ростов-на-Дону, Ворошиловский 15";
            entry.Home       = "+7-862-123-456";
            entry.Mobile     = "+7-987-123-04-05";
            entry.Work       = "02";
            entry.Fax        = "123456789";
            entry.Email      = "*****@*****.**";
            entry.Email2     = "*****@*****.**";
            entry.Email3     = "*****@*****.**";
            entry.Homepage   = "www.leningrad.spb.ru";
            entry.Address2   = "195000 Санкт-Петербург, Нейшлотский переулок 12";
            entry.Phone2     = "812-123-456";
            entry.Notes      = "Комментарий или замечание, или и то и другое. не уверен точно";
            app.Contacts.FillEntryForm(entry);
            app.Contacts.SubmitEntryCreation();
            app.Contacts.ReturnToEntryPage();
            app.Auth.Logout();
        }
コード例 #6
0
 public ContactHelper Create(EntryData entry)
 {
     FillNewEntryForm(entry);
     SubmitEntryCreation();
     ReturnToMainPage();
     return(this);
 }
コード例 #7
0
 public EntryHelper Modify(EntryData newEntryData)
 {
     manager.Navigator.OpenBasePage();
     EditEntry();
     FillEntryForm(newEntryData);
     PushButtonUpdate();
     return(this);
 }
コード例 #8
0
 public bool ContactModified(EntryData newEntry)
 {
     return(IsMainPage() &&
            driver.FindElement(By.CssSelector("#maintable > tbody > tr:nth-child(2) > td:nth-child(2)")).Text
            == newEntry.Lastname &&
            driver.FindElement(By.CssSelector("#maintable > tbody > tr:nth-child(2) > td:nth-child(3)")).Text
            == newEntry.Firstname);
 }
コード例 #9
0
 public EntryHelper EntryCreater(EntryData entryData)
 {
     manager.Navigator.GoToEtryPage();
     manager.Entry.FillEntryForm(entryData);
     manager.Navigator.PushButtonEnter();
     manager.Navigator.OpenBasePage();
     return(this);
 }
コード例 #10
0
 public ContactHelper Modify(EntryData entry)
 {
     //manager.Navigator.OpenHomePage();
     //IsContactCreate();
     FillNewEntryForm(entry);
     UpdatetEntry();
     ReturnToMainPage();
     return(this);
 }
コード例 #11
0
 public void FillEntryForm(EntryData entry)
 {
     driver.FindElement(By.Name("firstname")).Click();
     driver.FindElement(By.Name("firstname")).Clear();
     driver.FindElement(By.Name("firstname")).SendKeys(entry.Firstname);
     driver.FindElement(By.Name("middlename")).Click();
     driver.FindElement(By.Name("middlename")).Clear();
     driver.FindElement(By.Name("middlename")).SendKeys(entry.Middlename);
     driver.FindElement(By.Name("lastname")).Click();
     driver.FindElement(By.Name("lastname")).Clear();
     driver.FindElement(By.Name("lastname")).SendKeys(entry.Lastname);
     driver.FindElement(By.Name("nickname")).Click();
     driver.FindElement(By.Name("nickname")).Clear();
     driver.FindElement(By.Name("nickname")).SendKeys(entry.Nickname);
     driver.FindElement(By.Name("title")).Click();
     driver.FindElement(By.Name("title")).Clear();
     driver.FindElement(By.Name("title")).SendKeys(entry.Title);
     driver.FindElement(By.Name("company")).Click();
     driver.FindElement(By.Name("company")).Clear();
     driver.FindElement(By.Name("company")).SendKeys(entry.Company);
     driver.FindElement(By.Name("address")).Click();
     driver.FindElement(By.Name("address")).Clear();
     driver.FindElement(By.Name("address")).SendKeys(entry.Address);
     driver.FindElement(By.Name("home")).Click();
     driver.FindElement(By.Name("home")).Clear();
     driver.FindElement(By.Name("home")).SendKeys(entry.Home);
     driver.FindElement(By.Name("mobile")).Click();
     driver.FindElement(By.Name("mobile")).Clear();
     driver.FindElement(By.Name("mobile")).SendKeys(entry.Mobile);
     driver.FindElement(By.Name("work")).Click();
     driver.FindElement(By.Name("work")).Clear();
     driver.FindElement(By.Name("work")).SendKeys(entry.Work);
     driver.FindElement(By.Name("fax")).Click();
     driver.FindElement(By.Name("fax")).Clear();
     driver.FindElement(By.Name("fax")).SendKeys(entry.Fax);
     driver.FindElement(By.Name("email")).Click();
     driver.FindElement(By.Name("email")).Clear();
     driver.FindElement(By.Name("email")).SendKeys(entry.Email);
     driver.FindElement(By.Name("email2")).Click();
     driver.FindElement(By.Name("email2")).Clear();
     driver.FindElement(By.Name("email2")).SendKeys(entry.Email2);
     driver.FindElement(By.Name("email3")).Click();
     driver.FindElement(By.Name("email3")).Clear();
     driver.FindElement(By.Name("email3")).SendKeys(entry.Email3);
     driver.FindElement(By.Name("homepage")).Click();
     driver.FindElement(By.Name("homepage")).Clear();
     driver.FindElement(By.Name("homepage")).SendKeys(entry.Homepage);
     driver.FindElement(By.Name("address2")).Click();
     driver.FindElement(By.Name("address2")).Clear();
     driver.FindElement(By.Name("address2")).SendKeys(entry.Address2);
     driver.FindElement(By.Name("phone2")).Click();
     driver.FindElement(By.Name("phone2")).Clear();
     driver.FindElement(By.Name("phone2")).SendKeys(entry.Phone2);
     driver.FindElement(By.Name("notes")).Click();
     driver.FindElement(By.Name("notes")).Clear();
     driver.FindElement(By.Name("notes")).SendKeys(entry.Notes);
 }
コード例 #12
0
 public ContactHelper FillNewEntryForm(EntryData entry)
 {
     Type(By.Name("firstname"), entry.Firstname);
     Type(By.Name("lastname"), entry.Lastname);
     Type(By.Name("address"), entry.Address);
     Type(By.Name("email"), entry.Email);
     Type(By.Name("home"), entry.HomePhone);
     Type(By.Name("mobile"), entry.MobilePhone);
     Type(By.Name("work"), entry.WorkPhone);
     return(this);
 }
コード例 #13
0
        public void SelectEntry()
        {
            if (IsElementPresent(By.Name("selected[]")) == false)
            {
                EntryData entryData = new EntryData();
                entryData.Firstname = "Sidorov";
                entryData.Home      = "!!!!!!!!!!!!";
                entryData.Address   = "!!!!!!!!!!!!";
                entryData.Company   = "!!!!!!!!!!!!";
                entryData.Email     = "!!!!!!!!!!!!";

                manager.Entry.EntryCreater(entryData);
            }
            driver.FindElement(By.XPath("//input[@name='selected[]']")).Click();
        }
コード例 #14
0
 public void FillEntryForm(EntryData entryData)
 {
     Type(By.Name("firstname"), entryData.Firstname);
     Type(By.Name("lastname"), entryData.Lastname);
     Type(By.Name("nickname"), entryData.Nickname);
     Type(By.Name("company"), entryData.Company);
     Type(By.Name("address"), entryData.Address);
     Type(By.Name("home"), entryData.Home);
     Type(By.Name("middlename"), entryData.Middlename);
     Type(By.Name("mobile"), entryData.Mobile);
     Type(By.Name("work"), entryData.Work);
     Type(By.Name("fax"), entryData.Fax);
     Type(By.Name("email"), entryData.Email);
     Type(By.Name("homepage"), entryData.Homepage);
 }
コード例 #15
0
        public void TestContactInformation()
        {
            // prepare
            app.Contacts.IsContactCreate();

            // action
            EntryData fromTable = app.Contacts.GetContactInformationFromTable(0);
            EntryData fromForm  = app.Contacts.GetContactInformationFromEditform(0);

            //verification
            Assert.AreEqual(fromTable, fromForm);
            Assert.AreEqual(fromTable.Address, fromForm.Address);
            Assert.AreEqual(fromTable.Email, fromForm.Email);
            Assert.AreEqual(fromTable.AllPhones, fromForm.AllPhones);
        }
コード例 #16
0
 public void IsContactCreate()
 {
     manager.Navigator.OpenHomePage();
     if (!IsElementPresent(By.CssSelector("tr[name='entry']")))
     {
         manager.Navigator.GoToAddNewEntry();
         EntryData entry = new EntryData("Иван через if");
         entry.Lastname    = "Петров";
         entry.Address     = "РФ, г. Москва, ул. Ленина, дом 12, литер Б";
         entry.Email       = "*****@*****.**";
         entry.HomePhone   = "+7 (955) 158-15-45";
         entry.MobilePhone = "+75889562571";
         entry.WorkPhone   = "83435952566";
         Create(entry);
     }
 }
コード例 #17
0
        public void EntryModificationTest()
        {
            EntryData newEntryData = new EntryData();

            newEntryData.Firstname  = "newIvan";
            newEntryData.Middlename = "newIvanovich";
            newEntryData.Lastname   = "newIvanov";
            newEntryData.Nickname   = "newakIvan84";
            newEntryData.Company    = "newSVC";
            newEntryData.Address    = "newMoscow";
            newEntryData.Home       = "new1111111111";
            newEntryData.Mobile     = "new2222222222";
            newEntryData.Work       = "newengineer";
            newEntryData.Fax        = "new3333333333";
            newEntryData.Email      = "*****@*****.**";
            newEntryData.Homepage   = "newhttp://homepage/akIvan84";
            applicationManager.Entry.Modify(newEntryData);
        }
コード例 #18
0
        public void EntryCreationTest()
        {
            EntryData entryData = new EntryData();

            entryData.Firstname  = "Ivan";
            entryData.Middlename = "Ivanovich";
            entryData.Lastname   = "Ivanov";
            entryData.Nickname   = "akIvan84";
            entryData.Company    = "SVC";
            entryData.Address    = "Moscow";
            entryData.Home       = "1111111111";
            entryData.Mobile     = "2222222222";
            entryData.Work       = "engineer";
            entryData.Fax        = "3333333333";
            entryData.Email      = "*****@*****.**";
            entryData.Homepage   = "http://homepage/akIvan84";

            applicationManager.Entry.EntryCreater(entryData);
        }
コード例 #19
0
        public void ContactCreationWithLongEngNameTest()
        {
            // prepare
            List <EntryData> oldEntries = app.Contacts.GetEntriesList();

            app.Navigator.GoToAddNewEntry();
            EntryData entry = new EntryData("Persival");

            entry.Lastname = "Nottgertskingston";

            // action
            app.Contacts.Create(entry);

            Assert.AreEqual(oldEntries.Count + 1, app.Contacts.GetContactCount());

            List <EntryData> newEntries = app.Contacts.GetEntriesList();

            oldEntries.Add(entry);
            oldEntries.Sort();
            newEntries.Sort();

            // verification
            Assert.AreEqual(oldEntries, newEntries);
        }
コード例 #20
0
        public void ContactCreationTest()
        {
            // prepare
            List <EntryData> oldEntries = app.Contacts.GetEntriesList();

            app.Navigator.GoToAddNewEntry();
            EntryData entry = new EntryData("Иван");

            entry.Lastname = "Петров";

            // action
            app.Contacts.Create(entry);

            Assert.AreEqual(oldEntries.Count + 1, app.Contacts.GetContactCount());

            List <EntryData> newEntries = app.Contacts.GetEntriesList();

            oldEntries.Add(entry);
            oldEntries.Sort();
            newEntries.Sort();

            // verification
            Assert.AreEqual(oldEntries, newEntries);
        }
コード例 #21
0
        public void ContactModifyFromMainPageTest()
        {
            // prepare
            app.Contacts.IsContactCreate();
            List <EntryData> oldEntry = app.Contacts.GetEntriesList();

            app.Contacts.TableEdit(0);

            EntryData oldDate = oldEntry[0];

            EntryData newEntry = new EntryData("11");

            newEntry.Lastname = "22";

            // action
            app.Contacts.Modify(newEntry);
            oldEntry[0].Firstname = newEntry.Firstname;
            oldEntry[0].Lastname  = newEntry.Lastname;

            Assert.AreEqual(oldEntry.Count, app.Contacts.GetContactCount());

            List <EntryData> newEntryMod = app.Contacts.GetEntriesList();

            oldEntry.Sort();
            newEntryMod.Sort();

            // verification
            foreach (EntryData entry in newEntryMod)
            {
                if (entry.Id == oldDate.Id)
                {
                    Assert.AreEqual(newEntry.Firstname, entry.Firstname);
                    Assert.AreEqual(newEntry.Lastname, entry.Lastname);
                }
            }
        }