Ejemplo n.º 1
0
    def set_expects(self, expects):
        newlist = make_list(expects)
        for item in newlist:
            for key in item:
                if not key in ('path', 'hash', 'host', 'selectorExists',
                               'selectorNotExists', 'trigger', 'triggerArgs',
                               'triggerDelay'):

                    self.onLog.emit(WARNING,
                                    '%s is not a valid expect field' % key)

            item['selectorExists'] = make_list(item.get('selectorExists'))
            item['selectorNotExists'] = make_list(
                item.get('selectorNotExists'))

        self.proxy.set_expects(newlist)
Ejemplo n.º 2
0
    def set_expects(self, expects):
        self._expects_active = True

        newlist = make_list(expects)
        for item in newlist:
            for key in item:
                if not key in ('path', 'hash', 'host', 'selector_exists',
                               'selector_not_exists', 'trigger',
                               'trigger_args', 'trigger_delay',
                               'trigger_wait_pageload', 'custom'):

                    self.warn('"%s" is not a valid expect field.' % key)

            item['selector_exists'] = make_list(item.get('selector_exists'))
            item['selector_not_exists'] = make_list(
                item.get('selector_not_exists'))

        self._expects = newlist
Ejemplo n.º 3
0
    def _on_next_queue_trigger(app, frame=None):
        if not app._active_task is None:
            app._queue.task_done()

        try:
            app._active_task = task = app._queue.get(timeout=15)
        except Empty:
            app.info('No more task in the queue.')
            app.web_view.close()
            app.exit(0)
            return

        expects = make_list(task['expects'])
        for expect in expects:
            expect['trigger_wait_pageload'] = True

        app.set_expects(expects)
        app.load(task['goto'])
Ejemplo n.º 4
0
 def set_upload_files(self, filenames):
     self.web_page.upload_files = make_list(filenames)
Ejemplo n.º 5
0
 def set_timeout_expects(self, timeout, expects):
     self._expects_timer.start(timeout * 1000)
     self._expects_if_timeout = make_list(expects)