Exemplo n.º 1
0
    def test_adding_members_to_archived_organization(self):
        LoginPage(self).login('admin_user', 'password')
        page = OrganizationMemberListPage(self)
        page.go_to()
        OrganizationPage(self).go_to_organization_page()
        OrganizationPage(self).get_archive_button()
        OrganizationPage(self).click_on_archive_and_confirm()

        title = page.go_to_member_list_page()
        assert title == "Members".upper()
        page.click_on_add_button(success=False)
Exemplo n.º 2
0
    def test_editing_member_in_archived_organization(self):
        """A user that can create a new organization and
        is automatically made an admin."""

        LoginPage(self).login('admin_user', 'password')
        page = OrganizationMemberPage(self)
        page.go_to()
        OrganizationPage(self).go_to_organization_page()
        OrganizationPage(self).get_archive_button()
        OrganizationPage(self).click_on_archive_and_confirm()
        OrganizationMemberListPage(self).go_to_member_list_page()

        testuser_title = page.go_to_testuser_member_page(success=False)
        assert "MEMBER: Test User" != testuser_title
Exemplo n.º 3
0
    def test_changing_a_members_organizational_role(self):
        """An admin member can change a member's role in the organization."""

        LoginPage(self).login('admin_user', 'password')
        page = OrganizationMemberPage(self)
        page.go_to()
        OrganizationPage(self).go_to_organization_page()
        OrganizationMemberListPage(self).go_to_member_list_page()
        page.go_to_testuser_member_page()

        roles = page.get_role_options()
        assert roles["member"].text == roles["selected"].text

        page.try_cancel_and_close(page.click_admin_role_option, "role_admin")
        page.click_admin_role_option()
        roles['confirm_admin'].click()

        page.go_to_testuser_member_page()

        roles = page.get_role_options()
        assert roles["admin"].text == roles["selected"].text

        page.try_cancel_and_close(page.click_member_role_option, "role_member")
        page.click_member_role_option()
        roles['confirm_member'].click()

        page.go_to_testuser_member_page()

        roles = page.get_role_options()
        assert roles["member"].text == roles["selected"].text
Exemplo n.º 4
0
    def test_edit_organization(self):
        """A registered admin user can edit an organization's information."""
        LoginPage(self).login('admin_user', 'password')
        page = OrganizationPage(self)
        page.go_to()
        page.go_to_organization_page()

        page.click_on_edit_button()
        page.try_cancel_and_close()

        fields = page.get_fields()
        assert fields["name"].get_attribute("value") == "Organization #0"
        assert fields["description"].text == "This is a test."
        assert fields["urls"].text == ""

        fields["name"].clear()
        fields["name"].send_keys("Stark Enterprise")
        fields["description"].clear()
        fields["description"].send_keys("A technology company.")
        page.click_on_submit_button()

        name = self.page_title().text
        info = page.get_org_description_and_members()
        print(name)
        assert "Stark Enterprise".upper() in name
        assert "A technology company." in info
Exemplo n.º 5
0
    def test_registered_user_view(self):
        """A registered admin user can view the member list."""

        LoginPage(self).login('admin_user', 'password')
        page = OrganizationMemberListPage(self)
        page.go_to()
        OrganizationPage(self).go_to_organization_page()

        title = page.go_to_member_list_page()
        assert title == "Members".upper()
    def test_navigating_to_project_page(self):
        """A registered user can view an organization's project page."""

        LoginPage(self).login('testuser', 'password')
        page = OrganizationPage(self)
        page.go_to()
        page.go_to_organization_page()

        title = page.click_on_project()
        assert title == "Organization #0\nTest Project".upper()
Exemplo n.º 7
0
    def test_navigate_back_to_organization_list(self):
        """A user can click on the index-link
        and it takes them back to the organizations list."""

        LoginPage(self).login('testuser', 'password')
        page = OrganizationPage(self)
        page.go_to()
        page.go_to_organization_page()

        page.go_back_to_organization_list()
        page.get_org_list_title()
Exemplo n.º 8
0
    def test_getting_to_the_user_list(self):
        """A registered admin user can view an organization's member list,
        but a regular member can't."""

        LoginPage(self).login('testuser', 'password')
        page = OrganizationPage(self)
        page.go_to()
        page.go_to_organization_page()

        page.click_on_view_all_button(successful=False)
        url = self.get_url_path()
        assert "members" not in url
        self.logout()

        LoginPage(self).login('admin_user', 'password')
        page = OrganizationPage(self)
        page.go_to()
        page.go_to_organization_page()

        title = page.click_on_view_all_button()
        assert title == "Members".upper()
Exemplo n.º 9
0
    def test_removing_an_admin_member_from_an_organization(self):
        """An admin member can remove a member from an organization."""

        LoginPage(self).login('admin_user', 'password')
        page = OrganizationMemberPage(self)
        page.go_to()
        OrganizationPage(self).go_to_organization_page()
        OrganizationMemberListPage(self).go_to_member_list_page()
        page.go_to_admin_member_page()

        assert page.get_member_title() == "MEMBER: Admin User"

        page.click_disabled_remove_button()
        assert page.get_member_title() == "MEMBER: Admin User"
Exemplo n.º 10
0
    def test_changing_an_admins_organizational_role(self):
        """An admin member can change a member's role in the organization."""

        LoginPage(self).login('admin_user', 'password')
        page = OrganizationMemberPage(self)
        page.go_to()
        OrganizationPage(self).go_to_organization_page()
        OrganizationMemberListPage(self).go_to_member_list_page()
        page.go_to_admin_member_page()

        role_select = page.get_member_role_select('')
        assert role_select.get_attribute('disabled')
        roles = page.get_role_options()
        assert roles["admin"].text == roles["selected"].text
Exemplo n.º 11
0
    def test_organization_view(self):
        """A registered user can view an organization's dashboard.
           Org description and users are displayed."""

        LoginPage(self).login('admin_user', 'password')
        page = OrganizationPage(self)
        page.go_to()
        page.go_to_organization_page()

        info = page.get_org_description_and_members()
        assert "This is a test." in info
        assert "Test User" in info
        assert "Username: testuser" in info
        self.logout()

        LoginPage(self).login('testuser', 'password')
        page = OrganizationPage(self)
        page.go_to()
        page.go_to_organization_page()

        info = page.get_org_description_and_members()
        assert "This is a test." in info
        assert "Test User" in info
        assert "Username: testuser" in info
Exemplo n.º 12
0
    def test_archiving_organization(self):
        """A registered admin user can archive/unarchive an organization."""
        LoginPage(self).login('admin_user', 'password')
        page = OrganizationPage(self)
        page.go_to()
        page.go_to_organization_page()

        page.try_cancel_and_close_archive()
        page.get_archive_button()

        archive = page.click_on_archive_and_confirm()
        assert archive == "Unarchive organization"

        archive = page.click_on_archive_and_confirm(unarchive=True)
        assert archive == "Archive organization"
Exemplo n.º 13
0
    def test_new_organization_view(self):
        """An organization without projects has a different view for its
        creator.

        """

        LoginPage(self).login('testuser', 'password')
        page = OrganizationPage(self)
        page.go_to()
        page.go_to_organization_page(new=True)

        welcome = page.get_welcome_message()
        assert "You're ready to go" in welcome

        title = page.click_add_new_project_button()
        assert title == "ADD NEW PROJECT"
    def test_adding_members(self):
        """A registered admin user can add members to an organization."""

        LoginPage(self).login('admin_user', 'password')
        page = OrganizationMemberListPage(self)
        page.go_to()
        OrganizationPage(self).go_to_organization_page()
        page.go_to_member_list_page()

        page.click_on_add_button()
        page.try_cancel_and_close()

        fields = page.get_fields()
        page.try_submit(err=['member'])

        fields = page.get_fields()
        fields['member'].send_keys("darthvader")
        page.try_submit(
            err=['member'],
            message='User with username or email darthvader does not exist')

        fields = page.get_fields()
        fields['member'].clear()
        fields['member'].send_keys("admin_user")
        page.try_submit(
            err=['member'],
            message='User is already a member of the organization.')

        fields = page.get_fields()
        fields['member'].clear()
        fields['member'].send_keys("hansolo")
        page.try_submit()

        member = page.get_member_name()
        assert member == "MEMBER: Han Solo"

        OrganizationMemberPage(self).click_remove_member_and_confirm_buttons()

        page.click_on_add_button()

        fields = page.get_fields()
        fields['member'].clear()
        fields['member'].send_keys("*****@*****.**")
        page.try_submit()

        member = page.get_member_name()
        assert member == "MEMBER: Han Solo"
Exemplo n.º 15
0
    def test_removing_a_member_from_an_organization(self):
        """An admin member can remove a member from an organization."""

        LoginPage(self).login('admin_user', 'password')
        page = OrganizationMemberPage(self)
        page.go_to()
        OrganizationPage(self).go_to_organization_page()
        OrganizationMemberListPage(self).go_to_member_list_page()
        page.go_to_testuser_member_page()

        page.try_cancel_and_close()
        assert page.get_member_title() == "MEMBER: Test User"

        page.click_remove_member_and_confirm_buttons()

        members = page.get_table_row().text
        assert "Test User" not in members
Exemplo n.º 16
0
    def test_that_an_individual_members_information_displays(self):
        """The organization's individual member page
        displays with the correct user information."""

        LoginPage(self).login('admin_user', 'password')
        page = OrganizationMemberPage(self)
        page.go_to()
        OrganizationPage(self).go_to_organization_page()
        OrganizationMemberListPage(self).go_to_member_list_page()

        testuser_title = page.go_to_testuser_member_page()
        assert "MEMBER: Test User" == testuser_title

        member_form = page.get_displayed_member_info()

        assert "Test User" in member_form.text
        assert "testuser" in member_form.text
        assert "*****@*****.**" in member_form.text
        assert "Last login:" in member_form.text
Exemplo n.º 17
0
    def test_changing_a_members_organizational_role(self):
        """An admin member can change a member's role in the organization."""

        LoginPage(self).login('admin_user', 'password')
        page = OrganizationMemberPage(self)
        page.go_to()
        OrganizationPage(self).go_to_organization_page()
        OrganizationMemberListPage(self).go_to_member_list_page()
        page.go_to_testuser_member_page()

        roles = page.get_role_options()
        assert roles["member"].text == roles["selected"].text

        roles["admin"].click()
        page.click_submit_button()
        page.go_to_testuser_member_page()

        roles = page.get_role_options()
        assert roles["admin"].text == roles["selected"].text
Exemplo n.º 18
0
    def test_adding_members(self):
        """A registered admin user can add members to an organization."""

        LoginPage(self).login('admin_user', 'password')
        page = OrganizationMemberListPage(self)
        page.go_to()
        OrganizationPage(self).go_to_organization_page()
        page.go_to_member_list_page()

        page.click_on_add_button()
        page.try_cancel_and_close()

        input_box = page.click_on_input()
        error_list = page.click_submit_button(success=False)
        assert error_list == 'This field is required.'

        input_box = page.click_on_input()
        input_box.send_keys("darthvader")
        error_list = page.click_submit_button(success=False)
        error_message = 'User with username or email darthvader does not exist'
        assert error_list == error_message

        input_box = page.click_on_input()
        input_box.clear()
        input_box.send_keys("admin_user")
        error_list = page.click_submit_button(success=False)
        error_message = 'User is already a member of the organization.'
        assert error_list == error_message

        input_box = page.click_on_input()
        input_box.clear()
        input_box.send_keys("hansolo")
        member = page.click_submit_button()
        assert member == "MEMBER: Han Solo"

        OrganizationMemberPage(self).click_remove_member_and_confirm_buttons()

        page.click_on_add_button()
        input_box = page.click_on_input()
        input_box.send_keys("*****@*****.**")
        member = page.click_submit_button()
        assert member == "MEMBER: Han Solo"
Exemplo n.º 19
0
    def test_changing_member_project_permissions(self):
        """An admin user can change a member's permissions
        on individual projects."""

        LoginPage(self).login('admin_user', 'password')
        page = OrganizationMemberPage(self)
        page.go_to()
        OrganizationPage(self).go_to_organization_page()
        OrganizationMemberListPage(self).go_to_member_list_page()
        page.go_to_testuser_member_page()

        first_project = page.get_project_title_in_table()
        assert first_project == 'Test Project'
        options = page.get_permission_options()
        assert options['selected'].text == options['pb'].text
        options['pm'].click()

        page.click_submit_button()
        page.go_to_testuser_member_page()

        options = page.get_permission_options()
        assert options['selected'].text == options['pm'].text