Exemple #1
0
    def test_user_can_deactivate_survey(self):
        user = User(user_1)
        title = 'test_activate ' + self.execute_date
        print(title)
        payload = SurveyPayload(title)
        survey = payload.add_text_question(
            'question_1').generate_new_survey_data_run_now()
        sess = self.sess
        ApiMethods(sess).login_as_user(user)
        id = ApiMethods(sess).create_survey(survey).json()['id']
        ApiMethods(sess).deactivate_survey(id)

        LoginPage().open().login_as_user(user)
        time.sleep(0.5)

        SurveyDetailsPage().open_by_id(id)
        time.sleep(0.5)

        SurveyDetailsPage().set_survey_live()
        SurveyDetailsPage().pause_button.should(have.text('Pause'))
        time.sleep(0.5)

        SurveyPage().open().get_survey_by_text(title).paused_label.should_not(
            be.visible)

        survey = ApiMethods(sess).get_survey_by_id(id)
        print(survey.schedule['is_active'])
        assert survey.schedule['is_active'] is True
Exemple #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 fill_all_inputs_and_save(self):
     keyboard = Controller()
     teammate = User(user_4).full_name
     self.first_name_input.set('test')
     self.last_name_input.set('test')
     self.job_input.set('test')
     self.bio_input.set('test')
     self.you_manage_input.set(teammate)
     keyboard.press(Key.enter)
     keyboard.release(Key.enter)
     self.you_report_to_input.set(teammate)
     keyboard.press(Key.enter)
     keyboard.release(Key.enter)
     self.you_work_with_input.set(teammate)
     keyboard.press(Key.enter)
     keyboard.release(Key.enter)
     self.location_input.set('test')
     self.phone_input.set('test')
     self.slack_input.set('test')
     self.skype_input.set('test')
     self.email_input.set('test')
     self.twitter_input.set('test')
     self.facebook_input.set('test')
     self.linkedin_input.set('test')
     self.instagram_input.set('test')
     self.save_button.click()
     return EditProfilePopup()
 def test_sign_in_with_invalid_credentials(self):
     user = User(user_1)
     LoginPage().open().login(
         " ", user.password).email_error_message.should(be.visible)
     LoginPage().login(user.email,
                       " ").password_error_message.should(be.visible)
     LoginPage().login(user.email,
                       "1111").password_error_message.should(be.visible)
    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
Exemple #7
0
 def setUpClass(cls):
     cls.execute_date = datetime.datetime.today().strftime('%c')
     #cls.driver = webdriver.Chrome(ChromeDriverManager().install())
     # self.driver = webdriver.Chrome(DRIVER_PATH)
     #browser.set_driver(cls.driver)
     user1 = User(user_1)
     LoginPage().open().login(user1.email, user1.password)
     time.sleep(0.5)
    def test_user_can_dismiss_request(self):
        request_text = self.execute_date + 'test_user_can_dismiss_request'
        user1 = User(user_1)
        user2 = User(user_2)

        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.dismiss_link.click()
        rq = RequestsPage().open().get_request_by_text(request_text)
        assert rq is None
    def test_user_receive_request(self):
        request_text = self.execute_date + 'test_user_receive_request'
        user1 = User(user_1)
        user2 = User(user_2)
        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)
        assert rq is not None
        rq.dismiss_link.should(be.visible)
        rq.send_feedback_button.should(be.visible)
        rq.send_feedback_button.should(be.enabled)
    def test_user_can_add_recieved_feedback_to_praise(self):
        user1 = User(user_1)
        user2 = User(user_2)
        payload = FeedbackPayload().generate_feedback_to_send([user1], self.execute_date)
        sess = self.sess

        ApiMethods(sess).login_as_user(user2)
        ApiMethods(sess).send_feedback(payload.json_for_send)

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

        fb = FeedbackPage().get_feedback_by_text(payload.text)
        fb.to_praise_link.click()
        fb = FeedbackPage().open_added_to_praise().get_feedback_by_text(payload.text)
        assert fb is not None

        fb.to_praise_link.click()
        browser.driver().refresh()
        fb = FeedbackPage().get_feedback_by_text(payload.text)
        assert fb is None
    def test_user_can_mark_recieved_feedback_with_flag(self):
        user1 = User(user_1)
        user3 = User(user_3)
        payload = FeedbackPayload().generate_feedback_to_send([user1], self.execute_date, is_shared=True)
        sess = self.sess

        ApiMethods(sess).login_as_user(user3)
        ApiMethods(sess).send_feedback(payload.json_for_send)

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

        fb = FeedbackPage().get_feedback_by_text(payload.text)
        fb.flag_link.click()
        fb = FeedbackPage().open_flagged().get_feedback_by_text(payload.text)
        assert fb is not None

        fb.flag_link.click()
        browser.driver().refresh()
        fb = FeedbackPage().get_feedback_by_text(payload.text)
        assert fb is None
Exemple #12
0
    def test_user_can_edit_survey_delete_question(self):
        user = User(user_1)
        receiver = User(user_2)
        title = 'test_edit ' + self.execute_date
        new_title = 'new_title ' + self.execute_date
        payload = SurveyPayload(title)
        survey = payload.add_text_question('question_1').add_text_question(
            'question_2').generate_new_survey_data_run_now()
        sess = self.sess
        ApiMethods(sess).login_as_user(user)
        id = ApiMethods(sess).create_survey(survey).json()['id']

        LoginPage().open().login_as_user(user)
        time.sleep(0.5)

        SurveyDetailsPage().open_by_id(id)
        time.sleep(0.5)

        SurveyDetailsPage().edit_button.click()
        (SurveyPopup().type_name(new_title).get_question_by_id().type_question(
            'new question_1').choose_rating_option().choose_anonymous_option())
        (SurveyPopup().get_question_by_id(1).delete_question())
        (SurveyPopup().delete_receiver().delete_viewer().
         type_who_request_feedback_from(receiver).type_who_able_to_see(
             receiver).click_update())

        time.sleep(0.5)

        survey = ApiMethods(sess).get_survey_by_id(id)

        assert new_title in survey.title
        assert str(receiver.id) in survey.receivers
        assert str(receiver.id) in survey.viewers
        assert len(survey.questions) == 1
        assert survey.questions[0]['type'] == 2
        assert 'new' not in survey.questions[0]['text']
        assert survey.questions[0]['isAonymous'] == False
Exemple #13
0
    def test_user_can_pause_survey(self):
        user = User(user_1)
        title = 'test_deactivate ' + self.execute_date
        payload = SurveyPayload(title)
        survey = payload.add_text_question(
            'question_1').generate_new_survey_data_run_now()
        sess = self.sess
        ApiMethods(sess).login_as_user(user)
        response = ApiMethods(sess).create_survey(survey)

        LoginPage().open().login_as_user(user)
        time.sleep(0.5)

        SurveyDetailsPage().open_by_id(response.json()['id'])
        time.sleep(0.5)

        SurveyDetailsPage().pause_survey()
        SurveyDetailsPage().pause_button.should(have.text('live'))

        survey = ApiMethods(sess).get_survey_by_id(response.json()['id'])
        assert survey.schedule["is_active"] is False

        SurveyPage().open().get_survey_by_text(title).paused_label.should(
            be.visible)
 def test_sign_in_with_email(self):
     user = User(user_1)
     LoginPage().open().login_as_user(user)
     FeedbackPage().logo.should(be.visible)
     assert FEEDBACK_ALL_URL in browser.driver().current_url
Exemple #15
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
Exemple #16
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)