| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
from uitest.framework import UITestCase |
| 10 |
from uitest.uihelper.common import get_url_for_data_file, get_state_as_dict, select_by_text |
| 11 |
from uitest.test import DEFAULT_SLEEP |
| 12 |
|
| 13 |
import sys |
| 14 |
import time |
| 15 |
|
| 16 |
|
| 17 |
class tdf99619(UITestCase): |
| 18 |
def test_tdf99619(self): |
| 19 |
hey both |
| 20 |
|
| 21 |
|
| 22 |
oin. |
| 23 |
with self.ui_test.load_file(get_url_for_data_file("tdf99619.odb")) as document: |
| 24 |
xDbWindow = self.xUITest.getTopFocusWindow() |
| 25 |
|
| 26 |
self.xUITest.executeCommand(".uno:DBViewQueries") |
| 27 |
|
| 28 |
|
| 29 |
xToolkit = self.xContext.ServiceManager.createInstance('com.sun.star.awt.Toolkit') |
| 30 |
xToolkit.waitUntilAllIdlesDispatched() |
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
self.xUITest.executeCommand(".uno:SelectAll") |
| 37 |
|
| 38 |
xDbFrame = self.ui_test.get_desktop().getCurrentFrame() |
| 39 |
|
| 40 |
with self.ui_test.open_subcomponent_through_command(".uno:DBQueryEdit") as xQueryFrame: |
| 41 |
xQueryController = xQueryFrame.getController() |
| 42 |
|
| 43 |
|
| 44 |
with self.ui_test.execute_blocking_action( |
| 45 |
self.xUITest.executeCommandForProvider, |
| 46 |
args=(".uno:DBAddRelation", xQueryController)) as xDialog: |
| 47 |
|
| 48 |
|
| 49 |
select_by_text(xDialog.getChild("table1"), "object") |
| 50 |
select_by_text(xDialog.getChild("table2"), "person") |
| 51 |
|
| 52 |
|
| 53 |
select_by_text(xDialog.getChild("type"), "Inner join") |
| 54 |
|
| 55 |
ct |
| 56 |
|
| 57 |
xDialog.getChild("natural").executeAction("CLICK", tuple()) |
| 58 |
|
| 59 |
|
| 60 |
self.xUITest.executeCommandForProvider(".uno:Undo", xQueryFrame) |
| 61 |
|
| 62 |
self.xUITest.executeCommandForProvider(".uno:Redo", xQueryFrame) |
| 63 |
|
| 64 |
|
| 65 |
sk |
| 66 |
self.xUITest.executeCommandForProvider(".uno:Save", xQueryFrame) |
| 67 |
|
| 68 |
|
| 69 |
self.xUITest.executeCommandForProvider(".uno:DBChangeDesignMode", |
| 70 |
xQueryController) |
| 71 |
|
| 72 |
|
| 73 |
xSql = self.xUITest.getTopFocusWindow().getChild("sql") |
| 74 |
query = get_state_as_dict(xSql)["Text"] |
| 75 |
|
| 76 |
|
| 77 |
if "NATURAL INNER JOIN" not in query: |
| 78 |
print(f"Join missing from query: {query}", file=sys.stderr) |
| 79 |
self.assertTrue("NATURAL INNER JOIN" in query) |
| 80 |
|
| 81 |
|