def test_user_can_resolve_request(self):
        user1 = User(user_1)
        user2 = User(user_2)
        request_text = self.execute_date + 'test_user_can_dismiss_request'
        sess = self.sess

        ApiMethods(sess).login_as_user(user2)
        request_payload = RequestPayload(
            [user1], text=request_text).generate_request_data()

        (ApiMethods(sess).send_request(request_payload.json))

        (LoginPage().open().login(user1.email, user1.password))
        time.sleep(1)

        rq = RequestsPage().open().get_request_by_text(request_text)
        rq.send_feedback_button.click()

        FeedbackRequestPopup().feedback_request_popup.should(be.visible)

        (FeedbackRequestPopup().type_text(
            request_text).click_send_feedback_button())

        fb = FeedbackPage().open_sent().get_feedback_by_text(request_text)
        assert fb is not None
Esempio n. 2
0
    def test_feedback_form_opens_from_feedback_page(self):

        user2 = User(user_2)

        (FeedbackPage().click_send_feedback().feedback_request_popup.should(
            be.visible))

        (FeedbackRequestPopup().send_feedback_button.should_not(be.enabled))

        (FeedbackRequestPopup().add_value().value_added.should(be.visible))

        (FeedbackRequestPopup().add_template_to_feedback().text_input.
         should_not(be.empty))

        (FeedbackRequestPopup().type_recipient(
            user2.full_name).recipient_added.should(be.visible))

        (FeedbackRequestPopup().make_public().send_feedback_button.should(
            have.text('public')))

        (FeedbackRequestPopup().make_private().send_feedback_button.should(
            have.text('private')))

        (FeedbackRequestPopup().text_input.send_keys('test'))

        (FeedbackRequestPopup().send_feedback_button.should(be.enabled))

        (FeedbackRequestPopup().close().feedback_request_popup.should_not(
            be.visible))
    def test_user_can_send_public_feedback_to_team(self):

        user = User(user_1)
        team = Team(team_34)
        feedback_text = self.execute_date + 'test_user_can_send_public_feedback_to_team'

        LoginPage().open().login(user.email, user.password)

        FeedbackPage().send_feedback_button.click()

        (FeedbackRequestPopup()
         .type_recipient(team.name)
         .make_public()
         .add_text(feedback_text)
         .click_send_feedback_button())

        fb = FeedbackPage().open_sent().get_feedback_by_text(feedback_text)
        assert fb is not None

        fb.people.should(have.text('firstname1'))
        fb.people.should(have.text('team'))
        fb.to_praise_link.should(have.text('Added to praise'))

        fb = FeedbackPage().open_added_to_praise().get_feedback_by_text(feedback_text)
        assert fb is not None
    def test_user_can_send_private_feedback_to_user(self):

        user1 = User(user_1)
        user2 = User(user_2)
        feedback_text = self.execute_date + 'test_user_can_send_private_feedback_to_user'

        LoginPage().open().login(user1.email, user1.password)

        FeedbackPage().send_feedback_button.click()

        (FeedbackRequestPopup()
         .type_recipient(user2.full_name)
         .add_value()
         .add_template_to_feedback()
         .add_text(feedback_text)
         .click_send_feedback_button())

        fb = FeedbackPage().open_sent().get_feedback_by_text(feedback_text)

        assert fb is not None

        fb.value.should(be.visible)
        fb.people.should(have.text('firstname1'))
        fb.people.should(have.text('firstname2'))
        fb.to_praise_link.should(have.text('Add to praise'))
        fb.flag_link.should(have.text('Flag for follow-up'))

        fb = FeedbackPage().open_added_to_praise().get_feedback_by_text(feedback_text)

        assert fb is None
    def test_user_can_send_request(self):
        request_text = self.execute_date + 'test_user_can_send_request'
        user1 = User(user_1)
        user2 = User(user_2)

        (LoginPage().open().login(user1.email, user1.password))
        time.sleep(1)
        browser.open_url(REQUEST_PAGE_URL)

        RequestsPage().request_feedback_button.click()

        (FeedbackRequestPopup().type_recipient(user2.full_name).type_text(
            request_text).click_send_request_button())

        RequestsPage().open()
        rq = RequestsPage().open_sent().get_request_by_text(request_text)
        assert rq is not None
Esempio n. 6
0
 def click_request_feedback_button(self):
     self.request_feedback_button.click()
     return FeedbackRequestPopup()
Esempio n. 7
0
 def click_send_feedback_button(self):
     self.send_feedback_button.click()
     return FeedbackRequestPopup()
Esempio n. 8
0
    def test_user_can_create_and_answer_survey_with_all_question_types(self):
        user1 = User(user_1)
        title = 'test_types ' + self.execute_date
        question_text_public = 'text_public ' + self.execute_date
        question_text_anonym = 'text_anonym ' + self.execute_date
        question_rating_public = 'rating_public ' + self.execute_date
        question_rating_anonym = 'rating_anonym ' + self.execute_date
        LoginPage().open().login_as_user(user1)
        time.sleep(0.1)
        SurveyPage().open().create_new_survey_button.click()

        (SurveyPopup().create_empty().type_name(title).add_question().
         add_question().add_question().get_question_by_id().type_question(
             question_text_public))

        (SurveyPopup().get_question_by_id(1).type_question(
            question_text_anonym).choose_anonymous_option())

        (SurveyPopup().get_question_by_id(2).type_question(
            question_rating_public).choose_rating_option())

        (SurveyPopup().get_question_by_id(3).type_question(
            question_rating_anonym).choose_rating_option().
         choose_anonymous_option())

        SurveyPopup().run_now()
        time.sleep(0.5)

        survey = SurveyPage().get_survey_by_text(title)
        assert survey is not None
        sess = self.sess
        ApiMethods(sess).login_as_user(user1)
        survey = ApiMethods(sess).get_survey_by_title(title)
        assert survey is not None
        assert len(survey.questions) == 4
        assert survey.questions[0]['type'] == 2
        assert survey.questions[0]['is_anonymous'] is None
        assert survey.questions[1]['type'] == 2
        assert survey.questions[1]['is_anonymous'] is True
        assert survey.questions[2]['type'] == 1
        assert survey.questions[2]['is_anonymous'] is None
        assert survey.questions[3]['type'] == 1
        assert survey.questions[3]['is_anonymous'] is True

        request = RequestsPage().open().get_request_by_text(
            question_text_public)
        assert request is not None

        request.send_feedback_button.click()

        FeedbackRequestPopup().feedback_request_popup.should(be.visible)

        FeedbackRequestPopup().type_text('answer text public')
        time.sleep(0.2)
        FeedbackRequestPopup().click_send_feedback_button()
        time.sleep(0.2)
        FeedbackRequestPopup().type_text('answer text anonym')
        time.sleep(0.2)
        FeedbackRequestPopup().click_send_feedback_button()
        time.sleep(0.2)
        FeedbackRequestPopup().click_rating_item(0)
        time.sleep(1)
        FeedbackRequestPopup().click_rating_item(1)
        time.sleep(0.2)
        FeedbackRequestPopup().feedback_request_popup.should_not(be.visible)

        FeedbackPage().open_sent()
        time.sleep(0.5)
        f = FeedbackPage().get_survey_answer_by_text(question_text_public)
        assert f is not None
        f = FeedbackPage().get_survey_answer_by_text(question_text_anonym)
        assert f is not None
        f = FeedbackPage().get_survey_answer_by_text(question_rating_public)
        assert f is not None
        f = FeedbackPage().get_survey_answer_by_text(question_rating_anonym)
        assert f is not None
Esempio n. 9
0
 def test_request_form_opens_from_team_page(self):
     TeamsPage().open().get_team_row_by_id().send_feedback_button.click()
     FeedbackRequestPopup().feedback_request_popup.should(be.visible)
Esempio n. 10
0
 def test_request_form_opens_from_teammate_page(self):
     TeammatePage().open_by_user_id(
         User(user_2).id).click_request_feedback_button()
     FeedbackRequestPopup().feedback_request_popup.should(be.visible)
Esempio n. 11
0
 def test_request_form_opens_from_people_page(self):
     PeoplePage().open().get_teammate_row_by_id(
     ).request_feedback_button.click()
     FeedbackRequestPopup().feedback_request_popup.should(be.visible)
 def request_feedback_by_id(self, id=0):
     self.get_teammate_by_id(id).element(
         SIDEBAR_TEAMMATE_REQUEST_BUTTON).click()
     return FeedbackRequestPopup()
 def send_feedback_by_id(self, id=0):
     self.get_teammate_by_id(id).element(
         SIDEBAR_TEAMMATE_FEEDBACK_BUTTON).click()
     return FeedbackRequestPopup()
 def request_feedback_from_user(self, user):
     t = self.get_teammate_by_name(user)
     t.element(SIDEBAR_TEAMMATE_REQUEST_BUTTON).click()
     return FeedbackRequestPopup()
 def send_feedback_to_user(self, user):
     t = self.get_teammate_by_name(user)
     t.element(SIDEBAR_TEAMMATE_FEEDBACK_BUTTON).click()
     return FeedbackRequestPopup()