Exemplo n.º 1
0
 def setUp(self):
     super().setUp()
     self.header_page = Header()
     self.user_api = UsersAPI()
     self.roles_api = RolesAPI()
     self.set_authorization(auth=self.roles_api.AUTHORIZATION_RESPONSE)
     self.header_page.get_users_page()
     self.header_page.set_all_configure_table_columns_to_specific_value()
Exemplo n.º 2
0
 def setUp(self):
     super().setUp()
     self.my_profile_page = MyProfile()
     self.users_api = UsersAPI()
     self.info("create new user")
     response, payload = self.users_api.create_new_user()
     self.assertEqual(response['status'], 1, "failed to create new user")
     self.current_password = payload["password"]
     self.username = payload["username"]
     self.email = payload["email"]
     self.info('user {}:{}'.format(self.username, self.current_password))
     self.users_api._get_authorized_session(username=self.username,
                                            password=self.current_password,
                                            reset_token=True)
     self.set_authorization(auth=self.users_api.AUTHORIZATION_RESPONSE)
     self.my_profile_page.get_my_profile_page()
    def test019_filter_by_changed_by(self):
        """
        Header: Roles & Permissions Approach: Make sure that you can filter by role changed by

        LIMS-6507
        """
        self.login_page = Login()
        response, payload = UsersAPI().create_new_user()
        self.assertEqual(response['status'], 1, response)
        self.login_page.logout()
        self.header_page.sleep_tiny()
        self.info('login with role & user {}:{}'.format(payload['username'], payload['password']))
        self.login_page.login(username=payload['username'], password=payload['password'])
        self.header_page.wait_until_page_is_loaded()
        self.header_page.sleep_medium()
        self.header_page.get_roles_page()
        self.header_page.sleep_small()
        random_role_name = self.generate_random_string()
        self.header_page.create_new_role(role_name=random_role_name)
        self.header_page.click_on_table_configuration_button()
        self.base_selenium.click(element='roles_and_permissions:checked_role_changed_by')
        self.base_selenium.click(element='roles_and_permissions:apply_btn')
        self.header_page.sleep_tiny()
        roles_results = self.header_page.filter_user_by(
            filter_element='roles_and_permissions:filter_changed_by',
            filter_text=payload['username'], field_type='drop_down')
        for roles_result in roles_results:
            self.assertIn(payload['username'], roles_result['Changed By'])
 def setUp(self):
     super().setUp()
     self.header_page = Header()
     self.users_api = UsersAPI()
     self.roles_api = RolesAPI()
     self.set_authorization(auth=self.users_api.AUTHORIZATION_RESPONSE)
     self.header_page.get_roles_page()
    def test019_filter_by_testplan_changed_by(self):
        """
        User can filter with changed by field

        LIMS-6475
        """
        self.login_page = Login()
        self.info('Calling the users api to create a new user with username')
        response, payload = UsersAPI().create_new_user()
        self.assertEqual(response['status'], 1, payload)
        self.test_plan.sleep_tiny()
        self.login_page.logout()
        self.test_plan.sleep_tiny()
        self.login_page.login(username=payload['username'],
                              password=payload['password'])
        self.base_selenium.wait_until_page_url_has(text='dashboard')
        self.test_plan.get_test_plans_page()
        self.test_plan.sleep_tiny()
        testplan_name = self.test_plan.create_new_test_plan()

        self.info('New testplan is created successfully with name: {}'.format(
            testplan_name))
        self.test_plan.set_all_configure_table_columns_to_specific_value(
            value=True)

        testplan_found = self.test_plan.filter_by_element_and_get_results(
            'Changed By', 'test_plans:testplan_changed_by_filter',
            payload['username'], 'drop_down')
        self.assertEqual(len(testplan_found), 2)
        self.assertIn(payload['username'], testplan_found[0].text)
        self.assertIn(testplan_name, testplan_found[0].text)
Exemplo n.º 6
0
    def setUp(self):
        super().setUp()
        self.login_page = Login()
        self.header_page = Header()
        self.roles_api = RolesAPI()
        self.login_page.base_selenium.refresh()
        self.login_page.logout()
        response, payload = UsersAPI().create_new_user()

        self.user_name = response['user']['username']
        self.info("login with new user {} and pw {}".format(self.user_name, payload['password']))

        self.login_page.login(username=self.user_name, password=payload['password'])
        self.header_page.wait_until_page_is_loaded()
        self.header_page.get_users_page()
    def test049_filter_by_testunit_changed_by(self):
        """
        New: Test units: Filter Approach: Make sure you can filter by changed by

        LIMS-6428
        """
        self.login_page = Login()
        self.info('Calling the users api to create a new user with username')
        response, payload = UsersAPI().create_new_user()
        self.assertEqual(response['status'], 1, payload)
        self.login_page.logout()
        self.login_page.login(username=payload['username'], password=payload['password'])
        self.base_selenium.wait_until_page_url_has(text='dashboard')
        self.test_units_page.get_test_units_page()
        new_name = self.generate_random_string()
        method = self.generate_random_string()
        test_unit_no = self.test_unit_page.create_qualitative_testunit(name=new_name, method=method)
        self.test_unit_page.save_and_wait()
        self.assertTrue(test_unit_no, 'Test unit not created')
        self.info('New unit is created successfully with number: {}'.format(test_unit_no))
        self.test_units_page.sleep_tiny()
        test_unit_found = self.test_units_page.filter_by_user_get_result(payload['username'])
        self.assertTrue(test_unit_found)
Exemplo n.º 8
0
    def test005_delete_user(self):
        """
        User management : Delete Approach: Make sure that you can delete
        any record successfully If this record not used in any other entity

        LIMS-6381
        """
        self.info("create new user")
        response, payload = UsersAPI().create_new_user()
        self.assertEqual(response['status'], 1, payload)
        new_user_name = response['user']['username']
        self.header_page.search(value=new_user_name)
        self.header_page.select_all_records()
        self.header_page.archive_entity(menu_element='user_management:right_menu',
                                        archive_element='user_management:archive')
        self.header_page.get_archived_entities(menu_element='user_management:right_menu',
                                               archived_element='user_management:archived')
        self.info('make sure that that the user record navigate to the archive table')
        self.assertTrue(self.header_page.search(value=new_user_name))
        self.header_page.select_all_records()
        self.header_page.delete_entity()
        result = self.header_page.search(value=new_user_name)
        self.assertEqual(result[0].get_attribute("textContent"), 'No data available in table')
        self.info('deleted successfully')
    def test002_check_validation_date_validation_by(self):
        """
         Orders: Validation date & Validation by : check that when user update the validation date &
         the validation by, the update should reflect on order's child table

         LIMS-7729
        """
        today = date.today()
        current_date = today.strftime("%d.%m.%Y")
        self.info('Calling the users api to create a new user with username')
        response, payload = UsersAPI().create_new_user()
        self.assertEqual(response['status'], 1, payload)
        self.single_analysis_page = SingleAnalysisPage()
        self.login_page = Login()
        self.info(
            "create new order and update its validation option to be conform")
        order_response, order_payload = self.orders_api.create_new_order()
        self.assertEqual(order_response['status'], 1, order_payload)
        order_no = order_payload[0]['orderNo']
        self.info('edit order with No {}'.format(order_no))
        self.orders_page.get_order_edit_page_by_id(
            order_response['order']['mainOrderId'])
        self.order_page.sleep_small()
        self.info('navigate to analysis tab')
        self.order_page.navigate_to_analysis_tab()
        self.order_page.sleep_tiny()
        self.single_analysis_page.set_testunit_values()
        self.order_page.sleep_tiny()
        self.info('change validation options to conform')
        self.single_analysis_page.change_validation_options(text='Conform')
        self.order_page.get_orders_page()
        self.order_page.sleep_tiny()
        self.orders_page.filter_by_order_no(filter_text=order_no)
        self.assertEqual(len(self.orders_page.result_table()) - 1, 1)
        suborders_data = self.order_page.get_child_table_data(index=0)
        self.info('assert validation by is set correctly')
        self.assertEqual(suborders_data[0]['Validation by'],
                         self.base_selenium.username)
        self.assertEqual(suborders_data[0]['Validation date'], current_date)
        self.info(
            'go to analysis table and assert validation by and validation options'
            ' are set correctly as in order active table')
        self.orders_page.navigate_to_analysis_active_table()
        self.analyses_page.filter_by_analysis_number(
            suborders_data[0]['Analysis No.'])
        analysis_data = self.analyses_page.get_the_latest_row_data()
        self.assertEqual(suborders_data[0]['Validation by'],
                         analysis_data['Validation by'])
        self.assertEqual(suborders_data[0]['Validation date'],
                         analysis_data['Validation date'])
        self.info("Logout then login again using new user {}".format(
            payload['username']))
        self.login_page.logout()
        self.login_page.login(username=payload['username'],
                              password=payload['password'])
        self.base_selenium.wait_until_page_url_has(text='dashboard')
        self.orders_page.get_order_edit_page_by_id(
            order_response['order']['mainOrderId'])
        self.info(
            'change validation options so validation by is changed to {}',
            payload['username'])
        self.order_page.navigate_to_analysis_tab()
        self.single_analysis_page.change_validation_options(text='Approved')
        self.orders_page.get_orders_page()
        self.orders_page.filter_by_order_no(filter_text=order_no)
        suborders_after = self.order_page.get_child_table_data(index=0)
        self.assertEqual(suborders_after[0]['Validation by'],
                         payload['username'])
        self.assertEqual(suborders_after[0]['Validation date'], current_date)
Exemplo n.º 10
0
class HeaderTestCases(BaseTest):
    def setUp(self):
        super().setUp()
        self.header_page = Header()
        self.user_api = UsersAPI()
        self.roles_api = RolesAPI()
        self.set_authorization(auth=self.roles_api.AUTHORIZATION_RESPONSE)
        self.header_page.get_users_page()
        self.header_page.set_all_configure_table_columns_to_specific_value()

    def test001_archive_user_management(self):
        """
        User management: Make sure that you can archive any record

        LIMS-6379
        """
        self.info("select random users rows")
        selected_user_management_data, _ = self.header_page.select_multiple_random_users_rows()
        self.info("Archive selected rows")
        self.header_page.archive_entity(menu_element='user_management:right_menu',
                                        archive_element='user_management:archive')
        self.info("Navigate to archived users")
        self.header_page.get_archived_entities(menu_element='user_management:right_menu',
                                               archived_element='user_management:archived')
        for user in selected_user_management_data:
            user_name = user['Name']
            self.info('{} user should be activated.'.format(user_name))
            self.assertTrue(self.header_page.is_user_in_table(value=user_name))

    def test002_restore_user(self):
        """
        User management: Restore Approach: Make sure that you can restore any record successfully

        LIMS-6380
        """
        user_names = []
        self.info("Navigate to archived users")
        self.header_page.get_archived_entities(menu_element='user_management:right_menu',
                                               archived_element='user_management:archived')
        self.info("Select random archived users rows")
        selected_user_data, _ = self.header_page.select_multiple_random_users_rows()
        self.assertTrue(selected_user_data, 'No archived users found')
        for user in selected_user_data:
            user_names.append(user['Name'])

        self.info("Restore selected rows")
        self.header_page.restore_entity(menu_element='user_management:right_menu',
                                        restore_element='user_management:restore')
        self.header_page.get_active_entities(menu_element='user_management:right_menu',
                                             active_element='user_management:active')
        for user_name in user_names:
            self.assertTrue(self.header_page.is_user_in_table(value=user_name))

    #@skip("https://modeso.atlassian.net/browse/LIMSA-199")
    def test003_user_search(self):
        """
        Header:  User management:  Search Approach: Make sure that you can search by
        any field in the active table successfully

        LIMS-6082
        """
        self.info("select random row and search by its data")
        row = self.header_page.get_random_user_row()
        row_data = self.base_selenium.get_row_cells_dict_related_to_header(row=row)
        for column in row_data:
            if re.findall(r'\d{1,}.\d{1,}.\d{4}', row_data[column]) \
                    or row_data[column] == '' or row_data[column] == '-':
                continue
            self.info('search for {} : {}'.format(column, row_data[column]))
            search_results = self.header_page.search(row_data[column])
            self.assertGreater(len(search_results), 1,
                               " * There is no search results for {}, Report a bug.".format(row_data[column]))
            for search_result in search_results:
                search_data = self.base_selenium.get_row_cells_dict_related_to_header(search_result)
                if search_data[column] == row_data[column]:
                    break
            self.assertEqual(row_data[column], search_data[column])

    def test004_download_user_sheet(self):
        """
        User management: Make sure you can export all the data in
        the active table & it should display in the same order

        LIMS-6101
        """
        self.header_page.download_xslx_sheet()
        rows_data = list(filter(None, self.header_page.get_table_rows_data()))
        for index in range(len(rows_data)):
            self.info('comparing the user no. {} '.format(index))
            fixed_row_data = self.fix_data_format(rows_data[index].split('\n'))
            values = self.header_page.sheet.iloc[index].values
            fixed_sheet_row_data = self.fix_data_format(values)
            for item in fixed_row_data:
                self.assertIn(item, fixed_sheet_row_data)

    def test005_delete_user(self):
        """
        User management : Delete Approach: Make sure that you can delete
        any record successfully If this record not used in any other entity

        LIMS-6381
        """
        self.info("create new user")
        response, payload = UsersAPI().create_new_user()
        self.assertEqual(response['status'], 1, payload)
        new_user_name = response['user']['username']
        self.header_page.search(value=new_user_name)
        self.header_page.select_all_records()
        self.header_page.archive_entity(menu_element='user_management:right_menu',
                                        archive_element='user_management:archive')
        self.header_page.get_archived_entities(menu_element='user_management:right_menu',
                                               archived_element='user_management:archived')
        self.info('make sure that that the user record navigate to the archive table')
        self.assertTrue(self.header_page.search(value=new_user_name))
        self.header_page.select_all_records()
        self.header_page.delete_entity()
        result = self.header_page.search(value=new_user_name)
        self.assertEqual(result[0].get_attribute("textContent"), 'No data available in table')
        self.info('deleted successfully')

    def test006_create_new_user(self):
        """
        Header: User management Approach:  Make sure that I can create new user successfully

        LIMS-6000
        """
        random_user_name = self.generate_random_string()
        random_user_email = self.header_page.generate_random_email()
        self.header_page.create_new_user(
            user_name=random_user_name, user_email=random_user_email,
            user_password='******', user_confirm_password='******')

        self.header_page.sleep_tiny()
        user_row = self.header_page.search(value=random_user_name)
        table_row = self.header_page.result_table()
        self.assertEqual(table_row, user_row)

    def test007_overview_btn_from_create_mode(self):
        """
        User Management: Overview button Approach: Make sure after you press on the overview button,
        it will redirect me to the active table

        LIMS-6396
        """
        # from the create mode it will redirect me to the active table
        self.header_page.click_create_new_user()
        self.header_page.click_on_overview_btn()
        self.info('it will redirect me to the active table')
        self.assertEqual(self.base_selenium.get_url(), '{}users'.format(self.base_selenium.url))

    def test008_overview_btn_from_edit_mode(self):
        """
        User Management: Overview button Approach: Make sure after you press on the overview button,
        it will redirect me to the active table

        LIMS-6396
        """
        # from the edit mode it will redirect me to the active table
        self.header_page.get_random_user()
        self.header_page.click_on_overview_btn()
        self.info('it will redirect me to the active table')
        self.assertEqual(self.base_selenium.get_url(), '{}users'.format(self.base_selenium.url))

    @parameterized.expand(['save_btn', 'cancel'])
    def test009_update_user_name_with_save_cancel_btn(self, save):
        """
        User management: User management: I can update user name with save & cancel button

        LIMS-6395
        """
        self.header_page.get_random_user()
        user_url = self.base_selenium.get_url()
        self.info('user_url : {}'.format(user_url))
        self.header_page.sleep_tiny()

        current_name = self.header_page.get_user_name()
        self.header_page.set_user_name(self.generate_random_string())
        new_name = self.header_page.get_user_name()
        if 'save_btn' == save:
            self.header_page.save(save_btn='user_management:save_btn')
        else:
            self.header_page.cancel(force=True)

        self.base_selenium.get(
            url=user_url, sleep=self.base_selenium.TIME_MEDIUM)

        user_name = self.header_page.get_user_name()
        if 'save_btn' == save:
            self.info(
                'Assert {} (new_name) == {} (user_name)'.format(new_name, user_name))
            self.assertEqual(new_name, user_name)
        else:
            self.info(
                'Assert {} (current_name) == {} (user_name)'.format(current_name, user_name))
            self.assertEqual(current_name, user_name)

    @parameterized.expand(['save_btn', 'cancel'])
    def test010_update_user_role_with_save_cancel_btn(self, save):
        """
        User management: I can update user role with save & cancel button

        LIMS-6398
        """
        # open random user in the edit mode
        self.header_page.get_random_user()
        user_url = self.base_selenium.get_url()
        self.info('user_url : {}'.format(user_url))
        self.header_page.sleep_tiny()
        current_role = self.header_page.get_user_role()
        self.header_page.set_user_role()
        new_role = self.header_page.get_user_role()
        if 'save_btn' == save:
            self.header_page.save(save_btn='user_management:save_btn')
        else:
            self.header_page.cancel(force=True)

        self.base_selenium.get(
            url=user_url, sleep=self.base_selenium.TIME_MEDIUM)

        user_role = self.header_page.get_user_role()
        if 'save_btn' == save:
            self.info(
                'Assert {} (new_role) == {} (user_role)'.format(new_role, user_role))
            self.assertEqual(new_role, user_role)
        else:
            self.info(
                'Assert {} (current_role) == {} (user_role)'.format(current_role, user_role))
            self.assertEqual(current_role, user_role)

    @parameterized.expand(['save_btn', 'cancel'])
    def test011_update_user_email_with_save_cancel_btn(self, save):
        """
        User management: I can update user email with save & cancel button

        LIMS-6397
        """
        # open random user in the edit mode
        self.header_page.get_random_user()
        user_url = self.base_selenium.get_url()
        self.info('user_url : {}'.format(user_url))
        self.header_page.sleep_tiny()
        current_email = self.header_page.get_user_email()
        new_email = self.header_page.generate_random_email()
        self.header_page.set_user_email(new_email)
        if 'save_btn' == save:
            self.header_page.save(save_btn='user_management:save_btn')
        else:
            self.header_page.cancel(force=True)

            self.base_selenium.get(
                url=user_url, sleep=self.base_selenium.TIME_MEDIUM)

        user_email = self.header_page.get_user_email()
        if 'save_btn' == save:
            self.info(
                'Assert {} (new_email) == {} (user_email)'.format(new_email, user_email))
            self.assertEqual(new_email, user_email)
        else:
            self.info(
                'Assert {} (current_email) == {} (user_email)'.format(current_email, user_email))
            self.assertEqual(current_email, user_email)

    def test012_validation_user_name_email_fields(self):
        """
        Header: User management: Make sure when the user update name & email then press on save button,
        red border display and he can't save

        LIMS-6121
        """
        # from the create mode it will redirect me to the active table
        self.header_page.get_random_user()
        self.header_page.clear_user_name()
        self.header_page.clear_user_email()
        self.header_page.save(save_btn='user_management:save_btn')
        self.info('Waiting for error message')
        validation_result = self.base_selenium.wait_element(element='general:oh_snap_msg')
        self.info('Assert error msg')
        self.assertEqual(validation_result, True)

    @parameterized.expand([('name', 'filter_name', 'Name'),
                           ('email', 'filter_email', 'Email'),
                           ('number', 'filter_number', 'No'),
                           ('created_on', 'filter_created_on', 'Created On')])
    def test013_filter_by_text_field(self, field, filter_elem, header):
        """
        User management Approach: I can filter by name, email, number and created on successfully

        LIMS-6002
        LIMS-6442
        LIMS-6488
        LIMS-6486
        """
        self.header_page.sleep_tiny()
        filter_data = self.header_page.get_data_from_row()[field]
        self.info(" filter by  {}".format(filter_data))
        user_results = self.header_page.filter_user_by(filter_element='user_management:{}'.format(filter_elem),
                                                       filter_text=filter_data)
        for user_result in user_results:
            self.assertEqual(user_result[header].replace("'", ""), filter_data.replace("'", ""))

    def test014_filter_by_role(self):
        """
        User management Approach: I can filter by user role successfully

        LIMS-6443
        """
        self.info('get random role')
        res, _ = self.roles_api.get_all_roles(limit=50)
        random_role = random.choice(res['roles'])
        self.info(f'random role id: {random_role["id"]}')

        self.info('create random user')
        payload = {
            'role': {
                'id': random_role['id'],
                'text': random_role['name']
            },
            'roleId': random_role['id']
        }
        response, payload = self.user_api.create_new_user(**payload)

        user_results = self.header_page.filter_user_by(filter_element='user_management:filter_role',
                                                       filter_text=random_role['name'], field_type='drop_down')
        usernames = []
        for user_result in user_results:
            self.assertEqual(user_result["Role"], random_role['name'])
            usernames.append(user_result['Name'])

        self.assertIn(response['user']['username'], usernames)

    @skip('https://modeso.atlassian.net/browse/LIMS-6624')
    def test015_cant_create_two_users_with_the_same_name(self):
        """
        User management: Can't create two users with the same name

        LIMS-6503
        """
        # create new user with random data
        random_user_name = self.generate_random_string()
        random_user_email = self.header_page.generate_random_email()
        self.header_page.create_new_user(user_name=random_user_name, user_email=random_user_email,
                                         user_role='Admin', user_password='******', user_confirm_password='******')

        self.info('search to make sure that the role created '.format(random_user_name))
        created_user = self.header_page.search(random_user_name)[0]
        user_data = self.base_selenium.get_row_cells_dict_related_to_header(row=created_user)
        self.assertTrue(created_user, user_data)

        # create role with the same name
        self.header_page.create_new_user(user_name=random_user_name, user_email=random_user_email,
                                         user_role='Admin', user_password='******', user_confirm_password='******')
        self.info('waiting fo validation message appear when I enter two users with the same name')
        validation_result = self.base_selenium.wait_element(element='general:oh_snap_msg')
        self.info('Assert the error message to make sure that validation when '
                  'I enter two users with the same name? {}'.format(validation_result))
        self.assertTrue(validation_result)
Exemplo n.º 11
0
class MyProfileTestCases(BaseTest):
    def setUp(self):
        super().setUp()
        self.my_profile_page = MyProfile()
        self.users_api = UsersAPI()
        self.info("create new user")
        response, payload = self.users_api.create_new_user()
        self.assertEqual(response['status'], 1, "failed to create new user")
        self.current_password = payload["password"]
        self.username = payload["username"]
        self.email = payload["email"]
        self.info('user {}:{}'.format(self.username, self.current_password))
        self.users_api._get_authorized_session(username=self.username,
                                               password=self.current_password,
                                               reset_token=True)
        self.set_authorization(auth=self.users_api.AUTHORIZATION_RESPONSE)
        self.my_profile_page.get_my_profile_page()

    def tearDown(self):
        # Blocked by https: // modeso.atlassian.net / browse / LIMS - 6425
        # self.users_api.delete_active_user(id=self.userId)
        return super().tearDown()

    def test001_user_can_change_password_and_press_on_cancel(self):
        """
        My Profile: Make sure after you change the password and press on cancel button,
        the password shouldn't change

        LIMS-6091
        """
        self.new_password = self.my_profile_page.generate_random_text()
        self.my_profile_page.change_password(self.current_password,
                                             self.new_password)
        response = self.users_api.post_auth(username=self.username,
                                            password=self.new_password)
        self.assertEqual("username_or_password_is_incorrect",
                         response.json()["message"])

    def test002_my_profile_should_show_username_and_email(self):
        """
        My Profile: Make sure that the user name & email displayed above the language

        LIMS-6090
        """
        username = self.base_selenium.get_text(element='my_profile:username')
        self.info('Check the username is {}'.format(self.username))
        self.assertEqual(username.lower(), self.username.lower())

        email = self.base_selenium.get_text(element='my_profile:email')
        self.info('Check the email is {}'.format(self.email))
        self.assertTrue(email.lower(), self.email.lower())

    def test003_user_can_change_password_and_login_successfully(self):
        """
        My Profile: Make sure that you can change the password
        and login with the new one successfully

        LIMS-6084
        """
        # new password value
        new_password = self.my_profile_page.generate_random_text()

        # change password
        self.my_profile_page.change_password(self.current_password,
                                             new_password, True)

        # Authorize
        baseAPI = BaseAPI()
        auth_token = baseAPI._get_authorized_session(
            username=self.base_selenium.username, password=new_password)

        # check if the auth token has value
        self.assertTrue(auth_token)

    @parameterized.expand(['EN', 'DE'])
    def test004_user_can_change_the_language(self, lang):
        """
        My Profile: Language Approach: Make sure that you can change language

        LIMS-6089
        """
        self.my_profile_page.chang_lang('DE')
        self.my_profile_page.sleep_tiny()

        if lang == 'EN':
            self.my_profile_page.chang_lang('EN')
            self.my_profile_page.sleep_tiny()

        self.base_selenium.scroll()
        self.my_profile_page.sleep_tiny()
        page_name = self.base_selenium.get_text('my_profile:page_name')
        if lang == 'EN':
            self.assertEqual(page_name, 'My Profile')
        else:
            self.assertEqual(page_name, 'Mein Profil')

    def test005_company_profile_upload_logo_then_cancel_should_not_save(self):
        """
        My Profile: Signature Approach: Make sure after you upload the signature
        & press on cancel button, this signature didn't submit

        LIMS-6086
        """
        self.info('open signature tab')
        self.base_selenium.click('my_profile:signature_tab')
        # choose file from assets to be uploaded
        file_name = 'logo.png'
        self.info('upload the file then cancel')
        self.my_profile_page.upload_logo(
            file_name=file_name,
            drop_zone_element='my_profile:signature_field',
            save=False)

        self.info("Navigate to my profile page")
        self.my_profile_page.get_my_profile_page()
        self.info('open signature tab')
        self.base_selenium.click('my_profile:signature_tab')
        self.info('check that the image is not saved')
        is_the_file_not_exist = self.base_selenium.check_element_is_not_exist(
            element='general:file_upload_success_flag')
        self.assertTrue(is_the_file_not_exist)

    def test006_my_profile_user_can_upload_logo(self):
        """
        My Profile: Signature Approach: Make sure that you can upload the signature successfully

        LIMS-6085
        """
        self.info('open signature tab')
        self.base_selenium.click('my_profile:signature_tab')
        file_name = 'logo.png'
        uploaded_file_name = self.my_profile_page.upload_logo(
            file_name=file_name,
            drop_zone_element='my_profile:signature_field',
            save=True)
        self.assertEqual(uploaded_file_name, file_name)

    def test007_my_profile_user_can_update_logo(self):
        """
        My Profile: Signature Approach: Make sure that you can remove any signature

        LIMS-6095
        """
        self.info('open signature tab')
        self.base_selenium.click('my_profile:signature_tab')

        self.info('choose file from assets to be uploaded')
        file_name = 'logo.png'
        self.my_profile_page.upload_logo(
            file_name=file_name,
            drop_zone_element='my_profile:signature_field',
            save=True)

        self.info('remove the uploaded logo')
        self.base_selenium.scroll()
        self.base_selenium.click('general:remove_file')
        self.my_profile_page.save(save_btn="my_profile:save_button")

        self.info("check that the image is not saved")
        is_the_file_not_exist = self.base_selenium.check_element_is_not_exist(
            element='general:file_upload_success_flag')
        self.assertTrue(is_the_file_not_exist)

    def test008_you_cant_upload_more_than_one_signature(self):
        """
        My Profile: Signature Approach: Make sure you can't download more than one signature

        LIMS-6087
        """
        self.info('open signature tab')
        self.base_selenium.click('my_profile:signature_tab')
        self.info('choose file from assets to be uploaded')
        file_name = 'logo.png'
        other_file_name = 'logo2.png'
        self.info("upload the first file")
        self.my_profile_page.upload_logo(
            file_name=file_name,
            drop_zone_element='my_profile:signature_field',
            save=True)
        self.base_selenium.scroll()
        self.info("upload other file beside the current one")
        self.my_profile_page.upload_logo(
            file_name=other_file_name,
            drop_zone_element='my_profile:signature_field',
            save=True)
        self.base_selenium.scroll()
        self.assertTrue(self.base_selenium.find_element('general:oh_snap_msg'))
        self.info('wait to see if the file upload')
        self.my_profile_page.sleep_medium()
        self.info('get array of all uploaded files')
        files_uploaded_flags = self.base_selenium.find_elements(
            'general:files_upload_success_flags')
        self.info('assert that only 1 file should be uploaded')
        self.assertEqual(len(files_uploaded_flags), 1)