portal_web.tests package¶
Subpackages¶
- portal_web.tests.functional package
- Submodules
- portal_web.tests.functional.test_login module
TestLogin
TestLogin.pytestmark
TestLogin.test_email_validator()
TestLogin.test_login_with_right_credentials()
TestLogin.test_login_with_wrong_email()
TestLogin.test_login_with_wrong_password()
TestLogin.test_required_field_email()
TestLogin.test_required_field_password()
TestLogin.test_unverified_login_with_right_password()
TestLogin.test_unverified_login_with_wrong_password()
web_user()
- Module contents
- portal_web.tests.integration package
- portal_web.tests.unit package
- Subpackages
- Submodules
- portal_web.tests.unit.test_helpers module
- portal_web.tests.unit.test_resources module
ResourceBaseChildMock
ResourceBaseMock
TestResources
TestResources.test_add_child()
TestResources.test_dictionary_merge_firstlevel_deletion()
TestResources.test_dictionary_merge_firstlevel_new_persistance()
TestResources.test_dictionary_merge_secondlevel_new_persistance()
TestResources.test_dictionary_merge_secondlevel_original_persistance()
TestResources.test_getitem_KeyError()
TestResources.test_getitem_child()
TestResources.test_resourcebase__str__()
TestResources.test_resourcebase_init()
TestResources.test_resourcebase_init_parent()
TestWebRootFactory
new_dict()
orig_dict()
- Module contents
Submodules¶
portal_web.tests.conftest module¶
Pytest Fixtures
- class portal_web.tests.conftest.BrowserHelper(gui, api, screenshots=True, screenshot_path='/shared/tests/screenshots')[source]¶
Bases:
object
Browser helper for use in selenium tests with pytest.
Notes: - undefined attributes of this class will be requested from self.browser - urls starting with “/” or “gui/” will send requests to the the webgui
service and “api/” to the webapi service.
- browser¶
remote webdriver
- Type:
webdriver.Remote
- options¶
options used for the webdriver
- Type:
webdriver.Options
- host¶
hostname/ip to remote access the app
- Type:
str
- gui¶
webgui app
- Type:
webtest.http.StopableWSGIServer
- api¶
webapi app
- Type:
webtest.http.StopableWSGIServer
- screenshots¶
create screenshots during a test run
- Type:
bool
- screenshot_path¶
directory for screenshots
- Type:
str
- class portal_web.tests.conftest.PyramidHelper(settings)[source]¶
Bases:
object
Pyramid helper for use in pytests.
- settings¶
parsed pyramid ini config
- Type:
paste.deploy.config
- request¶
empty dummy request
- Type:
pyramid.testing.DummyRequest
- resource¶
empty dummy resource
- Type:
pyramid.testing.DummyResource
- config¶
pyramid app config
- Type:
pyramid.config.Configurator
- registry¶
pyramid registry
- Type:
pyramid.registry.Registry
- class portal_web.tests.conftest.TrytonHelper(settings)[source]¶
Bases:
object
Tryton helper for use in pytests.
- settings¶
parsed pyramid ini config
- Type:
paste.deploy.config
- pool¶
Initialized pool
- Type:
Pool
- transaction()¶
Tdb transaction decorator
- portal_web.tests.conftest.api(settings)[source]¶
Sets up an webapi service with TestApp.
- Returns:
for functional tests with webtest
- Return type:
webtest.TestApp
- portal_web.tests.conftest.browser(browser_gui, browser_api)[source]¶
Provides the selenoum test browser.
- Yields:
BrowserHelper –
- selenium remote connection to selenium hub service with
additional helper functions
- portal_web.tests.conftest.browser_api(settings)[source]¶
Sets up an webapi service with StopableWSGIServer.
- Yields:
webtest.http.StopableWSGIServer – for integration tests with selenium
- portal_web.tests.conftest.browser_gui(settings)[source]¶
Sets up a webgui service with StopableWSGIServer.
- Yields:
webtest.http.StopableWSGIServer – for integration tests with selenium
- portal_web.tests.conftest.delete_screenshots()[source]¶
Deletes all screenshots of previous selenium tests.
- portal_web.tests.conftest.dummy_request()[source]¶
Creates an empty dummy request.
- Returns:
dummy request
- Return type:
pyramid.testing.DummyRequest
- portal_web.tests.conftest.dummy_resource()[source]¶
Creates an empty dummy resource.
- Returns:
dummy resource
- Return type:
pyramid.testing.DummyResource
- portal_web.tests.conftest.gui(settings)[source]¶
Sets up a webgui service with TestApp.
- Returns:
for functional tests with webtest
- Return type:
webtest.TestApp
- portal_web.tests.conftest.pyramid(settings)[source]¶
Provides the pyramid helper class.
- Yields:
PyramidHelper – Helper with usual pyramid testing objects accessible
- portal_web.tests.conftest.pytest_collection_modifyitems(session, config, items)[source]¶
Fixes the nodid path string to show the full path.
- portal_web.tests.conftest.request_with_registry(settings)[source]¶
Creates a request with registry set up.
- Returns:
dummy request
- Return type:
pyramid.testing.DummyRequest