public void ContactModificationTest()
        {
            app.Contact.CheckeContact();

            DataContact newData = new DataContact("ModificationFirstnameTest113");

            newData.Lastname = null;


            List <DataContact> oldContacts = DataContact.GetAllContact();
            DataContact        toBeRemoved = oldContacts[0];

            //DataContact oldData = oldContacts[0];

            app.Contact.ContactModification(newData);

            Assert.AreEqual(oldContacts.Count, app.Contact.GetContractCount());

            List <DataContact> newContacts = DataContact.GetAllContact();

            oldContacts[0].Firstname = newData.Firstname;
            oldContacts.Sort();
            newContacts.Sort();
            Assert.AreEqual(oldContacts.Count, newContacts.Count);

            foreach (DataContact contact in newContacts)
            {
                if (contact.IdContacts == toBeRemoved.IdContacts)
                {
                    Assert.AreEqual(newData.Firstname, contact.Firstname);
                }
            }
        }
Beispiel #2
0
        public void TestAddingContactToGroups()
        {
            app.Contact.CheckContacts();
            app.Group.CheckGroup();

            GroupData          group   = GroupData.GetAll()[0];
            List <DataContact> oldList = group.GetContacts();
            DataContact        contact = DataContact.GetAllContact().Except(oldList).First();

            for (int i = 0; i < oldList.Count(); i++)
            {
                if (oldList[i].IdContacts.Equals(contact.IdContacts))
                {
                    contact = new DataContact("test1");
                    app.Contact.ContactCreate(contact);
                    contact.IdContacts = app.Contact.GetContactId();
                }
            }

            //action

            app.Contact.addContactToGroup(contact, group);

            List <DataContact> newList = group.GetContacts();

            oldList.Add(contact);
            newList.Sort();
            oldList.Sort();

            Assert.AreEqual(oldList, newList);
        }
Beispiel #3
0
        public void TestContactOfDetailedInformation()
        {
            DataContact fromTable = app.Contact.GetContactInformationFromEditForm(0);
            DataContact fromForm  = app.Contact.GetContactInformationFromDetailed(0);

            //проверка равенства данных страницы редактирования и свойств контакта
            Assert.AreEqual(fromTable.allInformations, fromForm.allInformations);
        }
Beispiel #4
0
 public ContactHelper ContactCreate(DataContact group)
 {
     manager.Navigator.GoToAddNew();
     FillContractForm(group);
     SubmitContactCreation();
     ReturnToContactPage();
     return(this);
 }
Beispiel #5
0
 public void CheckeContact()
 {
     if (!IsElementPresent(By.XPath("//img[@alt='Edit']")))
     {
         DataContact group = new DataContact("Test"); // , "LastnameTest" если что верни обрано за скобки
         ContactCreate(group);
     }
 }
Beispiel #6
0
 public ContactHelper DeleteContactBD(DataContact contact)
 {
     manager.Navigator.GoToHome();
     SelectContact(contact.IdContacts);
     DeleteContact();
     AlertOk();
     manager.Navigator.GoToHome();
     return(this);
 }
Beispiel #7
0
        public ContactHelper ContactModification(DataContact newData)
        {
            manager.Navigator.GoToHome();
            SubmitContactMod();
            FillContractForm(newData);
            UpdateContactmodification();
            ReturnToContactPage();

            return(this);
        }
Beispiel #8
0
 public void DeleteContactFromFroup(DataContact contact, GroupData group)
 {
     manager.Navigator.GoToHomePage();
     GroupFilter(group.Name);
     SelectContactToGroups(contact.IdContacts);
     SelectContactToAdd(group.Name);
     RemoveContactFromGroup();
     new WebDriverWait(driver, TimeSpan.FromSeconds(10))
     .Until(d => d.FindElements(By.CssSelector("div.msgbox")).Count > 0);
 }
Beispiel #9
0
        public void TestContactInformation()
        {
            DataContact fromTable = app.Contact.GetContactInformationFromTable(0);
            DataContact fromForm  = app.Contact.GetContactInformationFromEditForm(0);

            //verification
            Assert.AreEqual(fromTable, fromForm);
            Assert.AreEqual(fromTable.Address, fromForm.Address);
            Assert.AreEqual(fromTable.AllPhones, fromForm.AllPhones);
            Assert.AreEqual(fromTable.AllEmails, fromForm.AllEmails);
        }
Beispiel #10
0
 public ContactHelper FillContractForm(DataContact group)
 {
     Type(By.Name("firstname"), group.Firstname);
     Type(By.Name("middlename"), group.Middlename);
     Type(By.Name("lastname"), group.Lastname);
     Type(By.Name("nickname"), group.Nickname);
     Type(By.Name("title"), group.Title);
     Type(By.Name("company"), group.Company);
     //Type(By.Name("address"), group.Address);
     return(this);
 }
Beispiel #11
0
        public void CheckContacts()
        {
            if (IsElementPresent(By.XPath("//img[@alt='Edit']")))
            {
                return;
            }

            DataContact contact = new DataContact("test1");

            ContactCreate(contact);

            manager.Navigator.GoToHomePage();
        }
Beispiel #12
0
        public void TestDBConnectivity()
        {
            DateTime           start  = DateTime.Now;
            List <DataContact> fromUi = app.Contact.GetContactList();
            DateTime           end    = DateTime.Now;

            System.Console.Out.WriteLine(end.Subtract(start));

            start = DateTime.Now;
            List <DataContact> fromDB = DataContact.GetAllContact();

            end = DateTime.Now;
            System.Console.Out.WriteLine(end.Subtract(start));
        }
Beispiel #13
0
        public void TestdeleteContactFromGroups()
        {
            GroupData          group   = GroupData.GetAll()[0];
            List <DataContact> oldList = group.GetContacts();
            DataContact        contact = DataContact.GetAllContact().First();

            //action

            app.Contact.DeleteContactFromFroup(contact, group);

            List <DataContact> newList = group.GetContacts();

            oldList.Add(contact);
            newList.Sort();
            oldList.Sort();

            Assert.AreNotEqual(oldList, newList);
        }
        public void TestDBConnectivity()
        {
            foreach (DataContact contact in DataContact.GetAllContact())
            //foreach (DataContact contact in GroupData.GetAll()[0].GetContacts())
            {
                System.Console.Out.WriteLine(contact.Deprecated);
            }

            //DateTime start = DateTime.Now;
            //List<GroupData> fromUi =  app.Group.GetGroupList();
            //DateTime end = DateTime.Now;
            //System.Console.Out.WriteLine(end.Subtract(start));

            //start = DateTime.Now;
            //List<GroupData> fromDB = GroupData.GetAll();
            //end = DateTime.Now;
            //System.Console.Out.WriteLine(end.Subtract(start));
        }
        public void ContactDeleteTest()
        {
            app.Contact.CheckeContact();

            List <DataContact> oldContacts = DataContact.GetAllContact();
            DataContact        toBeRemoved = oldContacts[0];

            app.Contact.DeleteContactBD(toBeRemoved);

            Assert.AreEqual(oldContacts.Count - 1, app.Contact.GetContractCount());

            List <DataContact> newContacts = DataContact.GetAllContact();

            oldContacts.RemoveAt(0);
            Assert.AreEqual(oldContacts, newContacts);

            foreach (DataContact contacts in newContacts)
            {
                Assert.AreNotEqual(contacts.IdContacts, toBeRemoved.IdContacts);
            }
        }
Beispiel #16
0
        public void ContactCreationTest(DataContact group)
        {
            //DataContact group = new DataContact("FirstnameTest1", "LastnameTest1");
            // group.Middlename = "MiddlenameTest";
            // group.Lastname = "LastnameTest";
            // group.Nickname = "NicknameTest";
            //group.Company = "CompanyTest";
            // group.Address = "AddressTest";

            List <DataContact> oldContacts = DataContact.GetAllContact();

            app.Contact.ContactCreate(group);

            Assert.AreEqual(oldContacts.Count + 1, app.Contact.GetContractCount());

            List <DataContact> newContacts = DataContact.GetAllContact();

            oldContacts.Add(group);
            oldContacts.Sort();
            newContacts.Sort();
            Assert.AreEqual(oldContacts, newContacts);
        }