This issue has been created
There is 1 update, 1 comment.
 
 
XWiki Platform / cid:jira-generated-image-avatar-b448a02b-a598-42ae-910f-c37d073033ba XWIKI-22928 Open

InplaceEditIT#selectionRestoreOnSwitchToSource is always failing with chrome

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-2da93890-afaf-4cb4-86c9-77041b254802 Simon Urli created this issue on 25/Feb/25 10:25
 
Summary: InplaceEditIT#selectionRestoreOnSwitchToSource is always failing with chrome
Issue Type: cid:jira-generated-image-avatar-b448a02b-a598-42ae-910f-c37d073033ba Bug
Affects Versions: 17.1.0
Assignee: Unassigned
Attachments: image-2025-02-25-10-24-49-138.png
Components: Development Issues only
Created: 25/Feb/25 10:25
Priority: cid:jira-generated-image-static-major-11f44889-6cc1-4e25-b497-b68d5195e13c Major
Reporter: Simon Urli
Description:

The test is always failing with Chrome with the following stacktrace:

org.opentest4j.AssertionFailedError: expected: <2> but was: <441>
	at org.xwiki.edit.test.ui.InplaceEditIT.selectionRestoreOnSwitchToSource(InplaceEditIT.java:378)
	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	Suppressed: org.openqa.selenium.InvalidArgumentException: invalid argument: Unexpected dialog type beforeunload

And following screenshot:
_thumb_43367.png

The test doesn't fail on firefox

 
 

1 update

 
cid:jira-generated-image-avatar-2da93890-afaf-4cb4-86c9-77041b254802 Changes by Simon Urli on 25/Feb/25 10:28
 
Assignee: Marius Dumitru Florea
 
 

1 comment

 
cid:jira-generated-image-avatar-2da93890-afaf-4cb4-86c9-77041b254802 Simon Urli on 25/Feb/25 10:28
 

The test was introduced for testing regression over XWIKI-22899. When checking manually the behaviour on chrome I haven't been able to reproduce the problem related to that, so I believe it's only a test issue.

That being said I'm a bit surprised about the toolbar appearing on the very top of the window and I'm wondering if that's expected. Now the test itself seems to perform assertion using a DOM property that seems to not behave the same in firefox and chrome. But removing those assertions isn't even enough to fix the test, there's also the following assertion that seems to fail on chrome:

// Verify that the top left corner of the Source text area is visible (inside the viewport).
        assertTrue(setup.getDriver().isVisible(sourceTextArea, 0, 0));