Esempio n. 1
0
def test_qata_01(log, frontend):
    frontend.open_url('https://rc.sylogent.com/ps/Landing/Login.aspx')
    frontend.authorization.login(frontend.login, frontend.passwd)
    frontend.goto('PubSTRAT')

    frontend.click_on_dropdown('Product')
    frontend.choose_in_dropdown('Program QA')

    frontend.navigate('Project')
    log.attach_selenium_screenshot('Project Wizard', frontend.driver)
    frontend.choose_tab('Create')
    log.attach_selenium_screenshot('TYPE', frontend.driver)

    frontend.choose_checkbox('Abstract Restyle and Resubmit')
    # frontend.choose_checkbox('Allow selection of any study', test=True)
    # frontend.choose_on_table('ADD NAME FOR 13329')

    log.attach_selenium_screenshot('STUDIES', frontend.driver)

    frontend.click_button('btnSaveStudies')
    frontend.click_button_on_modal_dialog('Yes')

    frontend.fill_table({
        'Title': 'Test_July_2018- do not remove',
        'Project Champion Message': 'Audit, Jim – Austria',
    })
    frontend.choose_on_dropdown_in_table('Project Champion',
                                         'Audit, Jim - Austria')
    # frontend.choose_on_dropdown_in_table('Language', 'English', _id='10594')
    log.attach_selenium_screenshot('GENERAL', frontend.driver)

    frontend.click_button('btnSaveGeneral')
    # frontend.click_button_on_modal_dialog('Yes')

    frontend.click_button('PageFrame1_btnSaveTarget')
    # frontend.click_button_on_modal_dialog('Yes')
    log.attach_selenium_screenshot('TARGET tab', frontend.driver)

    frontend.set_checkbox_in_table('Deadline Can Slip', True)
    log.attach_selenium_screenshot('TIMELINE', frontend.driver)
    frontend.click_button('PageFrame1_btnSaveTimeLine')

    frontend.choose_checkbox('ow selection of any clinical finding', test=True)
    log.attach_selenium_screenshot('CLINICAL FINDINGS', frontend.driver)
    frontend.click_button('PageFrame1_btnSaveClinicalFindings')

    frontend.choose_on_dropdown_in_table('Lead Author', 'Admin, Sylogent')
    frontend.choose_authors('Other Authors', ('Mark', ))
    log.attach_selenium_screenshot('AUTHORS', frontend.driver)
    frontend.click_button('PageFrame1_btnSaveAuthors')

    frontend.config_task('Task 1', {'Admin, Sylogent': 'req'})
    log.attach_selenium_screenshot('TASKS AND RESOURCES', frontend.driver)
    frontend.click_button('btnSaveTasksAndResources')
    log.attach_selenium_screenshot('SUMMARY', frontend.driver)
    frontend.click_button('PageFrame1_btnFinish')
    sleep(3)

    close_popups(frontend.driver)
Esempio n. 2
0
    def attach_selenium_screenshot(self, attach_name, selenium_driver):
        if selenium_driver:
            try:
                close_popups(selenium_driver)
                self.debug('Attach screenshot')
                self.attach_png(attach_name,
                                selenium_driver.get_screenshot_as_png())
                self.debug('...Done')
            except Exception as e:
                self.error('Cannot get screenshot from SeleniumWebDriver')
                pytest.allure.attach(attach_name, str(e))

        else:
            self.error('No browser is define')
Esempio n. 3
0
        def wrapper(*args, **kwargs):
            for attempt in range(2, -1, -1):
                try:
                    close_popups(instance.driver)
                    self.method(instance, *args, **kwargs)
                    break

                except Exception as e:
                    # return instance
                    instance.status = 'restart'
                    logger.warning('Browser error %s' % instance.node_info, exc_info=e)
                    if instance.node_connect_retry_count:
                        instance.node_connect_retry_count -= 1
                        instance.restart_session()

            else:
                logger.fatal('Fatal error %s' % instance)
                raise SeleniumBrowserNotStarting()
Esempio n. 4
0
 def wrapper(*args, **kwargs):
     close_popups(instance.driver)
     self.method(instance, *args, **kwargs)
Esempio n. 5
0
 def wrapper(*args, **kwargs):
     print('ClosePopups Instance is: {}'.format(instance))
     close_popups(instance.driver)
     self.method(instance, *args, **kwargs)