Skip to content

Pas: Updates#2435

Merged
cyrillkuettel merged 4 commits intomasterfrom
pas-golive-1
Apr 17, 2026
Merged

Pas: Updates#2435
cyrillkuettel merged 4 commits intomasterfrom
pas-golive-1

Conversation

@cyrillkuettel
Copy link
Copy Markdown
Contributor

Please fill in the commit message below and work through the checklist. You can delete parts that are not needed, e.g. the optional description, the link to a ticket or irrelevant options of the checklist.

Commit message

Pas: Updates

TYPE: Feature

Checklist

  • I have performed a self-review of my code

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 2, 2026

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
2651 1 2650 16
View the top 1 failed test(s) by shortest run time
tests/onegov/org/test_browser.py::test_script_escaped_in_user_submitted_html@browser
Stack Traces | 18.5s run time
browser = <tests.shared.browser.ExtendedBrowser object at 0x7fb71f436ba0>
org_app = <tests.onegov.org.conftest.TestOrgApp object at 0x7fb71f9f2cf0>

    @pytest.mark.xdist_group(name="browser")
    def test_script_escaped_in_user_submitted_html(
        browser: ExtendedBrowser,
        org_app: TestOrgApp
    ) -> None:
    
        # This test attempts to inject JS (should not succeed of course)
        payload = """<script>document.addEventListener('DOMContentLoaded', () =>
        document.body.insertAdjacentHTML('afterbegin',
        '<h1 id="foo">This text has been injected with JS!</h1>'));</script>"""
    
        browser.login_admin()
    
        DirectoryCollection(org_app.session(), type='extended').add(
            **{
                'title': 'Clubs',
                'lead': 'this is just a normal lead',
                'structure': 'name *= ___',
            },
            configuration="""
                title:
                    - name
                order:
                    - name
                display:
                    content:
                        - name
            """,
        )
    
        transaction.commit()
    
        browser.visit('/directories/clubs')
    
        add_button = '.edit-bar .right-side.tiny.button'  # Hinzufügen
        new_directory_button = 'a.new-directory-entry'  # Verzeichnis
        browser.find_by_css(add_button).click()
        assert browser.wait_for(
            lambda: bool(browser.find_by_css(new_directory_button)),
            timeout=3,
        )
>       browser.find_by_css(new_directory_button).click()

.../onegov/org/test_browser.py:660: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/shared/browser.py:160: in click
    self._locator.first.click()
.............../app/lib/python3.14.../playwright/sync_api/_generated.py:15631: in click
    self._sync(
.............../app/lib/python3.14.../playwright/_impl/_locator.py:162: in click
    return await self._frame._click(self._selector, strict=True, **params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.............../app/lib/python3.14.../playwright/_impl/_frame.py:566: in _click
    await self._channel.send("click", self._timeout, locals_to_params(locals()))
.............../app/lib/python3.14.../playwright/_impl/_connection.py:69: in send
    return await self._connection.wrap_api_call(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <playwright._impl._connection.Connection object at 0x7fb71f434830>
cb = <function Channel.send.<locals>.<lambda> at 0x7fb71a5480f0>
is_internal = False, title = None

    async def wrap_api_call(
        self, cb: Callable[[], Any], is_internal: bool = False, title: str = None
    ) -> Any:
        if self._api_zone.get():
            return await cb()
        task = asyncio.current_task(self._loop)
        st: List[inspect.FrameInfo] = getattr(
            task, "__pw_stack__", None
        ) or inspect.stack(0)
    
        parsed_st = _extract_stack_trace_information_from_stack(st, is_internal, title)
        self._api_zone.set(parsed_st)
        try:
            return await cb()
        except Exception as error:
>           raise rewrite_error(error, f"{parsed_st['apiName']}: {error}") from None
E           playwright._impl._errors.TimeoutError: Locator.click: Timeout 2000ms exceeded.
E           Call log:
E             - waiting for locator("a.new-directory-entry").first
E               - locator resolved to <a class="new-directory-entry" href="http://127.0.0.1:36847/directories/clubs/+new?keywords=&page=0&past_only=0&published_only=0&upcoming_only=0">Eintrag</a>
E             - attempting click action
E               - waiting for element to be visible, enabled and stable
E               - element is visible, enabled and stable
E               - scrolling into view if needed
E               - done scrolling
E               - performing click action
E               - click action done
E               - waiting for scheduled navigations to finish

.............../app/lib/python3.14.../playwright/_impl/_connection.py:559: TimeoutError

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@cyrillkuettel cyrillkuettel merged commit 31f7bad into master Apr 17, 2026
13 of 14 checks passed
@cyrillkuettel cyrillkuettel deleted the pas-golive-1 branch April 17, 2026 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant