当前位置: 首页>>代码示例>>Python>>正文


Python browser.Browser类代码示例

本文整理汇总了Python中hexagonit.testing.browser.Browser的典型用法代码示例。如果您正苦于以下问题:Python Browser类的具体用法?Python Browser怎么用?Python Browser使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Browser类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setUp

def setUp(self):
    layer = self.globs['layer']
    browser = Browser(layer['app'])
    portal = layer['portal']
    # Update global variables within the tests.
    self.globs.update({
        'TEST_USER_NAME': TEST_USER_NAME,
        'TEST_USER_PASSWORD': TEST_USER_PASSWORD,
        'browser': browser,
        'portal': portal,
    })

    browser.setBaseUrl(portal.absolute_url())

    browser.handleErrors = True
    portal.error_log._ignored_exceptions = ()

    setRoles(portal, TEST_USER_ID, ['Manager'])

    user2 = 'test_user_2_'
    regtool = getToolByName(portal, 'portal_registration')
    regtool.addMember(user2, user2)
    setRoles(portal, user2, ['Editor'])
    self.globs['user2'] = user2

    transaction.commit()
开发者ID:hexagonit,项目名称:hexagonit.portletroles,代码行数:26,代码来源:test_functional.py

示例2: setUp

def setUp(self):
    layer = self.globs['layer']
    portal = layer['portal']
    browser = Browser(layer['app'])
    self.globs.update({
        'TEST_USER_NAME': TEST_USER_NAME,
        'TEST_USER_PASSWORD': TEST_USER_PASSWORD,
        'browser': browser,
        'portal': portal,
    })
    portal_url = portal.absolute_url()
    browser.setBaseUrl(portal_url)

    browser.handleErrors = True
    portal.error_log._ignored_exceptions = ()

    setRoles(portal, TEST_USER_ID, ['Manager'])

    self.globs['controlpanel_url'] = '{}/@@overview-controlpanel'.format(portal_url)

    folder01 = portal[
        portal.invokeFactory(
            'Folder',
            'folder01',
            subject=('Täg01', 'Tög02', 'Tåg03'),
        )
    ]
    folder01.reindexObject()

    transaction.commit()
开发者ID:collective,项目名称:collective.searchevent,代码行数:30,代码来源:test_registry.py

示例3: setUp

def setUp(self):
    layer = self.globs['layer']
    browser = Browser(layer['app'])
    portal = layer['portal']
    # Update global variables within the tests.
    self.globs.update({
        'TEST_USER_NAME': TEST_USER_NAME,
        'TEST_USER_PASSWORD': TEST_USER_PASSWORD,
        'browser': browser,
        'portal': portal,
    })

    browser.setBaseUrl(portal.absolute_url())

    browser.handleErrors = True
    portal.error_log._ignored_exceptions = ()

    setRoles(portal, TEST_USER_ID, ['Site Administrator'])
    # setRoles(portal, TEST_USER_ID, ['Manager'])

    # Create folder.
    folder = portal[portal.invokeFactory('Folder', 'folder')]
    folder.reindexObject()

    transaction.commit()
开发者ID:collective,项目名称:collective.microsite,代码行数:25,代码来源:test_functional.py

示例4: setUp

def setUp(self):
    layer = self.globs['layer']
    browser = Browser(layer['app'])
    portal = layer['portal']

    # Update global variables within the tests.
    self.globs.update({
        'TEST_USER_NAME': TEST_USER_NAME,
        'TEST_USER_PASSWORD': TEST_USER_PASSWORD,
        'browser': browser,
        'portal': portal,
    })

    browser.setBaseUrl(portal.absolute_url())
    browser.handleErrors = True
    portal.error_log._ignored_exceptions = ()
    setRoles(portal, TEST_USER_ID, ['Manager'])

    footer_info = portal[portal.invokeFactory('Folder', 'footer-info')]
    footer_info.reindexObject()
    info1 = footer_info[footer_info.invokeFactory(
        'Document', 'info1', title="Info1", text='<p>Text of Info1</p>')]
    info1.reindexObject()
    info2 = footer_info[footer_info.invokeFactory(
        'Document', 'info2', title="Info2", text='<p>Text of Info2</p>')]
    info2.reindexObject()
    info3 = footer_info[footer_info.invokeFactory(
        'Document', 'info3', title="Info3", text='<p>Text of Info3</p>')]
    info3.reindexObject()

    transaction.commit()
开发者ID:taito,项目名称:sll.basetheme,代码行数:31,代码来源:test_functional.py

示例5: setUp

def setUp(self):
    layer = self.globs['layer']
    browser = Browser(layer['app'])
    portal = layer['portal']
    # Update global variables within the tests.
    self.globs.update({
        'TEST_USER_NAME': TEST_USER_NAME,
        'TEST_USER_PASSWORD': TEST_USER_PASSWORD,
        'browser': browser,
        'portal': portal,
    })

    portal_url = portal.absolute_url()
    browser.setBaseUrl(portal_url)

    self.globs['controlpanel_url'] = '{0}/@@overview-controlpanel'.format(portal_url)

    browser.handleErrors = True
    portal.error_log._ignored_exceptions = ()

    setRoles(portal, TEST_USER_ID, ['Manager'])

    image_file = open(os.path.join(os.path.dirname(__file__), 'image', 'image.png'), 'rb')

    # Creat Image.
    image = portal[portal.invokeFactory('Image', 'picture', image='image.png')]
    image.setImage(image_file)
    self.globs['image_url'] = '{0}/view'.format(image.absolute_url())

    # Create News.
    news = portal[portal.invokeFactory('News Item', 'news', title='News')]
    news.setImage(image_file)
    self.globs['news_url'] = '{0}/view'.format(news.absolute_url())

    transaction.commit()
开发者ID:collective,项目名称:collective.cropimage,代码行数:35,代码来源:test_functional.py

示例6: setUp

def setUp(self):
    layer = self.globs['layer']
    browser = Browser(layer['app'])
    portal = layer['portal']

    self.globs.update({
        'TEST_USER_NAME': TEST_USER_NAME,
        'TEST_USER_PASSWORD': TEST_USER_PASSWORD,
        'browser': browser,
        'portal': portal,
    })

    browser.setBaseUrl(portal.absolute_url())
    browser.handleErrors = True
    portal.error_log._ignored_exceptions = ()
    setRoles(portal, TEST_USER_ID, ['Manager'])

    # Create News Item.
    newsitem = portal[portal.invokeFactory('News Item', 'newsitem')]
    newsitem.reindexObject()

    # Set the site back in English mode to make testing easier.
    portal.portal_languages.manage_setLanguageSettings('en', ['en', 'fi'])

    transaction.commit()
开发者ID:taito,项目名称:sll.policy,代码行数:25,代码来源:test_functional.py

示例7: setUp

def setUp(self):
    layer = self.globs["layer"]
    app = layer["app"]
    browser = Browser(app)
    portal = layer["portal"]

    self.globs.update(
        {
            "TEST_USER_NAME": TEST_USER_NAME,
            "TEST_USER_PASSWORD": TEST_USER_PASSWORD,
            "browser": browser,
            "portal": portal,
        }
    )

    browser.setBaseUrl(portal.absolute_url())
    browser.handleErrors = True
    portal.error_log._ignored_exceptions = ()
    setRoles(portal, TEST_USER_ID, ["Manager"])

    ztc.utils.setupCoreSessions(app)
    wftool = getToolByName(portal, "portal_workflow")
    portal.invokeFactory("FormFolder", "form01", title="Form01", thanksPageOverride="traverse_to:string:form02")
    form01 = portal.form01
    form01.actionAdapter = ()
    wftool.doActionFor(form01, "publish")
    form01.reindexObject()
    portal.invokeFactory("FormFolder", "form02", title="Form02", thanksPageOverride="traverse_to:string:form2")
    form02 = portal.form02
    wftool.doActionFor(form02, "publish")
    form02.reindexObject()
    del form02["thank-you"]
    del form02["mailer"]

    transaction.commit()
开发者ID:taito,项目名称:collective.pfg.showrequest,代码行数:35,代码来源:test_functional.py

示例8: setUp

def setUp(self):
    layer = self.globs["layer"]
    browser = Browser(layer["app"])
    portal = layer["portal"]
    # Update global variables within the tests.
    self.globs.update(
        {
            "browser": browser,
            "portal": portal,
            "TEST_USER_NAME": TEST_USER_NAME,
            "TEST_USER_PASSWORD": TEST_USER_PASSWORD,
        }
    )

    browser.setBaseUrl(portal.absolute_url())

    browser.handleErrors = True
    portal.error_log._ignored_exceptions = ()

    setRoles(portal, TEST_USER_ID, ["Manager"])

    data_path = "/".join(__file__.split("/")[:-1] + ["files", "data.csv"])
    self.globs["data_path"] = data_path
    self.globs["data_file"] = open(data_path)

    transaction.commit()
开发者ID:collective,项目名称:Products.PloneGazette,代码行数:26,代码来源:test_functional.py

示例9: setUp

def setUp(self):
    layer = self.globs['layer']
    browser = Browser(layer['app'])
    portal = layer['portal']

    # Update global variables within the tests.
    self.globs.update({
        'TEST_USER_NAME': TEST_USER_NAME,
        'TEST_USER_PASSWORD': TEST_USER_PASSWORD,
        'browser': browser,
        'portal': portal,
    })

    browser.setBaseUrl(portal.absolute_url())
    browser.handleErrors = True
    portal.error_log._ignored_exceptions = ()
    setRoles(portal, TEST_USER_ID, ['Manager'])

    membership = getToolByName(portal, 'portal_membership')
    # membership.setMemberAreaType('Folder')
    membership.memberareaCreationFlag = True

    regtool = getToolByName(portal, 'portal_registration')

    regtool.addMember('member1', 'member1')
    setRoles(portal, 'member1', ['Member'])

    transaction.commit()
开发者ID:taito,项目名称:slt.portlet,代码行数:28,代码来源:test_functional.py

示例10: setUp

def setUp(self):
    layer = self.globs['layer']
    browser = Browser(layer['app'])
    portal = layer['portal']
    workflow = getToolByName(portal, 'portal_workflow')

    self.globs.update({
        'TEST_USER_NAME': TEST_USER_NAME,
        'TEST_USER_PASSWORD': TEST_USER_PASSWORD,
        'browser': browser,
        'portal': portal,
        'workflow': workflow,
    })

    browser.setBaseUrl(portal.absolute_url())

    browser.handleErrors = True
    portal.error_log._ignored_exceptions = ()

    setRoles(portal, TEST_USER_ID, ['Manager'])

    setUpDefaultMembersBoardAndForum(portal)
    setRoles(portal, 'reviewer1', ['Reviewer'])

    board = portal['board1']
    forum = board['forum1']
    self.globs['board'] = board
    self.globs['forum'] = forum

    transaction.commit()
开发者ID:hexagonit,项目名称:Products.Ploneboard,代码行数:30,代码来源:testFunctional.py

示例11: setUp

def setUp(self):
    layer = self.globs['layer']
    browser = Browser(layer['app'])
    portal = layer['portal']

    self.globs.update({
        'portal': portal,
        'browser': browser,
        'TEST_USER_NAME': TEST_USER_NAME,
        'TEST_USER_PASSWORD': TEST_USER_PASSWORD,
    })

    browser.setBaseUrl(portal.absolute_url())
    browser.handleErrors = True
    portal.error_log._ignored_exceptions = ()

    setRoles(portal, TEST_USER_ID, ['Manager'])

    document = portal[
        portal.invokeFactory(
            'Document',
            'document',
            title='Title of Document',
            description='Description of Document',
            text='<p>This is the body text of Document.</p>',
        )
    ]
    document.reindexObject()

    transaction.commit()
开发者ID:taito,项目名称:sll.templates,代码行数:30,代码来源:test_document.py

示例12: setUp

def setUp(self):
    layer = self.globs['layer']
    browser = Browser(layer['app'])
    portal = layer['portal']
    self.globs.update({
        'browser': browser,
        'portal': portal,
        'TEST_USER_NAME': TEST_USER_NAME,
        'TEST_USER_PASSWORD': TEST_USER_PASSWORD,
    })

    browser.setBaseUrl(portal.absolute_url())

    browser.handleErrors = True
    portal.error_log._ignored_exceptions = ()

    setRoles(portal, TEST_USER_ID, ['Manager'])

    # portal._original_MailHost = portal.MailHost
    portal.MailHost = mailhost = MockMailHost('MailHost')
    sm = getSiteManager(context=portal)
    sm.unregisterUtility(provided=IMailHost)
    sm.registerUtility(mailhost, provided=IMailHost)
    self.globs['messages'] = mailhost.messages
    self.globs['prink'] = prink

    transaction.commit()
开发者ID:collective,项目名称:Products.PloneGazette,代码行数:27,代码来源:test_spam.py

示例13: setUp

def setUp(self):
    layer = self.globs["layer"]
    portal = layer["portal"]
    browser = Browser(layer["app"])
    # Update global variables within the tests.
    self.globs.update(
        {
            "portal": portal,
            "browser": browser,
            "TEST_USER_NAME": TEST_USER_NAME,
            "TEST_USER_PASSWORD": TEST_USER_PASSWORD,
        }
    )

    browser.setBaseUrl(portal.absolute_url())

    browser.handleErrors = True
    portal.error_log._ignored_exceptions = ()

    setRoles(portal, TEST_USER_ID, ["Manager"])

    doc1 = portal[portal.invokeFactory("Document", "doc1", title="Doc1", description="Description of Döc1.")]
    doc1.reindexObject()
    doc2 = portal[portal.invokeFactory("Document", "doc2", title="Döc2", description="Description of Döc2.")]
    doc2.reindexObject()

    transaction.commit()
开发者ID:collective,项目名称:collective.portlet.contentsearch,代码行数:27,代码来源:test_functional.py

示例14: setUp

def setUp(self):
    layer = self.globs['layer']
    browser = Browser(layer['app'])
    portal = layer['portal']
    self.globs.update({
        'TEST_USER_NAME': TEST_USER_NAME,
        'TEST_USER_PASSWORD': TEST_USER_PASSWORD,
        'portal': portal,
        'browser': browser,
    })
    ztc.utils.setupCoreSessions(layer['app'])
    browser.setBaseUrl(portal.absolute_url())
    browser.handleErrors = True
    portal.error_log._ignored_exceptions = ()
    setRoles(portal, TEST_USER_ID, ['Manager'])

    alsoProvides(portal, IShoppingSiteRoot)

    # Set the site back in English mode to make testing easier.
    portal.portal_languages.manage_setLanguageSettings('en', ['en', 'fi'])

    # Set title and description for the plone site.
    portal.manage_changeProperties(title='Luonnonsuojelukauppa', description='Suomen Luonnonsuojelun Tuki Oy')

    regtool = getToolByName(portal, 'portal_registration')
    regtool.addMember('member1', 'member1')
    setRoles(portal, 'member1', ['Member'])

    transaction.commit()
开发者ID:taito,项目名称:slt.theme,代码行数:29,代码来源:test_functional.py

示例15: setUp

def setUp(self):
    layer = self.globs["layer"]
    portal = layer["portal"]
    browser = Browser(layer["app"])
    # Update global variables within the tests.
    self.globs.update(
        {
            "portal": portal,
            "browser": browser,
            "TEST_USER_NAME": TEST_USER_NAME,
            "TEST_USER_PASSWORD": TEST_USER_PASSWORD,
        }
    )

    browser.setBaseUrl(portal.absolute_url())

    browser.handleErrors = True
    portal.error_log._ignored_exceptions = ()

    setRoles(portal, TEST_USER_ID, ["Manager"])

    # Set the site back in English mode to make testing easier.
    portal.portal_languages.manage_setLanguageSettings("en", ["en", "fi"])

    transaction.commit()
开发者ID:collective,项目名称:collective.folderlogo,代码行数:25,代码来源:test_functional.py


注:本文中的hexagonit.testing.browser.Browser类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。