Ejemplo n.º 1
0
 def link_org(self):
     self.objboard = Board()
     self.org_id = self.objboard.create_organisation()
     self.board_response = self.objboard.create_board(self.org_id)
     self.board_id = self.objboard.get_board_id(self.board_response)
     yield
     self.objorganisation = Organisation()
     self.objboard.delete_board(self.board_id)
     self.objorganisation.delete_organisation(self.org_id)
Ejemplo n.º 2
0
    def test_status_code_when_name_field_is_empty(self):
        objlist = Lists()
        objboard = Board()
        objorganisation = Organisation()
        org_id = objlist.organisation()
        board_id = objlist.board(org_id)

        negative_list_response = objlist.set_name_field_empty(board_id)
        objboard.delete_board(board_id)
        objorganisation.delete_organisation(org_id)
        try:
            assert negative_list_response == constant.negative_case
        except:
            logger.error(" in list it runs with blank name input")
Ejemplo n.º 3
0
    def list_fixture(self):
        self.objlist = Lists()
        self.objboard = Board()
        self.objorganisation = Organisation()
        self.org_id = self.objlist.organisation()
        self.board_id = self.objlist.board(self.org_id)

        self.list_response = self.objlist.create_list_using_post_api(
            self.board_id)
        self.list_id = self.objlist.list_id(self.list_response)
        yield

        self.objboard.delete_board(self.board_id)
        self.objorganisation.delete_organisation(self.org_id)
Ejemplo n.º 4
0
class TestBoard:
    @pytest.yield_fixture()
    def link_org(self):
        self.objboard = Board()
        self.org_id = self.objboard.create_organisation()
        self.board_response = self.objboard.create_board(self.org_id)
        self.board_id = self.objboard.get_board_id(self.board_response)
        yield
        self.objorganisation = Organisation()
        self.objboard.delete_board(self.board_id)
        self.objorganisation.delete_organisation(self.org_id)

    @pytest.mark.usefixtures('link_org')
    def test_success_creation_of_board_with_status_code(self):
        status_code = self.objboard.get_board_status_code(self.board_response)
        try:
            assert status_code == constant.test_successful
        except:
            logger.error('Board not created')

    @pytest.mark.usefixtures('link_org')
    def test_username_is_updated_or_not_using_put_api(self):
        updatedname = self.objboard.update_board_using_put(self.board_id)

        board_name = self.objboard.get_board_name(self.board_response)

        try:
            assert updatedname != board_name
        except:
            logger.error("Board name not updated")

    @pytest.mark.usefixtures('link_org')
    def test_board_username_field_is_empty(self):
        try:
            assert self.objboard.name_empty_board(
                self.org_id) == constant.negative_case
        except:
            logger.error("Name is not empty")

    @pytest.mark.usefixtures('link_org')
    def test_board_label_color_changed_or_not(self):
        try:
            assert self.objboard.create_labels_in_the_board(
                self.board_id) == constant.color
        except:
            logger.error("color of label not changed please check")

    @pytest.mark.usefixtures('link_org')
    def test_check_list_in_the_board(self):
        try:
            assert self.objboard.get_info_about_create_list_inboard(
                self.board_id) == constant.test_successful
        except:
            logger.error("list can not be checked in board")

    @pytest.mark.usefixtures('link_org')
    def test_side_bar_created_or_not(self):
        try:
            assert self.objboard.show_sidebar_in_board_put(
                self.board_id) == constant.test_successful
        except:
            logger.error("sidebar is created in false value")

    @pytest.mark.usefixtures('link_org')
    def test_email_key_is_generated_or_not(self):
        try:
            assert self.objboard.get_api_board_email_key_generated(
                self.board_id) == constant.test_successful
        except:
            logger.error('in board email key is not generated')
Ejemplo n.º 5
0
class TestLists:
    @pytest.yield_fixture()
    def list_fixture(self):
        self.objlist = Lists()
        self.objboard = Board()
        self.objorganisation = Organisation()
        self.org_id = self.objlist.organisation()
        self.board_id = self.objlist.board(self.org_id)

        self.list_response = self.objlist.create_list_using_post_api(
            self.board_id)
        self.list_id = self.objlist.list_id(self.list_response)
        yield

        self.objboard.delete_board(self.board_id)
        self.objorganisation.delete_organisation(self.org_id)

    @pytest.mark.usefixtures('list_fixture')
    def test_creation_of_list(self):
        response = self.objlist.create_list_using_post_api(self.board_id)
        try:
            assert response.status_code == constant.test_successful
        except:
            logger.error("list not created succesfully")

    def test_status_code_when_name_field_is_empty(self):
        objlist = Lists()
        objboard = Board()
        objorganisation = Organisation()
        org_id = objlist.organisation()
        board_id = objlist.board(org_id)

        negative_list_response = objlist.set_name_field_empty(board_id)
        objboard.delete_board(board_id)
        objorganisation.delete_organisation(org_id)
        try:
            assert negative_list_response == constant.negative_case
        except:
            logger.error(" in list it runs with blank name input")

    @pytest.mark.usefixtures('list_fixture')
    def test_check_position_is_changed_or_not(self):
        changed_pos = self.objlist.create_list_using_post_api(self.list_id)
        actual_pos = self.objlist.position_of_the_list(self.list_response)
        try:
            assert changed_pos != actual_pos
        except:
            logger.error("in list position not changed")

    @pytest.mark.usefixtures('list_fixture')
    def test_name_is_updated_or_not(self):
        updated_name = self.objlist.updated_name_of_the_list(self.list_id)
        actual_name = self.objlist.list_name(self.list_response)
        try:
            assert updated_name != actual_name
        except:
            logger.error("list name not updated")

    @pytest.mark.usefixtures('list_fixture')
    def test_put_close_archive_the_list(self):
        try:
            assert self.objlist.close_list_by_putclose_api(
                self.list_id) == constant.true
        except:
            logger.error("in list request not archived")

    @pytest.mark.usefixtures('list_fixture')
    def test_softlimit_status_code_run_or_not_running(self):
        try:
            assert self.objlist.set_soft_limit_of_card(self.list_id)
        except:
            logger.error("in list softlimit cannot be updated")

    @pytest.mark.usefixtures('list_fixture')
    def test_subscription_api_status_code(self):
        try:
            assert self.objlist.subscription_detail(
                self.list_id) == constant.test_successful
        except:
            logger.error("in list subscription not done")

    @pytest.mark.usefixtures('list_fixture')
    def test_subscription_boolien_value_the_list_is_subscribed_or_not(self):
        try:
            assert self.objlist.get_api_to_check_sybscription_in_field(
                self.list_id) == constant.true
        except:
            logger.error("in list channel is not subscribed")

    @pytest.mark.usefixtures('list_fixture')
    def test_get_board_gives_information_about_board_in_which_list_is_present(
            self):
        try:
            assert self.objlist.get_api_check_board_information(
                self.list_id) == constant.test_successful
        except:
            logger.error("information cannot be fatched")

    @pytest.mark.usefixtures('list_fixture')
    def test_get_all_information_about_cards(self):
        try:
            assert self.objlist.get_list_of_card_in_a_list(
                self.list_id) == constant.test_successful

        except:
            logger.error("list card information cannot fetched")
Ejemplo n.º 6
0
 def board(self, org_id):
     objboard = Board()
     board_response = objboard.create_board(org_id)
     board_id = objboard.get_board_id(board_response)
     return board_id
Ejemplo n.º 7
0
 def organisation(self):
     objboard = Board()
     org_id = objboard.create_organisation()
     return org_id
Ejemplo n.º 8
0
class TestCard:
    @pytest.yield_fixture()
    def card_fixture(self):
        self.objcard = Card()
        self.objlist = Lists()
        self.objboard = Board()
        self.objorganisation = Organisation()
        self.org_id = self.objlist.organisation()
        self.board_id = self.objlist.board(self.org_id)

        self.list_response = self.objlist.create_list_using_post_api(
            self.board_id)
        self.list_id = self.objlist.list_id(self.list_response)
        self.card_response = self.objcard.create_card_in_list(self.list_id)
        self.card_id = self.objcard.get_card_id(self.card_response)
        yield

        self.objboard.delete_board(self.board_id)
        self.objorganisation.delete_organisation(self.org_id)

    @pytest.mark.usefixtures('card_fixture')
    def test_card_is_created_or_not(self):
        try:
            assert self.card_response.status_code == constant.test_successful
        except:
            logger.error("card not created")

    @pytest.mark.usefixtures('card_fixture')
    def test_delete_of_card_is_happened(self):
        try:
            assert self.objcard.delete_card_using_delete_api(
                self.card_id) == constant.test_successful
        except:
            logger.error("card not deleted")

    @pytest.mark.usefixtures('card_fixture')
    def test_action_comment_added_to_card(self):
        try:
            assert self.objcard.add_action_api_comment_on_card(
                self.card_id) == constant.test_successful
        except:
            logger.error("card comment not added")

    @pytest.mark.usefixtures('card_fixture')
    def test_color_change_of_card_using_label(self):
        try:
            assert self.objcard.post_change_color_of_card(
                self.card_id) == constant.color
        except:
            logger.error("card color not changed")

    @pytest.mark.usefixtures('card_fixture')
    def test_mark_associated_notification_read(self):
        try:
            assert self.objcard.mark_associated_notifications_read(
                self.card_id) == constant.test_successful
        except:
            logger.error("card notification is not readable")

    @pytest.mark.usefixtures('card_fixture')
    def test_name_updation_of_card_in_put_api(self):
        try:
            assert self.objcard.update_name_using_put(
                self.card_id) != self.objcard.get_card_name(self.card_response)
        except:
            logger.error("card name can not be updated ")

    @pytest.mark.usefixtures('card_fixture')
    def test_position_of_card_using_get_api(self):
        try:
            ##we also use status_code here to check api is working properly
            assert self.objcard.get_position_of_card_using_field(
                self.card_id) == constant.position
        except:
            logger.error('card position is not available')

    @pytest.mark.usefixtures('card_fixture')
    def test_list_in_which_card_is_present(self):
        try:
            assert self.objcard.get_list_in_which_card_is_present(
                self.card_id) == constant.test_successful
        except:
            logger.error("in card list of card not available")

    @pytest.mark.usefixtures('card_fixture')
    def test_when_name_field_is_empty(self):
        try:
            assert self.objcard.name_field_is_empty() == constant.negative_case
        except:
            logger.error("name field is not empty here")