diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2019-09-30 17:03:41 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2019-10-02 16:50:05 +0200 |
commit | 79b27379c1cf109faeb80bc51fdd1c44df4fbfee (patch) | |
tree | 3f39fe283c594343557963104bb0f8aa8bb28c0f /uitest | |
parent | 29d7ece94318d3f03d079dff33ec15ff74f8febf (diff) |
uitest: share some code.
Change-Id: I2f586bd5e2e4c3cf1fc052cdfe526532dca9acd4
Reviewed-on: https://gerrit.libreoffice.org/79884
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/calc_tests/create_chart.py | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/uitest/calc_tests/create_chart.py b/uitest/calc_tests/create_chart.py index 5b97199bdf59..cced0ac63d37 100644 --- a/uitest/calc_tests/create_chart.py +++ b/uitest/calc_tests/create_chart.py @@ -15,6 +15,11 @@ import unittest class CalcChartUIDemo(UITestCase): + def create_insert_chart_dialog(self): + self.ui_test.execute_dialog_through_command(".uno:InsertObjectChart") + # time.sleep(1) # ideally wait for a creation event + return self.xUITest.getTopFocusWindow() + def fill_spreadsheet(self): xCalcDoc = self.xUITest.getTopFocusWindow() xGridWindow = xCalcDoc.getChild("grid_window") @@ -34,9 +39,7 @@ class CalcChartUIDemo(UITestCase): self.fill_spreadsheet() - self.ui_test.execute_dialog_through_command(".uno:InsertObjectChart") - - xChartDlg = self.xUITest.getTopFocusWindow() + xChartDlg = self.create_insert_chart_dialog(); xCancelBtn = xChartDlg.getChild("cancel") self.ui_test.close_dialog_through_button(xCancelBtn) @@ -49,9 +52,7 @@ class CalcChartUIDemo(UITestCase): self.fill_spreadsheet() - self.ui_test.execute_dialog_through_command(".uno:InsertObjectChart") - - xChartDlg = self.xUITest.getTopFocusWindow() + xChartDlg = self.create_insert_chart_dialog(); xOkBtn = xChartDlg.getChild("finish") self.ui_test.close_dialog_through_button(xOkBtn) @@ -64,9 +65,7 @@ class CalcChartUIDemo(UITestCase): self.fill_spreadsheet() - self.ui_test.execute_dialog_through_command(".uno:InsertObjectChart") - - xChartDlg = self.xUITest.getTopFocusWindow() + xChartDlg = self.create_insert_chart_dialog(); xNextBtn = xChartDlg.getChild("next") xNextBtn.executeAction("CLICK", tuple()) @@ -90,9 +89,7 @@ class CalcChartUIDemo(UITestCase): xCalcDoc = self.xUITest.getTopFocusWindow() xGridWindow = xCalcDoc.getChild("grid_window") - self.ui_test.execute_dialog_through_command(".uno:InsertObjectChart") - - xChartDlg = self.xUITest.getTopFocusWindow() + xChartDlg = self.create_insert_chart_dialog(); xNextBtn = xChartDlg.getChild("finish") self.ui_test.close_dialog_through_button(xNextBtn) @@ -112,9 +109,7 @@ class CalcChartUIDemo(UITestCase): xCalcDoc = self.xUITest.getTopFocusWindow() xGridWindow = xCalcDoc.getChild("grid_window") - self.ui_test.execute_dialog_through_command(".uno:InsertObjectChart") - - xChartDlg = self.xUITest.getTopFocusWindow() + xChartDlg = self.create_insert_chart_dialog(); xNextBtn = xChartDlg.getChild("finish") self.ui_test.close_dialog_through_button(xNextBtn) @@ -137,9 +132,7 @@ class CalcChartUIDemo(UITestCase): xCalcDoc = self.xUITest.getTopFocusWindow() xGridWindow = xCalcDoc.getChild("grid_window") - self.ui_test.execute_dialog_through_command(".uno:InsertObjectChart") - - xChartDlg = self.xUITest.getTopFocusWindow() + xChartDlg = self.create_insert_chart_dialog(); xNextBtn = xChartDlg.getChild("finish") self.ui_test.close_dialog_through_button(xNextBtn) |