Beispiel #1
0
        public void DeleteGroup()
        {
            LoginHelper login = new LoginHelper()
                                .DoLogin();

            HomePage loginResult = new HomePage();

            loginResult.ClickGroupsPageMenuLink();

            GroupsPage groupsPage = new GroupsPage();
            int        oldGroups  = groupsPage
                                    .CountGroups();

            groupsPage
            .SelectFirstGroup();
            groupsPage
            .ClickTopDeleteGroupButton();

            ConfirmGroupActionPage confirmGroupRemove = new ConfirmGroupActionPage();

            confirmGroupRemove
            .ClickReturnToGroupsPageLink();

            groupsPage = new GroupsPage();

            int newGroups = groupsPage
                            .CountGroups();

            Assert.True(newGroups == oldGroups - 1, "Group amounts are not matched");
            Console.WriteLine("One group was removed");

            LoginHelper signOut = new LoginHelper()
                                  .DoLogout();
        }
Beispiel #2
0
        public void AddNewGroup(string groupName, string groupHeader, string groupFooter, int groupsAmount)
        {
            LoginHelper login = new LoginHelper()
                                .DoLogin();

            HomePage loginResult = new HomePage();

            loginResult.ClickGroupsPageMenuLink();

            GroupsPage groupsPage = new GroupsPage();
            int        oldGroups  = groupsPage
                                    .CountGroups();

            for (int i = 0; i < groupsAmount; i++)
            {
                groupsPage
                .ClickTopNewGroupButton();
                CreateNewGroupPage createGroup = new CreateNewGroupPage()
                                                 .SetGroupName(groupName)
                                                 .SetGroupHeader(groupHeader)
                                                 .SetGroupFooter(groupFooter);
                createGroup
                .ClickSubmitGroupCreationButton();

                ConfirmGroupActionPage confirmGroupCreation = new ConfirmGroupActionPage();
                confirmGroupCreation
                .ClickReturnToGroupsPageLink();

                groupsPage = new GroupsPage();
            }

            int newGroups = groupsPage
                            .CountGroups();

            Assert.True(newGroups == oldGroups + groupsAmount, "Group amounts are not matched");
            Console.WriteLine($"{groupsAmount} groups were added");

            LoginHelper signOut = new LoginHelper()
                                  .DoLogout();
        }