@@ -283,6 +283,65 @@ def test_get_vocabulary(get_vocabulary):
283283
284284```
285285
286+ ### portal_factory
287+
288+ | | |
289+ | --- | --- |
290+ | Description | Factory to get portal with applied user roles. |
291+ | Required Fixture | ** acceptance** |
292+ | Scope | ** Function** |
293+
294+ ``` python
295+ import pytest
296+ from playwright.sync_api import expect
297+ from plone.app.testing.interfaces import (
298+ TEST_USER_NAME ,
299+ TEST_USER_PASSWORD ,
300+ )
301+
302+
303+ class TestPwEvents :
304+ @pytest.fixture (autouse = True )
305+ def setup (self , portal_factory ):
306+ self .portal = portal_factory(username = TEST_USER_NAME , roles = [' Member' , ' Contributor' ])
307+ self .plone_url = self .portal.absolute_url()
308+
309+ def test_events_listing (self ) -> None :
310+ ```
311+
312+
313+ ### playwright_page_factory
314+
315+ | | |
316+ | --- | --- |
317+ | Description | Factory to get a Playwright page with a logged-in user. |
318+ | Required Fixture | ** acceptance** |
319+ | Scope | ** Function** |
320+
321+ ``` python
322+ import pytest
323+ from playwright.sync_api import expect
324+ from plone.app.testing.interfaces import (
325+ TEST_USER_NAME ,
326+ TEST_USER_PASSWORD ,
327+ )
328+
329+
330+ class TestPwEvents :
331+ @pytest.fixture (autouse = True )
332+ def setup (self , portal_factory , playwright_page_factory ):
333+ self .page = playwright_page_factory(username = TEST_USER_NAME , password = TEST_USER_PASSWORD )
334+ self .portal = portal_factory(username = TEST_USER_NAME , roles = [' Member' , ' Contributor' ])
335+ self .plone_url = self .portal.absolute_url()
336+
337+ def test_events_listing (self ) -> None :
338+ page = self .page
339+ page.goto(f " { self .plone_url} " )
340+ page.get_by_role(" link" , name = " Add new…" ).click()
341+ page.get_by_role(" link" , name = " Folder" ).click()
342+ ```
343+
344+
286345### setup_tool
287346
288347| | |
0 commit comments