class ChatLeftSide(unittest.TestCase):

    def setUp(self) -> None:
        default_setup(self)
        self.VACANCY_NAME = "Программист JAVA"
        self.TEST_MSG = "привет"
        self.STATUS_TEST = "Новый статус заявки"

        self.vacanciesPage = VacanciesPage(self.driver)
        self.vacancyPage = VacancyPage(self.driver)
        self.chatPage = ChatPage(self.driver)
        self.main_page = MainPage(self.driver)

        self.resume_page = ResumePage(self.driver)
        self.resume = self.resume_page.form

        self.scenario = ResumeScenario(self, self.resume)

    def tearDown(self):
        self.driver.quit()

    def test_chat_exist_after_response(self):
        auth_as_applicant(self)
        self.scenario.create_resume()
        self.vacanciesPage.open()
        self.vacanciesPage.click_on_first_vacancy()
        self.vacancyPage.click_on_response()
        self.vacancyPage.click_on_first_resume()
        self.chatPage.open()
        self.assertTrue(self.chatPage.is_open())
        self.scenario.delete_resume()
Beispiel #2
0
    def setUp(self) -> None:
        default_setup(self)
        setup_auth(self)

        self.create_resume_page = CreateResumePage(self.driver)
        self.create_resume_form = self.create_resume_page.create_form

        self.resume_page = ResumePage(self.driver)
        self.resume = self.resume_page.form

        self.scenario = ResumeScenario(self, self.create_resume_form)
        self.create_resume_page.open()
Beispiel #3
0
    def setUp(self) -> None:
        default_setup(self)
        setup_auth(self)

        self.resume_page = ResumePage(self.driver)
        self.resume = self.resume_page.form

        self.scenario = ResumeScenario(self, self.resume)
        self.scenario.create_resume(self.data)
        self.resume_list = ResumesPage(self.driver)
        self.resume_list_form = self.resume_list.list

        self.resume_list.open()
    def setUp(self) -> None:
        default_setup(self)

        self.main_page = MainPage(self.driver)
        self.vacancies = VacanciesPage(self.driver)
        self.rec_page = RecommendationPage(self.driver)
        self.profile = ProfilePage(self.driver)
        self.resume_page = ResumePage(self.driver)
        self.resume = self.resume_page.form
        self.resume_list = ResumesPage(self.driver)
        self.resume_list_form = self.resume_list.list
        self.scenario = ResumeScenario(self, self.resume)
        self.Applicant = RegistrationApplicantScenario(self)
        self.reg_data = self.Applicant.registration_applicant()
    def setUp(self) -> None:
        default_setup(self)
        self.VACANCY_NAME = "Программист JAVA"
        self.TEST_MSG = "привет"
        self.STATUS_TEST = "Новый статус заявки"

        self.vacanciesPage = VacanciesPage(self.driver)
        self.vacancyPage = VacancyPage(self.driver)
        self.chatPage = ChatPage(self.driver)
        self.main_page = MainPage(self.driver)

        self.resume_page = ResumePage(self.driver)
        self.resume = self.resume_page.form

        self.scenario = ResumeScenario(self, self.resume)
Beispiel #6
0
    def setUp(self) -> None:
        default_setup(self)
        setup_auth(self)

        self.create_resume_page = CreateResumePage(self.driver)
        self.create_resume_form = self.create_resume_page.create_form
        self.create_experience_form = self.create_resume_page.create_experience_form

        self.resume_page = ResumePage(self.driver)
        self.resume = self.resume_page.form

        self.scenario = ResumeScenario(self, self.create_resume_form)
        self.create_resume_page.open()
        self.scenario.fill_resume(self.data)
        self.create_resume_form.open_popup_add_experience()
Beispiel #7
0
class ListResume(unittest.TestCase):
    data = {
        'title': 'My Title',
        'description': 'My cool resume',
        'place': 'I very good',
        'skills': 'My great skills',
    }

    def setUp(self) -> None:
        default_setup(self)
        setup_auth(self)

        self.resume_page = ResumePage(self.driver)
        self.resume = self.resume_page.form

        self.scenario = ResumeScenario(self, self.resume)
        self.scenario.create_resume(self.data)
        self.resume_list = ResumesPage(self.driver)
        self.resume_list_form = self.resume_list.list

        self.resume_list.open()

    def tearDown(self):
        self.scenario.delete_resume()
        self.driver.quit()

    def test_created_resume_in_list(self):
        title = self.resume_list_form.get_first_resume_title()
        description = self.resume_list_form.get_first_resume_description()
        self.assertEqual(title, self.data['title'])
        self.assertEqual(description, self.data['description'])

    def test_resume_click(self):
        self.resume_list_form.go_first_resume_page()
        self.assertTrue(self.resume_page.is_open())

        resume_data = self.resume_page.get_resume_data()
        self.assertDictEqual(resume_data, {
            'description': self.data['description'],
            'place': self.data['place'],
            'skills': self.data['skills'],
        })
Beispiel #8
0
    def setUp(self) -> None:
        default_setup(self)

        self.create_resume_page = CreateResumePage(self.driver)
        self.create_resume_form = self.create_resume_page.create_form

        self.resume_page = ResumePage(self.driver)
        self.resume = self.resume_page.form

        self.edit_resume_page = EditResumePage(self.driver)
        self.edit_resume_form = self.edit_resume_page.edit_form

        self.profile_page = ProfilePage(self.driver)
        self.scenario = ResumeScenario(self, self.create_resume_form)
        setup_auth(self)
        self.scenario.create_resume_with_experience(self.data)

        self.profile_page.open()
        self.profile_page.click_my_first_resume_edit()
        self.assertTrue(self.edit_resume_page.is_open())
Beispiel #9
0
class CreateResume(unittest.TestCase):
    data = {
        'title': 'My Title',
        'description': 'My cool resume',
        'place': 'I very good',
        'skills': 'My great skills',
    }

    def setUp(self) -> None:
        default_setup(self)
        setup_auth(self)

        self.create_resume_page = CreateResumePage(self.driver)
        self.create_resume_form = self.create_resume_page.create_form

        self.resume_page = ResumePage(self.driver)
        self.resume = self.resume_page.form

        self.scenario = ResumeScenario(self, self.create_resume_form)
        self.create_resume_page.open()

    def tearDown(self):
        self.scenario.delete_resume()
        self.driver.quit()

    def test_create_resume(self):
        self.scenario.create_resume(self.data)
        place = self.resume.get_place()
        description = self.resume.get_description()
        skills = self.resume.get_skills()

        self.assertEqual(self.data['place'], place)
        self.assertEqual(self.data['description'], description)
        self.assertEqual(self.data['skills'], skills)

    def test_enter_equal_salary(self):
        self.scenario.fill_resume(self.data)
        salary = 5
        self.create_resume_form.set_salary_min(salary)
        self.create_resume_form.set_salary_max(salary)
        self.create_resume_form.submit_resume()
        self.resume.wait_for_resume_page()

        page_salary = self.resume.get_salary()
        self.assertEqual(salary, int(page_salary[0]))
        self.assertEqual(salary, int(page_salary[1]))
Beispiel #10
0
class CreateResumeWrong(unittest.TestCase):
    data = {
        'title': 'My Title',
        'description': 'My cool resume',
        'place': 'I very good',
        'skills': 'My great skills',
    }

    def setUp(self) -> None:
        default_setup(self)
        setup_auth(self)

        self.create_resume_page = CreateResumePage(self.driver)
        self.create_resume_form = self.create_resume_page.create_form

        self.resume_page = ResumePage(self.driver)
        self.resume = self.resume_page.form

        self.scenario = ResumeScenario(self, self.create_resume_form)
        self.create_resume_page.open()

    def tearDown(self):
        self.driver.quit()

    def test_create_empty_resume(self):
        self.create_resume_form.submit_resume()
        self.assertTrue(self.create_resume_form.is_title_error())
        self.assertTrue(self.create_resume_form.is_description_error())
        self.assertTrue(self.create_resume_form.is_place_error())
        self.assertTrue(self.create_resume_form.is_skills_error())

    def test_enter_salary_in_letters(self):
        self.create_resume_form.set_salary_min("letters")
        self.create_resume_form.submit_resume()
        self.assertTrue(
            self.create_resume_form.is_salary_error('Некорректное число'))

    def test_enter_negative_salary(self):
        self.create_resume_form.set_salary_min(-123)
        self.create_resume_form.submit_resume()
        self.assertTrue(
            self.create_resume_form.is_salary_error(
                'Поле не может принимать отрицательное значение.'))

    def test_enter_salary_in_symbol(self):
        self.create_resume_form.set_salary_min('(!"№;%:?*()')
        self.create_resume_form.submit_resume()
        self.assertTrue(
            self.create_resume_form.is_salary_error('Некорректное число'))

    def test_enter_salary_min_greater_max(self):
        self.create_resume_form.set_salary_min(12)
        self.create_resume_form.set_salary_max(3)
        self.create_resume_form.submit_resume()
        self.assertTrue(
            self.create_resume_form.is_salary_error(
                'Минимальная зарплата не может быть больше максимальной'))

    def test_enter_salary_is_zero(self):
        self.scenario.fill_resume(self.data)
        self.create_resume_form.set_salary_min(0)
        self.create_resume_form.set_salary_max(1)
        self.create_resume_form.submit_resume()

        self.assertTrue(
            self.create_resume_form.is_salary_error(
                'Поле не может принимать отрицательное значение.'))

    def test_create_resume_with_empty_contect_data(self):
        self.scenario.fill_resume(self.data)
        self.create_resume_form.clear_contact_data()
        self.create_resume_form.submit_resume()
        self.assertTrue(self.create_resume_form.is_surname_error())
        self.assertTrue(self.create_resume_form.is_name_error())
        self.assertTrue(self.create_resume_form.is_email_error())

    def test_enter_very_big_salary(self):
        # Ошибка при вводе зарплаты >999999999
        self.scenario.fill_resume(self.data)
        self.create_resume_form.set_salary_min(1)
        self.create_resume_form.set_salary_max(9999999999999)
        self.create_resume_form.submit_resume()
        self.assertTrue(self.create_resume_form.is_common_error())

    def test_load_image_error(self):
        self.scenario.fill_resume(self.data)
        self.create_resume_form.load_image()
        self.create_resume_form.submit_resume()
        self.assertTrue(
            self.create_resume_form.is_common_error(
                'Превышен максимальный размер изображения. Максимальный размер: 2 mB.'
            ))
class ChatLeftSideWithCreate(unittest.TestCase):

    def setUp(self) -> None:
        default_setup(self)
        self.VACANCY_NAME = "Программист JAVA"
        self.TEST_MSG = "привет"
        self.STATUS_TEST = "Новый статус заявки"

        self.vacanciesPage = VacanciesPage(self.driver)
        self.vacancyPage = VacancyPage(self.driver)
        self.chatPage = ChatPage(self.driver)
        self.main_page = MainPage(self.driver)
        self.Applicant = RegistrationApplicantScenario(self)
        self.data = self.Applicant.registration_applicant()

        self.resume_page = ResumePage(self.driver)
        self.resume = self.resume_page.form

        self.scenario = ResumeScenario(self, self.resume)

    def test_check_new_chat_after_request(self):
        self.scenario.create_resume()
        self.vacanciesPage.open()
        self.vacanciesPage.search_vacancy_by_keyword(self.VACANCY_NAME)
        self.vacanciesPage.click_on_first_vacancy()
        self.vacancyPage.click_on_response()
        self.vacancyPage.click_on_first_resume()
        self.chatPage.open()
        self.main_page.open()
        self.main_page.click_logout()

        auth_as_employer_has_comp(self)
        self.chatPage.open()
        name = self.chatPage.get_first_chat_name()
        firstAndLastName = name.split(" ")
        self.assertEqual(firstAndLastName[0], self.data["NAME"])
        self.assertEqual(firstAndLastName[1], self.data["SURNAME"])

    def test_check_new_message_after_request(self):
        self.scenario.create_resume()
        self.vacanciesPage.open()
        self.vacanciesPage.search_vacancy_by_keyword(self.VACANCY_NAME)
        self.vacanciesPage.click_on_first_vacancy()
        self.vacancyPage.click_on_response()
        self.vacancyPage.click_on_first_resume()

        self.main_page.open()
        self.main_page.click_logout()

        auth_as_employer_has_comp(self)
        self.chatPage.open()
        self.chatPage.click_on_another_chat(0)
        self.chatPage.click_on_send_msg(self.TEST_MSG)

        self.main_page.open()
        self.main_page.click_logout()
        logData = {'EMAIL': self.data["EMAIL"], 'PASSWORD': self.data["PASSWORD"]}
        setup_auth(self, logData)
        self.chatPage.open()
        self.chatPage.click_on_another_chat(0)
        text = self.chatPage.get_last_msg()
        self.assertEqual(text, self.TEST_MSG)

    def tearDown(self):
        self.main_page.open()
        self.main_page.click_logout()
        logData = {'EMAIL': self.data["EMAIL"], 'PASSWORD': self.data["PASSWORD"]}
        setup_auth(self, logData)
        self.scenario.delete_resume()
        self.Applicant.delete_applicant()
        self.driver.quit()
Beispiel #12
0
class CreateExperience(unittest.TestCase):
    data = {
        'title': 'My Title',
        'description': 'My cool resume',
        'place': 'I very good',
        'skills': 'My great skills',
        'position': 'Developer',
        'name_job': 'Mail.ru Group',
        'start_date': '2010-01-02',
        'end_date': '2020-01-02',
    }

    def setUp(self) -> None:
        default_setup(self)
        setup_auth(self)

        self.create_resume_page = CreateResumePage(self.driver)
        self.create_resume_form = self.create_resume_page.create_form
        self.create_experience_form = self.create_resume_page.create_experience_form

        self.resume_page = ResumePage(self.driver)
        self.resume = self.resume_page.form

        self.scenario = ResumeScenario(self, self.create_resume_form)
        self.create_resume_page.open()
        self.scenario.fill_resume(self.data)
        self.create_resume_form.open_popup_add_experience()

    def test_create_empty_experience(self):
        self.create_experience_form.submit_exp()
        self.assertTrue(
            self.create_experience_form.is_date_error('Укажите дату'))
        self.assertTrue(self.create_experience_form.is_position_error())
        self.assertTrue(self.create_experience_form.is_name_job_error())

    def test_enter_date_start_greater_end(self):
        self.create_experience_form.set_position(self.data['position'])
        self.create_experience_form.set_name_job(self.data['name_job'])
        self.create_experience_form.set_date_start('2010-01-01')
        self.create_experience_form.set_date_end('2000-01-01')
        self.create_experience_form.submit_exp()
        self.assertTrue(
            self.create_experience_form.is_date_error('Некорректная дата.'))

    def test_close_popup(self):
        self.create_experience_form.close_popup()
        self.assertFalse(self.create_experience_form.form_is_open())

    def test_create_experience(self):
        self.scenario.create_experience(self.data)
        page_date = self.create_resume_form.get_job_date()
        for i in range(len(page_date)):
            page_date[i] = page_date[i].replace('\n', '')
        self.assertEqual(page_date[0], self.data['start_date'])
        self.assertEqual(page_date[1], self.data['end_date'])
        self.assertEqual(self.create_resume_form.get_job_name(),
                         self.data['name_job'])
        self.assertEqual(self.create_resume_form.get_job_position(),
                         self.data['position'])

    def tearDown(self):
        self.driver.quit()
Beispiel #13
0
class EditResume(unittest.TestCase):
    data = {
        'title': 'My Title',
        'description': 'My cool resume',
        'place': 'I very good',
        'skills': 'My great skills',
        'position': 'Developer',
        'name_job': 'Mail.ru Group',
        'start_date': '2010-01-02',
        'end_date': '2020-01-02',
    }

    other_data = {
        'title': 'other My Title',
        'description': 'other My cool resume',
        'place': 'other I very good',
        'skills': 'other My great skills',
    }

    def setUp(self) -> None:
        default_setup(self)

        self.create_resume_page = CreateResumePage(self.driver)
        self.create_resume_form = self.create_resume_page.create_form

        self.resume_page = ResumePage(self.driver)
        self.resume = self.resume_page.form

        self.edit_resume_page = EditResumePage(self.driver)
        self.edit_resume_form = self.edit_resume_page.edit_form

        self.profile_page = ProfilePage(self.driver)
        self.scenario = ResumeScenario(self, self.create_resume_form)
        setup_auth(self)
        self.scenario.create_resume_with_experience(self.data)

        self.profile_page.open()
        self.profile_page.click_my_first_resume_edit()
        self.assertTrue(self.edit_resume_page.is_open())

    def test_save_without_changes(self):
        self.edit_resume_form.submit_resume()
        self.resume.wait_for_resume_page()
        self.assertTrue(self.resume_page.is_open())

        self.assertEqual(self.data['place'], self.resume.get_place())
        self.assertEqual(self.data['description'],
                         self.resume.get_description())
        self.assertEqual(self.data['skills'], self.resume.get_skills())

    def test_save_with_changes(self):
        self.edit_resume_form.clear_inputs()
        self.scenario.fill_resume(self.other_data)

        self.edit_resume_form.submit_resume()
        self.resume.wait_for_resume_page()
        self.assertTrue(self.resume_page.is_open())

        self.assertEqual(self.other_data['place'], self.resume.get_place())
        self.assertEqual(self.other_data['description'],
                         self.resume.get_description())
        self.assertEqual(self.other_data['skills'], self.resume.get_skills())

    def test_add_experience(self):
        self.edit_resume_form.open_popup_add_experience()
        self.scenario.create_experience(self.data)
        self.edit_resume_form.submit_resume()
        self.edit_resume_form.wait_for_resume_page()
        position = self.resume.get_position()
        name_job = self.resume.get_name_job()
        self.assertEqual(self.data['position'], position[1].text)
        self.assertEqual(self.data['name_job'], name_job[1].text)

    def test_delete_experience(self):
        self.edit_resume_form.delete_experience()
        self.assertFalse(self.edit_resume_form.check_experience_exist())

    def tearDown(self):
        self.scenario.delete_resume()
        self.driver.quit()
Beispiel #14
0
class Notification(unittest.TestCase):
    def setUp(self) -> None:
        default_setup(self)

        self.main_page = MainPage(self.driver)
        self.vacancies = VacanciesPage(self.driver)
        self.rec_page = RecommendationPage(self.driver)
        self.profile = ProfilePage(self.driver)
        self.resume_page = ResumePage(self.driver)
        self.resume = self.resume_page.form
        self.resume_list = ResumesPage(self.driver)
        self.resume_list_form = self.resume_list.list
        self.scenario = ResumeScenario(self, self.resume)
        self.Applicant = RegistrationApplicantScenario(self)
        self.reg_data = self.Applicant.registration_applicant()

    def tearDown(self):
        self.main_page.open()
        self.main_page.click_logout()
        logData = {
            'EMAIL': self.reg_data["EMAIL"],
            'PASSWORD': self.reg_data["PASSWORD"]
        }
        setup_auth(self, logData)
        self.Applicant.delete_applicant()
        self.driver.quit()

    def test_empty_notification(self):
        self.main_page.click_notif_popup()
        self.main_page.wait_notif_open()
        self.assertEqual(self.main_page.get_text_empty_notif(),
                         'У вас нет новых уведомлений')

    def test_recommended_vacancies(self):
        self.vacancies.open()
        self.vacancies.click_on_first_vacancy()
        self.main_page.click_notif_popup()
        self.main_page.wait_notif_open()
        self.assertTrue(self.main_page.check_notif_recommendations())

    def test_recommended_vacancies_page(self):
        self.vacancies.open()
        self.vacancies.click_on_first_vacancy()
        self.main_page.click_notif_popup()
        self.main_page.wait_notif_open()
        self.main_page.notification.click_notif_recommendation()
        self.assertTrue(self.rec_page.is_open())
        self.main_page.click_notif_popup()
        self.main_page.wait_notif_open()
        self.assertEqual(self.main_page.get_text_recommendation(), '')

    def test_response(self):
        self.scenario.create_resume()
        self.main_page.click_logout()

        auth_as_employer_has_comp(self)
        vacancy = VacancyScenario(test=self)
        vacancy.create_vacancy()
        self.resume_list.open()
        self.resume_list_form.go_first_resume_page()
        self.resume.response()
        self.resume.get_response_done()

        self.vacancies.open()
        self.vacancies.click_on_first_vacancy()
        vacancy.delete_vacancy()
        self.main_page.click_logout()

        setup_auth(self, self.reg_data)
        self.main_page.click_notif_popup()
        self.main_page.wait_notif_open()
        self.assertTrue(self.main_page.check_response())
        self.main_page.delete_response()
        self.scenario.delete_resume()