From 6b973753d407d66dfa5fda86547246c486ab7087 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Sat, 15 Jan 2022 11:33:10 +0300 Subject: tdf#146754: consider xyz:123 as host:port when parsing URLs smart ... rather than scheme: and path. Change-Id: I9a48310b585b8fa3e31635f877a91f1560b065f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128457 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- sw/qa/uitest/writer_tests3/hyperlinkdialog.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'sw') diff --git a/sw/qa/uitest/writer_tests3/hyperlinkdialog.py b/sw/qa/uitest/writer_tests3/hyperlinkdialog.py index c20a39b48f2a..c737f33ad1b8 100644 --- a/sw/qa/uitest/writer_tests3/hyperlinkdialog.py +++ b/sw/qa/uitest/writer_tests3/hyperlinkdialog.py @@ -72,6 +72,27 @@ class HyperlinkDialog(UITestCase): self.assertEqual(get_state_as_dict(xedit)["SelectedText"], "link") + def test_insert_hyperlink_without_scheme(self): + + with self.ui_test.create_doc_in_start_center("writer"): + xMainWindow = self.xUITest.getTopFocusWindow() + + with self.ui_test.execute_dialog_through_command(".uno:HyperlinkDialog") as xDialog: + + # insert link + xtab=xDialog.getChild("tabcontrol") + select_pos(xtab, "0") + + xtarget = xDialog.getChild("target") + xtarget.executeAction("TYPE", mkPropertyValues({"TEXT": "www.libreoffice.org:80"})) + + # Check that the link is added with http scheme + xMainWindow = self.xUITest.getTopFocusWindow() + xedit = xMainWindow.getChild("writer_edit") + xedit.executeAction("SELECT", mkPropertyValues({"START_POS": "0", "END_POS": "29"})) + self.assertEqual(get_state_as_dict(xedit)["SelectedText"], "http://www.libreoffice.org:80") + + def test_tdf141166(self): # Skip this test for --with-help=html and --with-help=online, as that would fail with a # DialogNotExecutedException("did not execute a dialog for a blocking action") thrown from -- cgit