public GroupHelper FillGroupForm(GroupFormData group)
 {
     Type(By.Name("group_name"), group.Name);
     Type(By.Name("group_header"), group.Header);
     Type(By.Name("group_footer"), group.Footer);
     return(this);
 }
Exemple #2
0
        public void GroupModication()
        {
            var       newData            = new GroupBuilder().Build();
            const int groupToModifyIndex = 1;

            List <GroupFormData> oldGroups = GroupFormData.GetAllGroups();
            GroupFormData        oldData   = oldGroups[0];

            app.Groups.Modify(oldData, newData);

            Assert.AreEqual(oldGroups.Count, app.Groups.GetGroupCount());

            List <GroupFormData> newGroups = GroupFormData.GetAllGroups();

            oldGroups[0].Name = newData.Name;
            oldGroups.Sort();
            newGroups.Sort();
            Assert.AreEqual(oldGroups, newGroups);

            foreach (GroupFormData group in newGroups)
            {
                if (group.Id == oldData.Id)
                {
                    Assert.AreEqual(newData.Name, group.Name);
                }
            }
        }
 public GroupHelper Create(GroupFormData group)
 {
     manager.Navigator.GoToGroupsPage();
     InitGroupCreation();
     FillGroupForm(group);
     SubmitGroupCreation();
     ReturnToGroupsPage();
     return(this);
 }
        public GroupHelper Remove(GroupFormData group)
        {
            manager.Navigator.GoToGroupsPage();

            CreateGroupIfNotExist();

            SelectGroup(group.Id);
            RemoveGroup();
            ReturnToGroupsPage();
            return(this);
        }
Exemple #5
0
 public void CompareGroupsUI_DB()
 {
     if (PERFORM_LONG_UI_CHECKS)
     {
         List <GroupFormData> fromUI = app.Groups.GetGroupList();
         List <GroupFormData> FromDB = GroupFormData.GetAllGroups();
         fromUI.Sort();
         FromDB.Sort();
         Assert.AreEqual(fromUI, FromDB);
     }
 }
        public GroupHelper Modify(GroupFormData oldData, GroupFormData newData)
        {
            manager.Navigator.GoToGroupsPage();

            CreateGroupIfNotExist();

            SelectGroup(oldData.Id);
            InitGroupModification();
            FillGroupForm(newData);
            SubmitGroupModification();
            ReturnToGroupsPage();
            return(this);
        }
Exemple #7
0
        public void TestDBConnectivity()
        {
            DateTime             start  = DateTime.Now;
            List <GroupFormData> fromUi = app.Groups.GetGroupList();
            DateTime             finish = DateTime.Now;

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

            start = DateTime.Now;
            List <GroupFormData> fromDB = GroupFormData.GetAllGroups();

            finish = DateTime.Now;
            System.Console.Out.WriteLine(finish.Subtract(start));
        }
Exemple #8
0
        public void NewGroupFromJsonFile(GroupFormData newGroup)
        {
            List <GroupFormData> oldGroups = app.Groups.GetGroupList();

            app.Groups.Create(newGroup);

            Assert.AreEqual(oldGroups.Count + 1, app.Groups.GetGroupCount());

            List <GroupFormData> newGroups = app.Groups.GetGroupList();

            oldGroups.Add(newGroup);
            oldGroups.Sort();
            newGroups.Sort();
            Assert.AreEqual(oldGroups, newGroups);
        }
Exemple #9
0
        public void NewGroup()
        {
            List <GroupFormData> oldGroups = GroupFormData.GetAllGroups();

            var newGroup = new GroupBuilder().Build();

            app.Groups.Create(newGroup);

            Assert.AreEqual(oldGroups.Count + 1, app.Groups.GetGroupCount());

            List <GroupFormData> newGroups = GroupFormData.GetAllGroups();

            oldGroups.Add(newGroup);
            oldGroups.Sort();
            newGroups.Sort();
            Assert.AreEqual(oldGroups, newGroups);
        }
        public void GroupRemove()
        {
            const int groupToRemoveIndex = 1;

            List <GroupFormData> oldGroups   = GroupFormData.GetAllGroups();
            GroupFormData        toBeRemoved = oldGroups[0];

            app.Groups.Remove(toBeRemoved);

            Assert.AreEqual(oldGroups.Count - 1, app.Groups.GetGroupCount());

            List <GroupFormData> newGroups = GroupFormData.GetAllGroups();

            oldGroups.RemoveAt(0);
            oldGroups.Sort();
            newGroups.Sort();

            Assert.AreEqual(oldGroups, newGroups);

            foreach (GroupFormData group in newGroups)
            {
                Assert.AreNotEqual(group.Id, toBeRemoved.Id);
            }
        }
Exemple #11
0
 public GroupBuilder()
 {
     this.group = CreateGroupDefaultModel();
 }