Unit tests fail where mouseClick() is used to simulate a click event on a MouseArea which is a descendant of a TextField
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ubuntu-ui-toolkit (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
This appears to be a regression in version 1.3 of the UITK.
The browser has an AddressBar component which contains a TextField, and the secondaryItem for this TextField is a MouseArea (for toggling the bookmarked status of the current address). This component is unit tested, and there is a test that simulates a click on the secondaryItem to verify that the bookmarked status is correctly toggled.
This test worked with version 1.2 of the UITK, but fails when I update the import of Ubuntu.Components to 1.3.
It appears that the TextField itself intercepts the simulated mouse click event, thus getting active focus.
Note that the component works as expected when used in an app by a normal user manipulating a mouse (i.e. the secondaryItem can be clicked and that toggles the bookmark status as expected). It’s only the unit tests that are failing.
I’m suspecting that the way QtTest simulates a mouse click event doesn’t play well with Ubuntu.
Related branches
- PS Jenkins bot: Needs Fixing (continuous-integration)
- Ugo Riboni (community): Approve
-
Diff: 2077 lines (+291/-292)105 files modifieddebian/control (+12/-12)
doc/WebView.qdoc (+2/-2)
src/Ubuntu/Web/ItemSelector02.qml (+5/-5)
src/Ubuntu/Web/Selection.qml (+3/-3)
src/Ubuntu/Web/SelectionHandle.qml (+3/-3)
src/Ubuntu/Web/UbuntuSharedWebContext.qml (+1/-1)
src/Ubuntu/Web/UbuntuWebContext.qml (+1/-1)
src/Ubuntu/Web/UbuntuWebView02.qml (+4/-4)
src/app/AlertDialog.qml (+3/-3)
src/app/AuthenticationDialog.qml (+4/-4)
src/app/BeforeUnloadDialog.qml (+3/-3)
src/app/BrowserView.qml (+2/-2)
src/app/BrowserWindow.qml (+3/-3)
src/app/CertificateVerificationDialog.qml (+4/-4)
src/app/ChromeBase.qml (+2/-2)
src/app/ChromeButton.qml (+3/-3)
src/app/ChromeController.qml (+1/-1)
src/app/ConfirmDialog.qml (+3/-3)
src/app/ContentDownloadDialog.qml (+4/-4)
src/app/ContentPickerDialog.qml (+4/-4)
src/app/ContentShareDialog.qml (+4/-4)
src/app/Downloader.qml (+4/-4)
src/app/ErrorSheet.qml (+3/-3)
src/app/Favicon.qml (+2/-2)
src/app/FilePickerDialog.qml (+4/-4)
src/app/GeolocationPermissionRequest.qml (+4/-4)
src/app/InvalidCertificateErrorSheet.qml (+3/-3)
src/app/KeyboardRectangle.qml (+3/-3)
src/app/ModalDialog.qml (+4/-4)
src/app/PromptDialog.qml (+3/-3)
src/app/ProxyAuthenticationDialog.qml (+2/-2)
src/app/Share.qml (+4/-4)
src/app/ThinProgressBar.qml (+2/-2)
src/app/WebViewImpl.qml (+3/-3)
src/app/actions/Back.qml (+2/-2)
src/app/actions/Bookmark.qml (+2/-2)
src/app/actions/BookmarkLink.qml (+2/-2)
src/app/actions/ClearHistory.qml (+2/-2)
src/app/actions/Copy.qml (+2/-2)
src/app/actions/CopyImage.qml (+2/-2)
src/app/actions/CopyLink.qml (+2/-2)
src/app/actions/Forward.qml (+2/-2)
src/app/actions/GoTo.qml (+2/-2)
src/app/actions/NewTab.qml (+2/-2)
src/app/actions/OpenImageInNewTab.qml (+2/-2)
src/app/actions/OpenLinkInNewBackgroundTab.qml (+2/-2)
src/app/actions/OpenLinkInNewTab.qml (+2/-2)
src/app/actions/Reload.qml (+2/-2)
src/app/actions/SaveImage.qml (+2/-2)
src/app/actions/ShareLink.qml (+2/-2)
src/app/webbrowser/AddressBar.qml (+17/-21)
src/app/webbrowser/BookmarkOptions.qml (+3/-3)
src/app/webbrowser/BookmarksFolderListView.qml (+3/-3)
src/app/webbrowser/BookmarksModel.qml (+2/-2)
src/app/webbrowser/BottomEdgeHandle.qml (+1/-1)
src/app/webbrowser/Browser.qml (+4/-4)
src/app/webbrowser/Chrome.qml (+2/-2)
src/app/webbrowser/ExpandedHistoryView.qml (+2/-2)
src/app/webbrowser/HistoryModel.qml (+2/-2)
src/app/webbrowser/HistorySectionDelegate.qml (+3/-3)
src/app/webbrowser/HistoryView.qml (+2/-2)
src/app/webbrowser/KeyboardShortcut.qml (+2/-2)
src/app/webbrowser/KeyboardShortcuts.qml (+1/-1)
src/app/webbrowser/LeavePrivateModeDialog.qml (+3/-3)
src/app/webbrowser/NavigationBar.qml (+2/-2)
src/app/webbrowser/NewPrivateTabView.qml (+2/-2)
src/app/webbrowser/NewTabView.qml (+2/-2)
src/app/webbrowser/SearchEngines.qml (+1/-1)
src/app/webbrowser/SearchSuggestions.qml (+1/-1)
src/app/webbrowser/SecurityCertificatePopover.qml (+4/-4)
src/app/webbrowser/SettingsPage.qml (+4/-4)
src/app/webbrowser/SettingsPageHeader.qml (+4/-3)
src/app/webbrowser/Suggestion.qml (+3/-3)
src/app/webbrowser/Suggestions.qml (+3/-3)
src/app/webbrowser/TabChrome.qml (+2/-2)
src/app/webbrowser/TabPreview.qml (+2/-2)
src/app/webbrowser/TabsBar.qml (+2/-2)
src/app/webbrowser/TabsList.qml (+2/-2)
src/app/webbrowser/Toolbar.qml (+2/-2)
src/app/webbrowser/ToolbarAction.qml (+3/-3)
src/app/webbrowser/UrlDelegate.qml (+2/-2)
src/app/webbrowser/UrlsList.qml (+2/-2)
src/app/webbrowser/webbrowser-app.qml (+3/-3)
src/app/webcontainer/AccountChooserDialog.qml (+4/-4)
src/app/webcontainer/AccountErrorScreen.qml (+2/-2)
src/app/webcontainer/AccountItem.qml (+4/-4)
src/app/webcontainer/AccountsLogic.qml (+1/-1)
src/app/webcontainer/AccountsPage.qml (+2/-2)
src/app/webcontainer/AccountsSplashScreen.qml (+2/-2)
src/app/webcontainer/Chrome.qml (+3/-3)
src/app/webcontainer/OnlineAccountsController.qml (+1/-1)
src/app/webcontainer/PopupWindowController.qml (+4/-4)
src/app/webcontainer/PopupWindowOverlay.qml (+4/-4)
src/app/webcontainer/SplashScreen.qml (+2/-2)
src/app/webcontainer/WebApp.qml (+2/-2)
src/app/webcontainer/WebViewImplOxide.qml (+4/-4)
src/app/webcontainer/WebappContainerWebview.qml (+3/-3)
src/app/webcontainer/webapp-container.qml (+3/-3)
tests/autopilot/webbrowser_app/emulators/browser.py (+3/-2)
tests/unittests/qml/tst_AddressBar.qml (+4/-3)
tests/unittests/qml/tst_BrowserTab.qml (+1/-1)
tests/unittests/qml/tst_SearchEngines.qml (+1/-1)
tests/unittests/qml/tst_TabsBar.qml (+1/-1)
tests/unittests/qml/tst_UbuntuWebView02.qml (+2/-2)
tests/unittests/tabs-model/tst_TabsModelTests.cpp (+1/-1)
I’m attaching a simple standalone reproducer. Observe the issue by running it like that:
qmltestrunner -input tst_test.qml