[Libreoffice-commits] core.git: vcl/source
vcl/source/control/ivctrl.cxx | 17 + vcl/source/uitest/logger.cxx |5 + 2 files changed, 22 insertions(+) New commits: commit f558d810de845ad1dd52632ca0a2cae4733ed6e6 Author: Ahmed ElShreif AuthorDate: Fri Aug 28 08:25:28 2020 +0200 Commit: Ahmed ElShreif CommitDate: Tue Oct 13 20:36:45 2020 +0200 uilogger : Add support in the Logger and DSL for Vertical Tab For example the DSL syntax will be: >> Choose Tab number 2 in 'tab_id' from parent_id We don't need DSL change as it will already handled by normal Tab grammar Change-Id: I51f294134be88c4ac88baf73c53d81187a023061 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101516 Tested-by: Jenkins Reviewed-by: Ahmed ElShreif diff --git a/vcl/source/control/ivctrl.cxx b/vcl/source/control/ivctrl.cxx index 03f820534392..5ce9b84e1f85 100644 --- a/vcl/source/control/ivctrl.cxx +++ b/vcl/source/control/ivctrl.cxx @@ -28,10 +28,26 @@ #include #include #include +#include +#include #include using namespace ::com::sun::star::accessibility; +namespace +{ +void collectUIInformation( const OUString& aID, const OUString& aPos , const OUString& aParent ) +{ +EventDescription aDescription; +aDescription.aID = aID; +aDescription.aParameters = {{ "POS" , aPos}}; +aDescription.aAction = "SELECT"; +aDescription.aParent = aParent; +aDescription.aKeyWord = "VerticalTab"; +UITestLogger::getInstance().logEvent(aDescription); +} +} + /* | | class : SvxIconChoiceCtrlEntry @@ -521,6 +537,7 @@ void VerticalTabControl::SetCurPageId(const OString& rId) ActivatePage(); pNewData->xPage->Show(); } + collectUIInformation(get_id(),OStringToOUString(m_sCurrentPageId,RTL_TEXTENCODING_UTF8), GetPageParent()->get_id()); } OString VerticalTabControl::GetPageId(sal_uInt16 nIndex) const diff --git a/vcl/source/uitest/logger.cxx b/vcl/source/uitest/logger.cxx index d67711422bb6..31e8ea836040 100644 --- a/vcl/source/uitest/logger.cxx +++ b/vcl/source/uitest/logger.cxx @@ -592,6 +592,11 @@ void UITestLogger::logEvent(const EventDescription& rDescription) aLogLine = "Select item no "+ GetValueInMapWithIndex(rDescription.aParameters, 0) +" From List of "+ rDescription.aID; } } +else if(rDescription.aKeyWord == "VerticalTab"){ +aLogLine = "Choose Tab number " + GetValueInMapWithIndex(rDescription.aParameters, 0) + +" in '" + rDescription.aID + +"' from " + rDescription.aParent ; +} else { aLogLine = rDescription.aKeyWord + " Action:" + rDescription.aAction + " Id:" ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: uitest/ui_logger_dsl vcl/source
uitest/ui_logger_dsl/UI_Object_commands.tx | 16 +++ uitest/ui_logger_dsl/dsl_core.py | 60 + vcl/source/control/menubtn.cxx | 21 ++ vcl/source/uitest/logger.cxx | 11 + 4 files changed, 107 insertions(+), 1 deletion(-) New commits: commit cdb9c24b45ce7c35cf507430bd5ee1d9c3d5ea72 Author: Ahmed ElShreif AuthorDate: Fri Aug 28 05:35:22 2020 +0200 Commit: Ahmed ElShreif CommitDate: Fri Sep 4 00:58:21 2020 +0200 uilogger : Add support in the Logger and DSL for MenuBtn For example the DSL syntax will be: >>Open List From menugearbtn >>Select item no 6 From List of menugearbtn >>Close List From menugearbtn Change-Id: I767948d9bc124a119632825d437746ea38c40ad3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101514 Tested-by: Jenkins Reviewed-by: Ahmed ElShreif diff --git a/uitest/ui_logger_dsl/UI_Object_commands.tx b/uitest/ui_logger_dsl/UI_Object_commands.tx index 7770bc1ee581..04f975a39066 100644 --- a/uitest/ui_logger_dsl/UI_Object_commands.tx +++ b/uitest/ui_logger_dsl/UI_Object_commands.tx @@ -12,13 +12,14 @@ import type_options 8) TabControlUIObject ( Change tab event ) 9) ToolBoxUIObject ( Click on item event ) 10) ValueSetUIObject (Choose item) +10) MenuBtnUIObject ( Select - Open - Close ) */ UIObjectCommand: ButtonUIObject | CheckBoxUIObject | EditUIObject | RadioButtonUIObject | ListBoxUIObject | ComboBoxUIObject | SpinFieldUIObject | TabControlUIObject | ToolBoxUIObject | - ValueSetUIObject + ValueSetUIObject | MenuBtnUIObject ; ButtonUIObject: @@ -52,6 +53,19 @@ ValueSetUIObject: 'Choose element with position ' POS=INT 'in' value_set_id=STRING 'from' parent_id=STRING ; //= +MenuBtnUIObject: + MenuBtnUIObjectOpen | MenuBtnUIObjectSelect | MenuBtnUIObjectClose +; +MenuBtnUIObjectOpen: +'Open List From' + MenuBtn_ID=ID +; +MenuBtnUIObjectClose: +'Close List From' + MenuBtn_ID=ID +; +MenuBtnUIObjectSelect: +'Select item no' + item_num=INT + 'From List of' + MenuBtn_ID=ID +; +//= //helper grammar for EditUIObject action_on_UIObject: Type_action | SELECT | Clear diff --git a/uitest/ui_logger_dsl/dsl_core.py b/uitest/ui_logger_dsl/dsl_core.py index fa17391eafa7..95f41c27df46 100644 --- a/uitest/ui_logger_dsl/dsl_core.py +++ b/uitest/ui_logger_dsl/dsl_core.py @@ -105,6 +105,9 @@ class ul_Compiler: "EditUIObject": self.handle_Edit_uiObject, "ToolBoxUIObject": self.handle_ToolBox_uiObject, "ValueSetUIObject": self.handle_ValueSet_uiObject, +"MenuBtnUIObjectOpen":self.handle_MenuBtnUIObjectOpen, +"MenuBtnUIObjectSelect":self.handle_MenuBtnUIObjectSelect, +"MenuBtnUIObjectClose":self.handle_MenuBtnUIObjectClose, "writer_Type_command": self.handle_writer_type, "writer_Select_command": self.handle_writer_select, "writer_GOTO_command": self.handle_writer_goto, @@ -667,6 +670,63 @@ class ul_Compiler: self.prev_command = ValueSetUIObject +def handle_MenuBtnUIObjectOpen(self, MenuBtnUIObjectOpen): +name_of_obj = "" +if keyword.iskeyword(MenuBtnUIObjectOpen.MenuBtn_ID): +name_of_obj = "x" + MenuBtnUIObjectOpen.MenuBtn_ID +else: +name_of_obj = MenuBtnUIObjectOpen.MenuBtn_ID + +self.init_Object( +name_of_obj, +MenuBtnUIObjectOpen.MenuBtn_ID, +self.last_parent[self.parent_hierarchy_count], +) + +self.write_line_with_one_parameters( +name_of_obj, "OPENLIST", "", "" +) + +self.prev_command = MenuBtnUIObjectOpen + +def handle_MenuBtnUIObjectClose(self, MenuBtnUIObjectClose): +name_of_obj = "" +if keyword.iskeyword(MenuBtnUIObjectClose.MenuBtn_ID): +name_of_obj = "x" + MenuBtnUIObjectClose.MenuBtn_ID +else: +name_of_obj = MenuBtnUIObjectClose.MenuBtn_ID + +self.init_Object( +name_of_obj, +MenuBtnUIObjectClose.MenuBtn_ID, +self.last_parent[self.parent_hierarchy_count], +) + +self.write_line_with_one_parameters( +name_of_obj, "CLOSELIST", "", "" +) + +self.prev_command = MenuBtnUIObjectClose + +def handle_MenuBtnUIObjectSelect(self, MenuBtnUIObjectSelect): +name_of_obj = "" +if keyword.iskeyword(MenuBtnUIObjectSelect.MenuBtn_ID): +name_of_obj = "x" + MenuBtnUIObjectSelect.MenuBtn_ID +else: +name_of_obj = MenuBtnUIObjectSelect.MenuBtn_ID + +self.init_Object( +name_of_obj, +MenuBtnUIObjectSelect.MenuBtn_ID, +self.last_paren
[Libreoffice-commits] core.git: sw/source uitest/ui_logger_dsl vcl/source
sw/source/uibase/docvw/AnnotationWin.cxx | 19 +++ sw/source/uibase/docvw/AnnotationWin2.cxx | 16 ++ uitest/ui_logger_dsl/Special_commands.tx | 34 + uitest/ui_logger_dsl/dsl_core.py | 75 ++ vcl/source/uitest/logger.cxx | 18 +++ 5 files changed, 161 insertions(+), 1 deletion(-) New commits: commit 2e635d22cdbfcfe163b46427d04ebce9fe21a61e Author: Ahmed ElShreif AuthorDate: Fri Aug 28 03:11:44 2020 +0200 Commit: Ahmed ElShreif CommitDate: Tue Sep 1 03:36:53 2020 +0200 uilogger : Add support in the Logger and DSL for Writer-Comments For example the DSL syntax will be: >>Delete Comment1 >>Leave Comment1 >>Show Comment1 >>Hide Comment1 >>Resolve Comment1 Change-Id: Ibdd52f3a12f1679f80e9f3290868c77fbf942d6b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101513 Tested-by: Jenkins Reviewed-by: Markus Mohrhard diff --git a/sw/source/uibase/docvw/AnnotationWin.cxx b/sw/source/uibase/docvw/AnnotationWin.cxx index 579323fd40ef..db719948df8b 100644 --- a/sw/source/uibase/docvw/AnnotationWin.cxx +++ b/sw/source/uibase/docvw/AnnotationWin.cxx @@ -31,6 +31,8 @@ #include #include #include +#include +#include #include #include @@ -67,6 +69,21 @@ #include +namespace{ + +void collectUIInformation( const OUString& aevent , const OUString& aID ) +{ +EventDescription aDescription; +aDescription.aID = aID; +aDescription.aParameters = {{"" , ""}}; +aDescription.aAction = aevent; +aDescription.aParent = "MainWindow"; +aDescription.aKeyWord = "SwEditWinUIObject"; +UITestLogger::getInstance().logEvent(aDescription); +} + +} + namespace sw::annotation { SwAnnotationWin::SwAnnotationWin( SwEditWin& rEditWin, @@ -245,6 +262,7 @@ void SwAnnotationWin::SetResolved(bool resolved) mbResolvedStateUpdated = true; UpdateData(); Invalidate(); +collectUIInformation("SETRESOLVED",get_id()); } void SwAnnotationWin::ToggleResolved() @@ -307,6 +325,7 @@ void SwAnnotationWin::UpdateData() void SwAnnotationWin::Delete() { +collectUIInformation("DELETE",get_id()); if (!mrView.GetWrtShellPtr()->GotoField(*mpFormatField)) return; diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx index 633b8ebe00d8..10493e45a04a 100644 --- a/sw/source/uibase/docvw/AnnotationWin2.cxx +++ b/sw/source/uibase/docvw/AnnotationWin2.cxx @@ -58,6 +58,8 @@ #include #include #include +#include +#include #include #include @@ -80,6 +82,17 @@ using namespace sw::sidebarwindows; namespace { +void collectUIInformation( const OUString& aevent , const OUString& aID ) +{ +EventDescription aDescription; +aDescription.aID = aID; +aDescription.aParameters = {{"" , ""}}; +aDescription.aAction = aevent; +aDescription.aParent = "MainWindow"; +aDescription.aKeyWord = "SwEditWinUIObject"; +UITestLogger::getInstance().logEvent(aDescription); +} + /// Translate absolute <-> relative twips: LOK wants absolute coordinates as output and gives absolute coordinates as input. void lcl_translateTwips(vcl::Window const & rParent, vcl::Window& rChild, MouseEvent* pMouseEvent) { @@ -1126,6 +1139,7 @@ void SwAnnotationWin::ShowNote() // Invalidate. InvalidateControl(); +collectUIInformation("SHOW",get_id()); } void SwAnnotationWin::HideNote() @@ -1141,6 +1155,7 @@ void SwAnnotationWin::HideNote() } if (mpShadow && mpShadow->isVisible()) mpShadow->setVisible(false); +collectUIInformation("HIDE",get_id()); } void SwAnnotationWin::InvalidateControl() @@ -1510,6 +1525,7 @@ void SwAnnotationWin::SwitchToFieldPos() if (aCount) mrView.GetDocShell()->GetWrtShell()->SwCursorShell::Right(aCount, 0); GrabFocusToDocument(); +collectUIInformation("LEAVE",get_id()); } void SwAnnotationWin::SetChangeTracking( const SwPostItHelper::SwLayoutStatus aLayoutStatus, diff --git a/uitest/ui_logger_dsl/Special_commands.tx b/uitest/ui_logger_dsl/Special_commands.tx index 9a8dc4cff6c4..9d37029a5e95 100644 --- a/uitest/ui_logger_dsl/Special_commands.tx +++ b/uitest/ui_logger_dsl/Special_commands.tx @@ -26,7 +26,7 @@ SpecialCommand: writer_command: writer_Type_command | writer_Select_command | writer_GOTO_command | writer_Create_table | writer_Copy_Text | writer_Cut_Text | -writer_Paste_Text | writer_Insert_BreakPage +writer_Paste_Text | writer_Insert_BreakPage | writer_Comment_command ; writer_Type_command: 'Type on writer' what_to_type=Type_options @@ -220,4 +220,36 @@ draw_Delete_Page: ; draw_Rename_Page: 'Rename The Selected Page from ' old_name=STRING 'to' new_name=STRING +; + +//=// +/* + This part for all the Writer Comment statements: + +1) Leave +
[Libreoffice-commits] core.git: sc/source uitest/ui_logger_dsl vcl/source
sc/source/ui/drawfunc/fudraw.cxx | 19 +++ sc/source/ui/view/viewfun6.cxx | 19 +++ uitest/ui_logger_dsl/Special_commands.tx | 12 +++- uitest/ui_logger_dsl/dsl_core.py | 28 vcl/source/uitest/logger.cxx | 12 5 files changed, 89 insertions(+), 1 deletion(-) New commits: commit fe3d005155a8670d02ff1a8d17f1bcff74a44cab Author: Ahmed ElShreif AuthorDate: Tue Aug 25 23:35:08 2020 +0200 Commit: Ahmed ElShreif CommitDate: Tue Sep 1 01:24:53 2020 +0200 uilogger : Add support in the Logger and DSL for Calc-Comments For example the DSL syntax will be: >>Open Comment >>Close Comment The set text is already added by default to the system Change-Id: Ic06e00e75e202eece82fa6265e1bb4083fd8c337 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101502 Tested-by: Jenkins Reviewed-by: Markus Mohrhard diff --git a/sc/source/ui/drawfunc/fudraw.cxx b/sc/source/ui/drawfunc/fudraw.cxx index 36abddf039f5..701790120bd6 100644 --- a/sc/source/ui/drawfunc/fudraw.cxx +++ b/sc/source/ui/drawfunc/fudraw.cxx @@ -26,6 +26,8 @@ #include #include #include +#include +#include #include #include @@ -37,6 +39,22 @@ #include #include +namespace +{ + +void collectUIInformation( const OUString& aevent ) +{ +EventDescription aDescription; +aDescription.aID = "grid_window"; +aDescription.aParameters = {{ aevent , ""}}; +aDescription.aAction = "COMMENT"; +aDescription.aParent = "MainWindow"; +aDescription.aKeyWord = "ScGridWinUIObject"; +UITestLogger::getInstance().logEvent(aDescription); +} + +} + // base class for draw module specific functions FuDraw::FuDraw(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawView* pViewP, SdrModel* pDoc, const SfxRequest& rReq) @@ -179,6 +197,7 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt) case KEY_ESCAPE: if ( rViewShell.IsDrawTextShell() || aSfxRequest.GetSlot() == SID_DRAW_NOTEEDIT ) { +collectUIInformation("CLOSE"); // if object selected -> normal draw-shell, else turn off drawing rViewData.GetDispatcher().Execute(aSfxRequest.GetSlot(), SfxCallMode::SLOT | SfxCallMode::RECORD); bReturn = true; diff --git a/sc/source/ui/view/viewfun6.cxx b/sc/source/ui/view/viewfun6.cxx index d9c664ee3e23..1332f94e4f07 100644 --- a/sc/source/ui/view/viewfun6.cxx +++ b/sc/source/ui/view/viewfun6.cxx @@ -24,6 +24,8 @@ #include #include #include +#include +#include #include #include @@ -46,6 +48,22 @@ #include +namespace +{ + +void collectUIInformation( const OUString& aevent ) +{ +EventDescription aDescription; +aDescription.aID = "grid_window"; +aDescription.aParameters = {{ aevent , ""}}; +aDescription.aAction = "COMMENT"; +aDescription.aParent = "MainWindow"; +aDescription.aKeyWord = "ScGridWinUIObject"; +UITestLogger::getInstance().logEvent(aDescription); +} + +} + using ::std::vector; void ScViewFunc::DetectiveAddPred() @@ -520,6 +538,7 @@ void ScViewFunc::EditNote() ScTabView::OnLOKNoteStateChanged( pNote ); } +collectUIInformation("OPEN"); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/uitest/ui_logger_dsl/Special_commands.tx b/uitest/ui_logger_dsl/Special_commands.tx index 601a600f4bdb..9a8dc4cff6c4 100644 --- a/uitest/ui_logger_dsl/Special_commands.tx +++ b/uitest/ui_logger_dsl/Special_commands.tx @@ -69,6 +69,8 @@ writer_Insert_BreakPage: 10) Paste Cells 11) Merge Cells 12) Unmerge Cells +13) Open Comment +14) Close Comment then we can add whatever we need in the future */ @@ -76,7 +78,8 @@ calc_command: calc_Type_command | calc_switch_sheet | calc_Select_cell | calc_AutoFill_filter | calc_SelectMenu_filter | calc_Delete_Cells | calc_Remove_Content | calc_insert_cells | calc_Cut_Cells | calc_Copy_Cells | calc_Paste_Cells | calc_UNMerge_Cells | - calc_Merge_Cells | calc_Rename_Sheet | calc_Insert_sheet + calc_Merge_Cells | calc_Rename_Sheet | calc_Insert_sheet | calc_Open_Comment | + calc_Close_Comment ; calc_Type_command: 'Type on current cell' what_to_type=Type_options @@ -129,6 +132,13 @@ calc_Rename_Sheet: calc_Insert_sheet: 'Insert New Tab ' ; +calc_Open_Comment: +'Open Comment' (txt=STRING)? +; +calc_Close_Comment: +'Close Comment' (txt=STRING)? +; + //this is the select options select_options: one_cell | range_of_cells diff --git a/uitest/ui_logger_dsl/dsl_core.py b/uitest/ui_logger_dsl/dsl_core.py index 8fa7d141c2c3..062415f00fb1 100644 --- a/uitest/ui_logger_dsl/dsl_core.py +++ b/uitest/ui_logger_dsl/dsl_core.py @@ -113,6 +113,8 @@ class ul_Compiler: "calc_Type_command": self.handle_calc_Type_command, "calc_AutoFill_filter": se
[Libreoffice-commits] core.git: svtools/source sw/qa
svtools/source/uitest/uiobject.cxx |2 +- sw/qa/uitest/writer_tests2/fontworks.py |4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) New commits: commit 5be3b44a87fafebe56840eadd983020f57e566c4 Author: Ahmed ElShreif AuthorDate: Mon Aug 24 11:00:09 2020 +0200 Commit: Ahmed ElShreif CommitDate: Thu Aug 27 20:32:35 2020 +0200 uitest : Change all the ValueSet uitest statments to CHOOSE instead of using "SELECT" which similar to other UIObjects we will write "CHOOSE" Change-Id: I32c1ab5f8a5dd21df87d90923d5821f8f0b16e76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101265 Tested-by: Jenkins Reviewed-by: Markus Mohrhard diff --git a/svtools/source/uitest/uiobject.cxx b/svtools/source/uitest/uiobject.cxx index 904a81be1bb6..db593581d6c2 100644 --- a/svtools/source/uitest/uiobject.cxx +++ b/svtools/source/uitest/uiobject.cxx @@ -20,7 +20,7 @@ ValueSetUIObject::ValueSetUIObject(const VclPtr& xSetWin, ValueSet* void ValueSetUIObject::execute(const OUString& rAction, const StringMap& rParameters) { -if (rAction == "SELECT") +if (rAction == "CHOOSE") { if (rParameters.find("POS") != rParameters.end()) { diff --git a/sw/qa/uitest/writer_tests2/fontworks.py b/sw/qa/uitest/writer_tests2/fontworks.py index df72f5ed67a4..d3034dc8134b 100644 --- a/sw/qa/uitest/writer_tests2/fontworks.py +++ b/sw/qa/uitest/writer_tests2/fontworks.py @@ -24,13 +24,13 @@ class fontWorksDialog(UITestCase): FontWorkSelector = xDialog.getChild("ctlFavorites") # Select element with id (3) -FontWorkSelector.executeAction("SELECT", mkPropertyValues({"POS": "3"})) +FontWorkSelector.executeAction("CHOOSE", mkPropertyValues({"POS": "3"})) self.assertEqual(get_state_as_dict(FontWorkSelector)["SelectedItemPos"], "2") self.assertEqual(get_state_as_dict(FontWorkSelector)["SelectedItemId"], "3") self.assertEqual(get_state_as_dict(FontWorkSelector)["ItemsCount"], "36") # Select element with id (7) -FontWorkSelector.executeAction("SELECT", mkPropertyValues({"POS": "7"})) +FontWorkSelector.executeAction("CHOOSE", mkPropertyValues({"POS": "7"})) self.assertEqual(get_state_as_dict(FontWorkSelector)["SelectedItemPos"], "6") self.assertEqual(get_state_as_dict(FontWorkSelector)["SelectedItemId"], "7") ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: svtools/source uitest/ui_logger_dsl vcl/source
svtools/source/control/valueset.cxx| 13 +++ uitest/ui_logger_dsl/UI_Object_commands.tx |7 +- uitest/ui_logger_dsl/dsl_core.py | 33 + vcl/source/uitest/logger.cxx |5 4 files changed, 57 insertions(+), 1 deletion(-) New commits: commit 707903aa8c74047c4fe6364b114b0736f61a4b4d Author: Ahmed ElShreif AuthorDate: Mon Aug 24 11:39:37 2020 +0200 Commit: Ahmed ElShreif CommitDate: Thu Aug 27 20:29:22 2020 +0200 uilogger : Add support in the Logger and DSL for ValueSet For example the DSL syntax will be: >>Choose element with position 18 in 'colorset' from 'cui/ui/colorpage/colorset' Change-Id: I9186b870da096719873c8709dedbc4bb4d315e2c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101267 Tested-by: Jenkins Reviewed-by: Markus Mohrhard diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx index e56f3e7e2d43..96216831e4d7 100644 --- a/svtools/source/control/valueset.cxx +++ b/svtools/source/control/valueset.cxx @@ -44,6 +44,8 @@ #include #include +#include +#include using namespace css::uno; using namespace css::lang; @@ -51,6 +53,16 @@ using namespace css::accessibility; namespace { +void collectUIInformation( const OUString& aID , const OUString& aParentID , const OUString& aPos ) +{ +EventDescription aDescription; +aDescription.aID = aID ; +aDescription.aParameters = {{"POS", aPos }}; +aDescription.aAction = "SELECT"; +aDescription.aKeyWord = "ValueSet"; +aDescription.aParent = aParentID; +UITestLogger::getInstance().logEvent(aDescription); +} enum { @@ -155,6 +167,7 @@ void ValueSet::ImplDeleteItems() void ValueSet::Select() { maSelectHdl.Call( this ); + collectUIInformation(OStringToOUString(GetDrawingArea()->get_buildable_name(),RTL_TEXTENCODING_UTF8) , OStringToOUString(GetDrawingArea()->get_help_id(),RTL_TEXTENCODING_UTF8) , OUString::number(GetSelectedItemId())); } void ValueSet::UserDraw( const UserDrawEvent& ) diff --git a/uitest/ui_logger_dsl/UI_Object_commands.tx b/uitest/ui_logger_dsl/UI_Object_commands.tx index a3fe81b72b2b..7770bc1ee581 100644 --- a/uitest/ui_logger_dsl/UI_Object_commands.tx +++ b/uitest/ui_logger_dsl/UI_Object_commands.tx @@ -11,12 +11,14 @@ import type_options 7) SpinUIObject ( Increase event - Decrease event ) 8) TabControlUIObject ( Change tab event ) 9) ToolBoxUIObject ( Click on item event ) +10) ValueSetUIObject (Choose item) */ UIObjectCommand: ButtonUIObject | CheckBoxUIObject | EditUIObject | RadioButtonUIObject | ListBoxUIObject | ComboBoxUIObject | - SpinFieldUIObject | TabControlUIObject | ToolBoxUIObject + SpinFieldUIObject | TabControlUIObject | ToolBoxUIObject | + ValueSetUIObject ; ButtonUIObject: @@ -46,6 +48,9 @@ ListBoxUIObject: ToolBoxUIObject: 'Click on item number' POS=INT 'in' toolbox_id=ID ; +ValueSetUIObject: + 'Choose element with position ' POS=INT 'in' value_set_id=STRING 'from' parent_id=STRING +; //= //helper grammar for EditUIObject action_on_UIObject: diff --git a/uitest/ui_logger_dsl/dsl_core.py b/uitest/ui_logger_dsl/dsl_core.py index feb69b76a320..b9941c81c746 100644 --- a/uitest/ui_logger_dsl/dsl_core.py +++ b/uitest/ui_logger_dsl/dsl_core.py @@ -104,6 +104,7 @@ class ul_Compiler: "SpinFieldUIObject": self.handle_spin_field, "EditUIObject": self.handle_Edit_uiObject, "ToolBoxUIObject": self.handle_ToolBox_uiObject, +"ValueSetUIObject": self.handle_ValueSet_uiObject, "writer_Type_command": self.handle_writer_type, "writer_Select_command": self.handle_writer_select, "writer_GOTO_command": self.handle_writer_goto, @@ -627,6 +628,38 @@ class ul_Compiler: self.prev_command = ToolBoxUIObject +def handle_ValueSet_uiObject(self, ValueSetUIObject): + +name_of_obj = "" +if keyword.iskeyword(ValueSetUIObject.value_set_id): +name_of_obj = "x" + ValueSetUIObject.value_set_id +else: +name_of_obj = ValueSetUIObject.value_set_id + +parent_txt = ValueSetUIObject.parent_id.split("/") +parent = parent_txt[len(parent_txt)-2] +if( parent.upper() != self.last_parent[self.parent_hierarchy_count].upper()): +self.init_Object( +parent, +parent, +self.last_parent[self.parent_hierarchy_count], +) + +self.init_Object( +name_of_obj, ValueSetUIObject.value_set_id, parent +) + +else: +self.init_Object( +name_of_obj, ValueSetUIObject.value_set_id, self.last_parent[self.parent_hierarchy_count] +) + +self.write_lin
[Libreoffice-commits] core.git: sc/source
sc/source/ui/view/tabvwsh3.cxx | 14 ++ 1 file changed, 14 insertions(+) New commits: commit a06a83b29a9da770787bffe416b138102aa12531 Author: Ahmed ElShreif AuthorDate: Fri Aug 21 04:04:03 2020 +0200 Commit: Ahmed ElShreif CommitDate: Mon Aug 24 01:04:07 2020 +0200 uilogger : Add support in the Logger and DSL for ZOOM in CALC For example the DSL syntax will be: >>"Set Zoom to 46" Change-Id: Ie8a77441da10bd32efd7a95c3f1550671a62d16f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101125 Tested-by: Jenkins Reviewed-by: Ahmed ElShreif diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx index 2a883642b2da..80748d849c3d 100644 --- a/sc/source/ui/view/tabvwsh3.cxx +++ b/sc/source/ui/view/tabvwsh3.cxx @@ -27,6 +27,8 @@ #include #include #include +#include +#include #include #include @@ -57,6 +59,17 @@ namespace { +void collectUIInformation(const OUString& aZoom) +{ +EventDescription aDescription; +aDescription.aID = "grid_window"; +aDescription.aParameters = {{"ZOOM", aZoom}}; +aDescription.aAction = "SET"; +aDescription.aKeyWord = "ScGridWinUIObject"; +aDescription.aParent = "MainWindow"; +UITestLogger::getInstance().logEvent(aDescription); +} + enum class DetectFlags { NONE, @@ -793,6 +806,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) { ScAppOptions aNewOpt = pScMod->GetAppOptions(); aNewOpt.SetZoom( nCurrentZoom ); + collectUIInformation(OUString::number(nCurrentZoom)); aNewOpt.SetZoomType( GetZoomType() ); pScMod->SetAppOptions( aNewOpt ); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/vcl uitest/ui_logger_dsl vcl/source
include/vcl/uitest/logger.hxx |2 ++ include/vcl/uitest/uiobject.hxx|2 ++ uitest/ui_logger_dsl/UI_Object_commands.tx |6 +- uitest/ui_logger_dsl/dsl_core.py | 20 vcl/source/uitest/logger.cxx | 15 +++ vcl/source/uitest/uiobject.cxx | 11 +++ vcl/source/window/toolbox2.cxx |2 ++ 7 files changed, 57 insertions(+), 1 deletion(-) New commits: commit 3ceccd384cb61686a96e73821035c6ac5d0d1604 Author: Ahmed ElShreif AuthorDate: Sun Aug 16 10:24:20 2020 +0200 Commit: Ahmed ElShreif CommitDate: Mon Aug 24 00:26:03 2020 +0200 uilogger : Add support in the Logger and DSL for the ToolBox The support is tested on the FindBar and it works well . For example the DSL syntax in the FindBar should be like: >>"Click on item number 3 in FindBar" Change-Id: I3ec5f5afc260df4b38dc4e420fcc48d9c774c29f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100811 Tested-by: Jenkins Reviewed-by: Markus Mohrhard diff --git a/include/vcl/uitest/logger.hxx b/include/vcl/uitest/logger.hxx index a2339b8b8e39..927c9cbf38ef 100644 --- a/include/vcl/uitest/logger.hxx +++ b/include/vcl/uitest/logger.hxx @@ -44,6 +44,8 @@ public: void logAction(VclPtr const& xUIElement, VclEventId nEvent); +void logAction(vcl::Window* const& xUIWin, VclEventId nEvent); + void log(const OUString& rString); void logKeyInput(VclPtr const& xUIElement, const KeyEvent& rEvent); diff --git a/include/vcl/uitest/uiobject.hxx b/include/vcl/uitest/uiobject.hxx index 50533157e19b..7d709a342eb4 100644 --- a/include/vcl/uitest/uiobject.hxx +++ b/include/vcl/uitest/uiobject.hxx @@ -499,6 +499,8 @@ public: static std::unique_ptr create(vcl::Window* pWindow); +virtual OUString get_action(VclEventId nEvent) const override; + private: virtual OUString get_name() const override; diff --git a/uitest/ui_logger_dsl/UI_Object_commands.tx b/uitest/ui_logger_dsl/UI_Object_commands.tx index 2d3724f2d11e..a3fe81b72b2b 100644 --- a/uitest/ui_logger_dsl/UI_Object_commands.tx +++ b/uitest/ui_logger_dsl/UI_Object_commands.tx @@ -10,12 +10,13 @@ import type_options 6) ComboBoxUIObject ( Select event ) 7) SpinUIObject ( Increase event - Decrease event ) 8) TabControlUIObject ( Change tab event ) +9) ToolBoxUIObject ( Click on item event ) */ UIObjectCommand: ButtonUIObject | CheckBoxUIObject | EditUIObject | RadioButtonUIObject | ListBoxUIObject | ComboBoxUIObject | - SpinFieldUIObject | TabControlUIObject + SpinFieldUIObject | TabControlUIObject | ToolBoxUIObject ; ButtonUIObject: @@ -42,6 +43,9 @@ SpinFieldUIObject: ListBoxUIObject: 'Select element with position ' POS=INT 'in' list_id=STRING ('from' parent_id=ID)? ; +ToolBoxUIObject: + 'Click on item number' POS=INT 'in' toolbox_id=ID +; //= //helper grammar for EditUIObject action_on_UIObject: diff --git a/uitest/ui_logger_dsl/dsl_core.py b/uitest/ui_logger_dsl/dsl_core.py index ebe936bba76a..feb69b76a320 100644 --- a/uitest/ui_logger_dsl/dsl_core.py +++ b/uitest/ui_logger_dsl/dsl_core.py @@ -103,6 +103,7 @@ class ul_Compiler: "ListBoxUIObject": self.handle_List_box, "SpinFieldUIObject": self.handle_spin_field, "EditUIObject": self.handle_Edit_uiObject, +"ToolBoxUIObject": self.handle_ToolBox_uiObject, "writer_Type_command": self.handle_writer_type, "writer_Select_command": self.handle_writer_select, "writer_GOTO_command": self.handle_writer_goto, @@ -607,6 +608,25 @@ class ul_Compiler: self.prev_command = EditUIObject +def handle_ToolBox_uiObject(self, ToolBoxUIObject): +name_of_obj = "" +if keyword.iskeyword(ToolBoxUIObject.toolbox_id): +name_of_obj = "x" + ToolBoxUIObject.toolbox_id +else: +name_of_obj = ToolBoxUIObject.toolbox_id + +self.init_Object( +name_of_obj, +ToolBoxUIObject.toolbox_id, +self.last_parent[self.parent_hierarchy_count], +) + +self.write_line_with_one_parameters( +name_of_obj, "CLICK", "POS", ToolBoxUIObject.POS +) + +self.prev_command = ToolBoxUIObject + def handle_writer_type(self, writer_Type_command): self.init_app() diff --git a/vcl/source/uitest/logger.cxx b/vcl/source/uitest/logger.cxx index 8cd0c4b6f15f..b7a9e02ac48a 100644 --- a/vcl/source/uitest/logger.cxx +++ b/vcl/source/uitest/logger.cxx @@ -166,6 +166,21 @@ void UITestLogger::logAction(VclPtr const& xUIElement, VclEventId nEven maStream.WriteLine(OUStringToOString(aAction, RTL_TEXTENCODING_UTF8)); } +void UITestLogger::logAction(vcl::Window* const& xUIWin, VclEve
[Libreoffice-commits] core.git: sc/source uitest/ui_logger_dsl vcl/source
sc/source/ui/view/gridwin.cxx|7 --- uitest/ui_logger_dsl/Special_commands.tx | 26 +++--- uitest/ui_logger_dsl/dsl_core.py | 20 vcl/source/uitest/logger.cxx |7 +-- 4 files changed, 44 insertions(+), 16 deletions(-) New commits: commit ea94295b70b5e9703a54645e73aeda2eba7297fa Author: Ahmed ElShreif AuthorDate: Tue Aug 18 21:57:45 2020 +0200 Commit: Ahmed ElShreif CommitDate: Fri Aug 21 23:06:22 2020 +0200 uilogger : Add support in the Logger and DSL for the LAUNCHMENU in CALC The support is tested on some random test cases. For example the DSL syntax will be: >>"Launch SELECTMENU from Col 3 and Row 5" Change-Id: Ic5b29ad8b377eed5c38aa1d0f680cbfb979763e6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100958 Tested-by: Jenkins Reviewed-by: Markus Mohrhard diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 887903286ca3..296873a2ef76 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -630,12 +630,12 @@ public: } }; -void collectUIInformation(const OUString& aRow, const OUString& aCol) +void collectUIInformation(const OUString& aRow, const OUString& aCol , const OUString& aevent) { EventDescription aDescription; aDescription.aAction = "LAUNCH"; aDescription.aID = "grid_window"; -aDescription.aParameters = {{"AUTOFILTER", ""}, +aDescription.aParameters = {{aevent, ""}, {"ROW", aRow}, {"COL", aCol}}; aDescription.aParent = "MainWindow"; aDescription.aKeyWord = "ScGridWinUIObject"; @@ -751,7 +751,7 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW nRow) // remember filter rules before modification rControl.getResult(aSaveAutoFilterResult); -collectUIInformation(OUString::number(nRow), OUString::number(nCol)); +collectUIInformation(OUString::number(nRow), OUString::number(nCol),"AUTOFILTER"); } void ScGridWindow::RefreshAutoFilterButton(const ScAddress& rPos) @@ -1222,6 +1222,7 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow ) mpFilterBox->EndInit(); } +collectUIInformation(OUString::number(nRow), OUString::number(nCol),"SELECTMENU"); } void ScGridWindow::FilterSelect( sal_uLong nSel ) diff --git a/uitest/ui_logger_dsl/Special_commands.tx b/uitest/ui_logger_dsl/Special_commands.tx index 071cfb9dcbbb..601a600f4bdb 100644 --- a/uitest/ui_logger_dsl/Special_commands.tx +++ b/uitest/ui_logger_dsl/Special_commands.tx @@ -60,22 +60,23 @@ writer_Insert_BreakPage: 1) select sheet 2) Select cell or range 3) launch AutoFill -4) Delete Cells -5) Remove Content of a cell -6) Insert new Cells -7) Cut Cells -8) Copy Cells -9) Paste Cells -10) Merge Cells -11) Unmerge Cells +4) launch SELECTMENU +5) Delete Cells +6) Remove Content of a cell +7) Insert new Cells +8) Cut Cells +9) Copy Cells +10) Paste Cells +11) Merge Cells +12) Unmerge Cells then we can add whatever we need in the future */ calc_command: calc_Type_command | calc_switch_sheet | calc_Select_cell | calc_AutoFill_filter | - calc_Delete_Cells | calc_Remove_Content | calc_insert_cells | calc_Cut_Cells | - calc_Copy_Cells | calc_Paste_Cells | calc_UNMerge_Cells | calc_Merge_Cells | - calc_Rename_Sheet | calc_Insert_sheet + calc_SelectMenu_filter | calc_Delete_Cells | calc_Remove_Content | calc_insert_cells | + calc_Cut_Cells | calc_Copy_Cells | calc_Paste_Cells | calc_UNMerge_Cells | + calc_Merge_Cells | calc_Rename_Sheet | calc_Insert_sheet ; calc_Type_command: 'Type on current cell' what_to_type=Type_options @@ -89,6 +90,9 @@ calc_Select_cell: calc_AutoFill_filter: 'Launch AutoFilter from Col' col_num=INT 'and Row' row_num=INT ; +calc_SelectMenu_filter: + 'Launch SELECTMENU from Col' col_num=INT 'and Row' row_num=INT +; range_of_cells: '{' '"RANGE":' input_range=STRING '}' ; diff --git a/uitest/ui_logger_dsl/dsl_core.py b/uitest/ui_logger_dsl/dsl_core.py index 644fc06e73dd..ebe936bba76a 100644 --- a/uitest/ui_logger_dsl/dsl_core.py +++ b/uitest/ui_logger_dsl/dsl_core.py @@ -110,6 +110,7 @@ class ul_Compiler: "calc_switch_sheet": self.handle_calc_switch_sheet, "calc_Type_command": self.handle_calc_Type_command, "calc_AutoFill_filter": self.handle_calc_AutoFill_filter, +"calc_SelectMenu_filter": self.handle_calc_SelectMenu_filter, "impress_Type_command": self.handle_impress_Type_command, "math_element_selector": self.handle_math_element_selector, "math_Type_command": self.handle_math_Type_command, @@ -726,6 +727,25 @@ class ul_Compiler: self.variables.append(line) self.prev_command = calc_AutoFill_filter +def handle_calc_SelectMenu_fil
[Libreoffice-commits] core.git: sw/qa
sw/qa/uitest/writer_tests2/fontworks.py | 42 1 file changed, 42 insertions(+) New commits: commit 7c91a8ea96f5192fbde9443147297226a7b7ac58 Author: Ahmed ElShreif AuthorDate: Wed Aug 12 21:00:56 2020 +0200 Commit: Ahmed ElShreif CommitDate: Fri Aug 21 23:05:32 2020 +0200 Add demo for FontWork Selector As this selector is a ValueSet object so the support is added in this patch : https://gerrit.libreoffice.org/c/core/+/100373 The test case just test the selector by selecting different items . Change-Id: I0590c9b853572894130f17a05c0178e04b0fec41 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100628 Tested-by: Jenkins Reviewed-by: Markus Mohrhard diff --git a/sw/qa/uitest/writer_tests2/fontworks.py b/sw/qa/uitest/writer_tests2/fontworks.py new file mode 100644 index ..df72f5ed67a4 --- /dev/null +++ b/sw/qa/uitest/writer_tests2/fontworks.py @@ -0,0 +1,42 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +from uitest.framework import UITestCase +from uitest.uihelper.common import get_state_as_dict, type_text +from libreoffice.uno.propertyvalue import mkPropertyValues +from uitest.debug import sleep +#test FontWorks dialog +class fontWorksDialog(UITestCase): + +def test_fontwork_selector(self): +self.ui_test.create_doc_in_start_center("writer") +xWriterDoc = self.xUITest.getTopFocusWindow() +xWriterEdit = xWriterDoc.getChild("writer_edit") + + self.ui_test.execute_dialog_through_command(".uno:FontworkGalleryFloater") +xDialog = self.xUITest.getTopFocusWindow() + +FontWorkSelector = xDialog.getChild("ctlFavorites") +# Select element with id (3) +FontWorkSelector.executeAction("SELECT", mkPropertyValues({"POS": "3"})) + self.assertEqual(get_state_as_dict(FontWorkSelector)["SelectedItemPos"], "2") + self.assertEqual(get_state_as_dict(FontWorkSelector)["SelectedItemId"], "3") +self.assertEqual(get_state_as_dict(FontWorkSelector)["ItemsCount"], "36") + +# Select element with id (7) +FontWorkSelector.executeAction("SELECT", mkPropertyValues({"POS": "7"})) + self.assertEqual(get_state_as_dict(FontWorkSelector)["SelectedItemPos"], "6") + self.assertEqual(get_state_as_dict(FontWorkSelector)["SelectedItemId"], "7") + +xCloseBtn = xDialog.getChild("cancel") +self.ui_test.close_dialog_through_button(xCloseBtn) + +self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab: \ No newline at end of file ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 2 commits - i18npool/util include/svtools solenv/bin svtools/inc svtools/Library_svt.mk svtools/source
i18npool/util/i18npool.component|8 ++--- include/svtools/valueset.hxx|2 + solenv/bin/native-code.py | 44 +++ svtools/Library_svt.mk |1 svtools/inc/uiobject.hxx| 38 svtools/source/control/valueset.cxx |7 svtools/source/uitest/uiobject.cxx | 57 7 files changed, 153 insertions(+), 4 deletions(-) New commits: commit edd916b47e01ea53f0989bdbb6a703e081e25aea Author: Ahmed ElShreif AuthorDate: Sat Aug 8 01:04:28 2020 +0200 Commit: Ahmed ElShreif CommitDate: Wed Aug 12 18:48:32 2020 +0200 uitest : Add support for Normal ValueSet This patch will add support for all the normal valuesets inside any dialog . for example it will help in "Select Presets and Shadow Styles in borders tab ( format table or format cell )" to test tdf#133641 . You can use the support by this line: >> obj_name.executeAction("SELECT", mkPropertyValues({"POS": "4"})) Change-Id: I35d0608318f1bca4f4e702ebcc258957835ce0db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100373 Tested-by: Jenkins Reviewed-by: Markus Mohrhard diff --git a/include/svtools/valueset.hxx b/include/svtools/valueset.hxx index 410003e97d72..128ffcb8daf6 100644 --- a/include/svtools/valueset.hxx +++ b/include/svtools/valueset.hxx @@ -407,6 +407,8 @@ public: int nItemId = IsNoSelection() ? -1 : GetSelectedItemId(); return mnSavedItemId != nItemId; } + +virtual FactoryFunction GetUITestFactory() const override; }; diff --git a/svtools/Library_svt.mk b/svtools/Library_svt.mk index 456a7ae568a0..b7ed7657d691 100644 --- a/svtools/Library_svt.mk +++ b/svtools/Library_svt.mk @@ -182,6 +182,7 @@ $(eval $(call gb_Library_add_exception_objects,svt,\ svtools/source/uno/wizard/unowizard \ svtools/source/uno/wizard/wizardpagecontroller \ svtools/source/uno/wizard/wizardshell \ +svtools/source/uitest/uiobject \ )) ifeq ($(OS),WNT) diff --git a/svtools/inc/uiobject.hxx b/svtools/inc/uiobject.hxx new file mode 100644 index ..a27b6d68fdad --- /dev/null +++ b/svtools/inc/uiobject.hxx @@ -0,0 +1,38 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_SVTOOLS_INC_UIOBJECT_HXX +#define INCLUDED_SVTOOLS_INC_UIOBJECT_HXX + +#include +#include +#include + +class ValueSet; + +class ValueSetUIObject final : public WindowUIObject +{ +ValueSet* mpSet; + +public: +ValueSetUIObject(const VclPtr& xSetWin, ValueSet* pSet); + +virtual void execute(const OUString& rAction, const StringMap& rParameters) override; + +static std::unique_ptr create(vcl::Window* pWindow); + +virtual StringMap get_state() override; + +private: +OUString get_name() const override; +}; + +#endif // INCLUDED_SVX_INC_UIOBJECT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx index 74a09e613d26..e56f3e7e2d43 100644 --- a/svtools/source/control/valueset.cxx +++ b/svtools/source/control/valueset.cxx @@ -43,6 +43,8 @@ #include #include +#include + using namespace css::uno; using namespace css::lang; using namespace css::accessibility; @@ -1909,4 +1911,9 @@ void ValueSet::Hide() mxScrolledWindow->hide(); } +FactoryFunction ValueSet::GetUITestFactory() const +{ +return ValueSetUIObject::create; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/uitest/uiobject.cxx b/svtools/source/uitest/uiobject.cxx new file mode 100644 index ..904a81be1bb6 --- /dev/null +++ b/svtools/source/uitest/uiobject.cxx @@ -0,0 +1,57 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include +#include +#include +#include + +ValueSetUIObject::ValueSetUIObject(const VclPtr& xSetWin, ValueSet* pSet) +: WindowUIObject(xSetWin) +, mpSet(pSet) +{ +} + +void ValueSetUIObject::execute(const OUString& rAction, const StringMap& rParameters) +{ +if (rAction == "SELECT") +{ +if (rParameters.find("POS") != rParameters.end()) +{ +OUString aIndexStr = rParameters.find("POS")->second; + +sal_Int32 nIndex = aIndexStr.toInt32(); +mpSet->SelectItem(nIndex); +
[Libreoffice-commits] core.git: 2 commits - include/vcl uitest/writer_tests8 vcl/source
include/vcl/menubtn.hxx |5 ++ include/vcl/uitest/uiobject.hxx | 23 uitest/writer_tests8/customizeDialog.py | 28 ++ vcl/source/control/menubtn.cxx | 12 ++ vcl/source/uitest/uiobject.cxx | 60 5 files changed, 128 insertions(+) New commits: commit 66ec91730d8b7b416ed6c5e8cf88658baafee91e Author: Ahmed ElShreif AuthorDate: Tue Jul 28 05:20:47 2020 +0200 Commit: Ahmed ElShreif CommitDate: Thu Aug 6 03:06:33 2020 +0200 uitest : Add demo for gear button menu in Tools->Customize Change-Id: I3f0596ad044560a424ca6786197c250bff2429bb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99568 Tested-by: Jenkins Reviewed-by: Markus Mohrhard diff --git a/uitest/writer_tests8/customizeDialog.py b/uitest/writer_tests8/customizeDialog.py index dfc6ae771e1b..5b6ab664346a 100644 --- a/uitest/writer_tests8/customizeDialog.py +++ b/uitest/writer_tests8/customizeDialog.py @@ -104,4 +104,32 @@ class ConfigureDialog(UITestCase): self.ui_test.close_doc() +def test_gear_button_menu(self): +self.ui_test.create_doc_in_start_center("writer") + +self.ui_test.execute_dialog_through_command(".uno:ConfigureDialog") +def close_dialog(dlg): +CancelBtn = dlg.getChild("cancel") +self.ui_test.close_dialog_through_button(CancelBtn) + +# Open the New Menu Dialog with id = 0 +xDialog = self.xUITest.getTopFocusWindow() +xmenugearbtn=xDialog.getChild("menugearbtn") +def show_dialog0(): +xmenugearbtn.executeAction("OPENFROMLIST", mkPropertyValues({"POS": "0" })) +self.ui_test.execute_blocking_action( action=show_dialog0, dialog_handler=close_dialog) + +# Open the Rename Menu Dialog with id = 2 +xDialog = self.xUITest.getTopFocusWindow() +xmenugearbtn=xDialog.getChild("menugearbtn") +def show_dialog2(): +xmenugearbtn.executeAction("OPENFROMLIST", mkPropertyValues({"POS": "2"})) +self.ui_test.execute_blocking_action( action=show_dialog2, dialog_handler=close_dialog) + +xDialog = self.xUITest.getTopFocusWindow() +xcancBtn = xDialog.getChild("cancel") +self.ui_test.close_dialog_through_button(xcancBtn) + +self.ui_test.close_doc() + # vim: set shiftwidth=4 softtabstop=4 expandtab: commit 8517c19410dde16b951d66a13d0ffa385f877d7a Author: Ahmed ElShreif AuthorDate: Sat Jul 18 17:56:27 2020 +0200 Commit: Ahmed ElShreif CommitDate: Thu Aug 6 03:06:19 2020 +0200 uitest : Add support for Menu Button objects This will help us test MenuButton like "gear button menu in Tools->Customize" You can test this type of button by excuting this actions: >>var_name.executeAction("OPENLIST", mkPropertyValues({})) >>var_name.executeAction("CLOSELIST", mkPropertyValues({})) >>var_name.executeAction("OPENFROMLIST", mkPropertyValues({"POS": "0" })) Then you can check on it using this lines: >>get_state_as_dict(var_name)["Label"] Change-Id: I189759d9c32237a9a34ee82cfde9611eedff4f3f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98996 Tested-by: Jenkins Reviewed-by: Markus Mohrhard diff --git a/include/vcl/menubtn.hxx b/include/vcl/menubtn.hxx index 609d3d031aab..ea6916a48629 100644 --- a/include/vcl/menubtn.hxx +++ b/include/vcl/menubtn.hxx @@ -84,6 +84,11 @@ public: voidSetActivateHdl( const Link& rLink ) { maActivateHdl = rLink; } voidSetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; } + +virtual FactoryFunction GetUITestFactory() const override; + +void SetCurItemId(); + }; diff --git a/include/vcl/uitest/uiobject.hxx b/include/vcl/uitest/uiobject.hxx index 1797c9156aba..c5b3f07dbe75 100644 --- a/include/vcl/uitest/uiobject.hxx +++ b/include/vcl/uitest/uiobject.hxx @@ -35,6 +35,7 @@ class SpinButton; class SpinField; class VerticalTabControl; class VclMultiLineEdit; +class MenuButton; class ToolBox; typedef std::map StringMap; @@ -504,6 +505,28 @@ private: virtual OUString get_name() const override; }; +class MenuButtonUIObject final : public WindowUIObject +{ +VclPtr mxMenuButton; + +public: + +MenuButtonUIObject(const VclPtr& xMenuButton); +virtual ~MenuButtonUIObject() override; + +virtual StringMap get_state() override; + +virtual void execute(const OUString& rAction, +const StringMap& rParameters) override; + +static std::unique_ptr create(vcl::Window* pWindow); + +private: + +virtual OUString get_name() const override; +}; + + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/control/menubtn.cxx b/vcl/source/control/menubtn.cxx index 7402d361f4b8..4acf4ffddc82 100644 --- a/vcl/source/control/menubtn.cxx +++ b/vcl/source/control/menubtn.cxx @@ -
[Libreoffice-commits] core.git: sw/qa
sw/qa/uitest/writer_tests3/hyperlinkdialog.py |1 + 1 file changed, 1 insertion(+) New commits: commit 27798238ecb200e0753b013c79df0e6c014c7a7a Author: Ahmed ElShreif AuthorDate: Mon Jul 27 18:30:12 2020 +0200 Commit: Stephan Bergmann CommitDate: Tue Jul 28 09:04:35 2020 +0200 uitest : Avoid any timing issue in test_insert_hyperlink Change-Id: I090e28fb6d902ff0e2f9e7a9ef447133a29a85a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99520 Tested-by: Jenkins Reviewed-by: Ahmed ElShreif Reviewed-by: Stephan Bergmann diff --git a/sw/qa/uitest/writer_tests3/hyperlinkdialog.py b/sw/qa/uitest/writer_tests3/hyperlinkdialog.py index 5b414242babc..aafa6ae8d21e 100644 --- a/sw/qa/uitest/writer_tests3/hyperlinkdialog.py +++ b/sw/qa/uitest/writer_tests3/hyperlinkdialog.py @@ -63,6 +63,7 @@ class HyperlinkDialog(UITestCase): xtarget = xDialog.getChild("target") xtarget.executeAction("TYPE", mkPropertyValues({"TEXT": "http://www.libreoffice.org/"})) +self.ui_test.wait_until_property_is_updated(xtarget, "Text", "http://www.libreoffice.org/";) self.assertEqual(get_state_as_dict(xtarget)["Text"], "http://www.libreoffice.org/";) xindication = xDialog.getChild("indication") ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: vcl/source
vcl/source/uitest/uiobject.cxx |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) New commits: commit fb6a74e850a402ceaee7c26dce1ffc48c0798ede Author: Ahmed ElShreif AuthorDate: Mon Jul 13 05:39:04 2020 +0200 Commit: Ahmed ElShreif CommitDate: Tue Jul 14 19:54:21 2020 +0200 uitest : extend the ComboBox UIObject As ComboBox UIObject can be treated as Edit UIObject so this minor change will let us do all Edit UIObject actions on the ComboBox UIObject if needed . Change-Id: I49dc17aa443e571a8f6aa0b6e1c786601af397a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98615 Tested-by: Jenkins Reviewed-by: Ahmed ElShreif Reviewed-by: Markus Mohrhard diff --git a/vcl/source/uitest/uiobject.cxx b/vcl/source/uitest/uiobject.cxx index 9e58f594b158..4e14224cf139 100644 --- a/vcl/source/uitest/uiobject.cxx +++ b/vcl/source/uitest/uiobject.cxx @@ -1118,8 +1118,7 @@ void ComboBoxUIObject::execute(const OUString& rAction, } mxComboBox->Select(); } -else if (rAction == "TYPE") -{ +else if ( rAction == "TYPE" || rAction == "SET" || rAction == "CLEAR" ){ if (mxComboBox->GetSubEdit()) { Edit* pEdit = mxComboBox->GetSubEdit(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/qa
sw/qa/uitest/writer_tests6/findbar.py | 71 ++ 1 file changed, 71 insertions(+) New commits: commit 5b2dcb95710391c6e0d33e5ed4b743c01929d436 Author: Ahmed ElShreif AuthorDate: Sun Jul 12 14:24:10 2020 +0200 Commit: Ahmed ElShreif CommitDate: Tue Jul 14 15:34:11 2020 +0200 uitest : Add demo for "bottom find bar" using ToolBox support Change-Id: Ie586851be1e9131394ac0103837b26f408026dca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98596 Tested-by: Jenkins Reviewed-by: Markus Mohrhard diff --git a/sw/qa/uitest/writer_tests6/findbar.py b/sw/qa/uitest/writer_tests6/findbar.py new file mode 100644 index ..df973dc8e162 --- /dev/null +++ b/sw/qa/uitest/writer_tests6/findbar.py @@ -0,0 +1,71 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +from uitest.framework import UITestCase +import time +from uitest.uihelper.common import get_state_as_dict, type_text +from libreoffice.uno.propertyvalue import mkPropertyValues +from uitest.debug import sleep + +#test Find Bar +class FindBar(UITestCase): + +def test_find_bar(self): + +self.ui_test.create_doc_in_start_center("writer") +xWriterDoc = self.xUITest.getTopFocusWindow() +xWriterEdit = xWriterDoc.getChild("writer_edit") + +# Type some lines to search for words on them +xWriterEdit.executeAction("TYPE", mkPropertyValues({"TEXT": "LibreOffice"})) +xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"})) +xWriterEdit.executeAction("TYPE", mkPropertyValues({"TEXT": "LibreOffice Writer"})) +xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"})) +xWriterEdit.executeAction("TYPE", mkPropertyValues({"TEXT": "LibreOffice Calc"})) +xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"})) +xWriterEdit.executeAction("TYPE", mkPropertyValues({"TEXT": "The Document Foundation"})) + +# open the Find Bar +xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+f"})) + +# Type the Word that we want to search for it +xfind = xWriterDoc.getChild("find") +xfind.executeAction("TYPE", mkPropertyValues({"TEXT": "Libre"})) + +# Select the Find Bar +xfind_bar = xWriterDoc.getChild("FindBar") +self.assertEqual(get_state_as_dict(xfind_bar)["ItemCount"], "14") + +# Press on FindAll in the Find Bar +xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "5"})) # 5 is FindAll id +self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemID"], "5") +self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemText"], "Find All") + self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemCommand"], ".uno:FindAll") +self.assertEqual(get_state_as_dict(xWriterEdit)["SelectedText"], "LibreLibreLibre") + +# Press on Find Next in the Find Bar +xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "4"})) # 4 is Find Next id +self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemID"], "4") +self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemText"], "Find Next") + self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemCommand"], ".uno:DownSearch") +self.assertEqual(get_state_as_dict(xWriterEdit)["SelectedText"], "Libre") + +# Press on Find Previous in the Find Bar +xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "3"})) # 3 is Find Previous id +self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemID"], "3") +self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemText"], "Find Previous") + self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemCommand"], ".uno:UpSearch") +self.assertEqual(get_state_as_dict(xWriterEdit)["SelectedText"], "Libre") + +# Close the Find Bar +xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "1"})) # 1 is for close + +self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/vcl svx/source vcl/source
include/vcl/toolbox.hxx|4 + include/vcl/uitest/uiobject.hxx| 23 +++ svx/source/tbxctrls/tbunosearchcontrollers.cxx |1 vcl/source/uitest/uiobject.cxx | 52 + vcl/source/window/toolbox2.cxx |7 +++ 5 files changed, 87 insertions(+) New commits: commit d17227830438f7a7e0d5de82b5a447771dfe8f25 Author: Ahmed ElShreif AuthorDate: Fri Jul 10 23:45:51 2020 +0200 Commit: Ahmed ElShreif CommitDate: Tue Jul 14 15:28:47 2020 +0200 uitest : Add support for "ToolBox" Objects for example" "bottom find bar" This patch will help us in testing any ToolBox Objects by this lines : >> variable_name = MainWindow.getChild(Bar_name) >> variable_name.executeAction("CLICK", mkPropertyValues({"POS": poition_x })) for position_x you just put the id of which entry in the ToolBox do you want to press on it . Also This patch set the ID of the bottom find bar to be "FindBar" to be able to select it in UITests . Change-Id: I360cdbde47be188c49c6d61bf5df4df5caa6a23e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98549 Tested-by: Jenkins Reviewed-by: Markus Mohrhard diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx index 6987f777b00a..8383662129f8 100644 --- a/include/vcl/toolbox.hxx +++ b/include/vcl/toolbox.hxx @@ -78,6 +78,10 @@ class VCL_DLLPUBLIC ToolBox : public DockingWindow public: using ImplToolItems = std::vector; +virtual FactoryFunction GetUITestFactory() const override; + +void SetCurItemId( sal_uInt16 CurID ) { mnCurItemId=CurID; } + static constexpr auto APPEND = std::numeric_limits::max(); diff --git a/include/vcl/uitest/uiobject.hxx b/include/vcl/uitest/uiobject.hxx index 15686e406904..36dd5488ce7a 100644 --- a/include/vcl/uitest/uiobject.hxx +++ b/include/vcl/uitest/uiobject.hxx @@ -34,6 +34,7 @@ class SpinButton; class SpinField; class VerticalTabControl; class VclMultiLineEdit; +class ToolBox; typedef std::map StringMap; @@ -480,6 +481,28 @@ private: SvTreeListEntry* const mpEntry; }; +class ToolBoxUIObject final : public WindowUIObject +{ +private: +VclPtr mxToolBox; + +public: + +ToolBoxUIObject(const VclPtr& mxToolBox); +virtual ~ToolBoxUIObject() override; + +virtual void execute(const OUString& rAction, +const StringMap& rParameters) override; + +virtual StringMap get_state() override; + +static std::unique_ptr create(vcl::Window* pWindow); + +private: + +virtual OUString get_name() const override; +}; + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx index 4305e95d1c9f..730acf5dece1 100644 --- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx +++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx @@ -1544,6 +1544,7 @@ void SAL_CALL FindbarDispatcher::dispatch( const css::util::URL& aURL, const css css::uno::Reference< css::awt::XWindow > xWindow(xUIElement->getRealInterface(), css::uno::UNO_QUERY); VclPtr pWindow = VCLUnoHelper::GetWindow( xWindow ); ToolBox* pToolBox = static_cast(pWindow.get()); +pToolBox->set_id("FindBar"); if ( pToolBox ) { ToolBox::ImplToolItems::size_type nItemCount = pToolBox->GetItemCount(); diff --git a/vcl/source/uitest/uiobject.cxx b/vcl/source/uitest/uiobject.cxx index 477f1ff06af9..9e58f594b158 100644 --- a/vcl/source/uitest/uiobject.cxx +++ b/vcl/source/uitest/uiobject.cxx @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -1561,4 +1562,55 @@ std::unique_ptr VerticalTabControlUIObject::create(vcl::Window* pWindo return std::unique_ptr(new VerticalTabControlUIObject(pTabControl)); } + +ToolBoxUIObject::ToolBoxUIObject(const VclPtr& xToolBox): +WindowUIObject(xToolBox), +mxToolBox(xToolBox) +{ +} + +ToolBoxUIObject::~ToolBoxUIObject() +{ +} + +void ToolBoxUIObject::execute(const OUString& rAction, +const StringMap& rParameters) +{ +if (rAction == "CLICK") +{ +if (rParameters.find("POS") != rParameters.end()) +{ +auto itr = rParameters.find("POS"); +sal_uInt16 nPos = itr->second.toUInt32(); +mxToolBox->SetCurItemId(nPos); +mxToolBox->Click(); +mxToolBox->Select(); +} +} +else +WindowUIObject::execute(rAction, rParameters); +} + +StringMap ToolBoxUIObject::get_state() +{ +StringMap aMap = WindowUIObject::get_state(); +aMap["CurrSelectedItemID"] = OUString::number(mxToolBox->GetCurItemId()); +aMap["CurrSelectedItemText"] = mxToolBox->GetItemText(mxToolBox->GetCurItemId()); +aMap["CurrSelectedItemCommand"] = mxToolBox->GetItemCommand(mxToolBox->GetCurItemId()); +aMap["ItemCount"] = OUString::number(mxToolBox->GetIte
[Libreoffice-commits] core.git: sw/qa
sw/qa/uitest/writer_tests/comments.py | 160 ++ 1 file changed, 160 insertions(+) New commits: commit a5b00f6e9790b17d47a8573b441ce886f5374014 Author: Ahmed ElShreif AuthorDate: Fri Jun 19 23:29:49 2020 +0200 Commit: Ahmed ElShreif CommitDate: Thu Jul 9 16:34:17 2020 +0200 uitest : Fix the old demo of writer comments This test case is added as the old test case here: https://gerrit.libreoffice.org/c/core/+/96295 makes some randomly fail. I tried to fix this in the new test case . By trying to run the old test case multiple times locally . The problem was when you execute Command to add new comment . Sometimes the comment doesn't have enough time to be created and added as a child in the MainWindow Object So test case fails . So the fix was to use this function: "ui_test.wait_until_child_is_available(parent, childName)" This will make sure that that the comment was created successfully and added as a child in the MainWindow to be selected in next lines . I tried to run the test case again multiple times in my laptop and it never fails . Change-Id: I51e4b0802f3fa92139cbc6cdc7092c119e49d1b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96752 Tested-by: Jenkins Reviewed-by: Ahmed ElShreif Reviewed-by: Markus Mohrhard diff --git a/sw/qa/uitest/writer_tests/comments.py b/sw/qa/uitest/writer_tests/comments.py new file mode 100644 index ..c85ed256de37 --- /dev/null +++ b/sw/qa/uitest/writer_tests/comments.py @@ -0,0 +1,160 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +from uitest.framework import UITestCase +import time +from uitest.uihelper.common import get_state_as_dict, type_text +from libreoffice.uno.propertyvalue import mkPropertyValues +from uitest.debug import sleep +from uitest.config import DEFAULT_SLEEP +#test comments + +class Comments(UITestCase): + +def test_comments_features(self): + +xMainDoc = self.ui_test.create_doc_in_start_center("writer") + +xMainWindow = self.xUITest.getTopFocusWindow() + +xwriter_edit = xMainWindow.getChild("writer_edit") +xwriter_edit.executeAction("TYPE", mkPropertyValues({"TEXT": "Before "})) + +# adding new Comment +self.xUITest.executeCommand(".uno:InsertAnnotation") + +# wait until the comment is available +self.ui_test.wait_until_child_is_available(xMainWindow, 'Comment1') + +xComment1 = xMainWindow.getChild("Comment1") +xComment1.executeAction("TYPE", mkPropertyValues({"TEXT": "This is the First Comment"})) +self.assertEqual(get_state_as_dict(xComment1)["Text"], "This is the First Comment" ) +self.assertEqual(get_state_as_dict(xComment1)["Resolved"], "false" ) +self.assertEqual(get_state_as_dict(xComment1)["Author"], "Unknown Author" ) +self.assertEqual(get_state_as_dict(xComment1)["ReadOnly"], "false" ) + +xComment1.executeAction("LEAVE", mkPropertyValues({})) + +xwriter_edit.executeAction("TYPE", mkPropertyValues({"TEXT": "After"})) +xwriter_edit.executeAction("SELECT", mkPropertyValues({"END_POS": "0", "START_POS": "13"})) +self.assertEqual(get_state_as_dict(xwriter_edit)["SelectedText"], "Before After" ) + +# test Resolve Comment +xComment1.executeAction("RESOLVE", mkPropertyValues({})) +self.assertEqual(get_state_as_dict(xComment1)["Resolved"], "true" ) + +# test Select text from Comment +xComment1.executeAction("SELECT", mkPropertyValues({"FROM": "0", "TO": "4"})) +self.assertEqual(get_state_as_dict(xComment1)["SelectedText"], "This" ) + +# test Hide then Show Comment +xComment1.executeAction("HIDE", mkPropertyValues({})) +self.assertEqual(get_state_as_dict(xComment1)["Visible"], "false" ) +xComment1.executeAction("SHOW", mkPropertyValues({})) +self.assertEqual(get_state_as_dict(xComment1)["Visible"], "true" ) + +# test delete Comment +xComment1.executeAction("DELETE", mkPropertyValues({})) +self.assertTrue("Comment1" not in xMainWindow.getChildren()) + +self.ui_test.close_doc() + +def test_multi_comments(self): + +xMainDoc = self.ui_test.create_doc_in_start_center("writer") + +xMainWindow = self.xUITest.getTopFocusWindow() + +xwriter_edit = xMainWindow.getChild("writer_edit") + +# adding 3 new Comment +xwriter_edit.executeAction("TYPE", mkPropertyValues({"TEXT": "Line 1"})) +self.xUITest.executeCommand(".uno:InsertAnnotation") +# wait until the comment is available +
[Libreoffice-commits] core.git: sc/qa
sc/qa/uitest/calc_tests/Comments.py | 49 1 file changed, 49 insertions(+) New commits: commit a480b32fb7a381fc17d51c2ccd0e8c4455d38792 Author: Ahmed ElShreif AuthorDate: Wed Jun 24 18:59:32 2020 +0200 Commit: Ahmed ElShreif CommitDate: Wed Jul 8 16:47:39 2020 +0200 uitest : Add demo for Calc-comments This patch test the support that added to this patch: https://gerrit.libreoffice.org/c/core/+/96837 Change-Id: If7444813f65bd90d62d0eb3504dcfc588c3f4e32 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97074 Tested-by: Jenkins Reviewed-by: Markus Mohrhard diff --git a/sc/qa/uitest/calc_tests/Comments.py b/sc/qa/uitest/calc_tests/Comments.py new file mode 100644 index ..52d1f2a1d666 --- /dev/null +++ b/sc/qa/uitest/calc_tests/Comments.py @@ -0,0 +1,49 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +from uitest.framework import UITestCase +from uitest.uihelper.common import get_state_as_dict +from libreoffice.uno.propertyvalue import mkPropertyValues +from uitest.debug import sleep + +class Comments(UITestCase): +def test_comment(self): +calc_doc = self.ui_test.create_doc_in_start_center("calc") +xCalcDoc = self.xUITest.getTopFocusWindow() +gridwin = xCalcDoc.getChild("grid_window") +document = self.ui_test.get_component() + +# Select Cell D8 +gridwin.executeAction("SELECT", mkPropertyValues({"TABLE": "0"})) +gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D8"})) + +# Create comment and open it's window +gridwin.executeAction("COMMENT", mkPropertyValues({"OPEN": ""})) + +# Write text in the Comment Window +gridwin.executeAction("TYPE", mkPropertyValues({"TEXT": "First Comment"})) + +# Close Comment Window +gridwin.executeAction("COMMENT", mkPropertyValues({"CLOSE":""})) + +# Check on the comment text +self.assertEqual(get_state_as_dict(gridwin)["CurrentCellCommentText"], "First Comment") + +# Check on comment in another cell +gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) +gridwin.executeAction("COMMENT", mkPropertyValues({"OPEN": ""})) +gridwin.executeAction("TYPE", mkPropertyValues({"TEXT": "Second Comment"})) +gridwin.executeAction("COMMENT", mkPropertyValues({"CLOSE":""})) +self.assertEqual(get_state_as_dict(gridwin)["CurrentCellCommentText"], "Second Comment") + +# Write Comment without opening Comment window +gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B5"})) +gridwin.executeAction("COMMENT", mkPropertyValues({"SETTEXT": "Third Comment"})) +self.assertEqual(get_state_as_dict(gridwin)["CurrentCellCommentText"], "Third Comment") + +self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab: \ No newline at end of file ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sc/source
sc/source/ui/inc/uiobject.hxx|2 + sc/source/ui/uitest/uiobject.cxx | 41 +++ 2 files changed, 43 insertions(+) New commits: commit e1690504c27081ff5b212f20a80468a1c703c09a Author: Ahmed ElShreif AuthorDate: Mon Jun 22 11:15:56 2020 +0200 Commit: Ahmed ElShreif CommitDate: Wed Jul 8 16:46:46 2020 +0200 uitest : Add support to Calc - comments This patch has the implementation of the support for Calc comments . Now you can use these lines to use comments in calc: * Open Comment Window : >> gridwin.executeAction("COMMENT",mkPropertyValues({"OPEN":""})) * Then Type text as normal : >> gridwin.executeAction("TYPE",mkPropertyValues({"TEXT":"any"})) * Close Comment Window : >> gridwin.executeAction("COMMENT",mkPropertyValues({"CLOSE":""})) * Write Comment without opening comment window: >> gridwin.executeAction("COMMENT",mkPropertyValues({"SETTEXT":"any"})) You can also check the comment text by this line: >> get_state_as_dict(gridwind)["CurrentCellCommentText"] I will provide a test case in another patch. Change-Id: Ie3fc4efffb07827e742bdaa99dd5147c8b9711d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96837 Tested-by: Jenkins Reviewed-by: Ahmed ElShreif Reviewed-by: Markus Mohrhard diff --git a/sc/source/ui/inc/uiobject.hxx b/sc/source/ui/inc/uiobject.hxx index 3f92943293f2..827c2f1b5c07 100644 --- a/sc/source/ui/inc/uiobject.hxx +++ b/sc/source/ui/inc/uiobject.hxx @@ -14,6 +14,7 @@ class ScGridWindow; class ScDBFunc; class ScDrawView; class ScTabViewShell; +class ScViewFunc; class ScGridWinUIObject : public WindowUIObject { @@ -43,6 +44,7 @@ private: ScDBFunc* getDBFunc(); ScDrawView* getDrawView(); ScTabViewShell* getViewShell(); +ScViewFunc* getViewFunc(); }; class ScNavigatorDlg; diff --git a/sc/source/ui/uitest/uiobject.cxx b/sc/source/ui/uitest/uiobject.cxx index df62ab45881d..ec1b777ebfc5 100644 --- a/sc/source/ui/uitest/uiobject.cxx +++ b/sc/source/ui/uitest/uiobject.cxx @@ -14,14 +14,18 @@ #include #include +#include #include #include #include #include #include #include +#include #include #include +#include +#include #include #include @@ -75,6 +79,13 @@ StringMap ScGridWinUIObject::get_state() aMap["MarkedArea"] = aMarkedAreaString; +ScDocument* pDoc = mxGridWindow->getViewData()->GetDocument(); +ScAddress aPos( mxGridWindow->getViewData()->GetCurX() , mxGridWindow->getViewData()->GetCurY() , mxGridWindow->getViewData()->GetTabNo() ); +if ( pDoc->HasNote( aPos ) ) +{ +aMap["CurrentCellCommentText"] = pDoc->GetNote( aPos )->GetText(); +} + ScAppOptions aOpt = SC_MOD()->GetAppOptions(); aMap["Zoom"] = OUString::number( aOpt.GetZoom() ); return aMap; @@ -104,6 +115,14 @@ ScTabViewShell* ScGridWinUIObject::getViewShell() return pViewShell; } +ScViewFunc* ScGridWinUIObject::getViewFunc() +{ +ScViewData* pViewData = mxGridWindow->getViewData(); +ScViewFunc* pViewFunc = pViewData->GetView(); + +return pViewFunc; +} + void ScGridWinUIObject::execute(const OUString& rAction, const StringMap& rParameters) { @@ -231,6 +250,28 @@ void ScGridWinUIObject::execute(const OUString& rAction, mxGridWindow->LaunchDataSelectMenu(nCol, nRow); } } +else if (rAction == "COMMENT") +{ +if ( rParameters.find("OPEN") != rParameters.end() ) +{ +ScViewFunc* pViewFunc = getViewFunc(); +pViewFunc->EditNote(); +} +else if ( rParameters.find("CLOSE") != rParameters.end() ) +{ +FuDraw* pDraw = dynamic_cast (getViewFunc()->GetDrawFuncPtr()); +ScViewData* pViewData = mxGridWindow->getViewData(); +pViewData->GetDispatcher().Execute( pDraw->GetSlotID() , SfxCallMode::SLOT | SfxCallMode::RECORD ); +} +else if ( rParameters.find("SETTEXT") != rParameters.end() ) +{ +auto itr = rParameters.find("SETTEXT"); +const OUString rStr = itr->second; +ScDocument* pDoc = mxGridWindow->getViewData()->GetDocument(); +ScAddress aPos( mxGridWindow->getViewData()->GetCurX() , mxGridWindow->getViewData()->GetCurY() , mxGridWindow->getViewData()->GetTabNo() ); +pDoc->GetOrCreateNote( aPos )->SetText( aPos , rStr ); +} +} else if (rAction == "SIDEBAR") { SfxViewFrame* pViewFrm = SfxViewFrame::Current(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/vcl vcl/source
include/vcl/ivctrl.hxx |2 + include/vcl/uitest/uiobject.hxx | 23 + vcl/source/control/ivctrl.cxx |6 vcl/source/uitest/uiobject.cxx | 52 4 files changed, 83 insertions(+) New commits: commit 644a775833857955576b5284bf2f1b992d8f5b21 Author: Ahmed ElShreif AuthorDate: Tue Jun 2 05:30:40 2020 +0200 Commit: Ahmed ElShreif CommitDate: Wed Jul 8 11:12:08 2020 +0200 uitest: Add support for vertical TabControl Object We need support for this Object as some dialogs use it like Hyperlink Dialog . So now we can navigate in the dialog in the same way we navigate with the normal TabControl Objects . You can use this lines in your test case that test a dialog that has vertical TabControl Object: >> xtab=HyperlinkDialog.getChild("tabcontrol") >> xtab.executeAction("SELECT", mkPropertyValues({"POS": "0"})) Change-Id: Id1792f5cceb8b08e13cb8c0c5fbaf1ff29f996d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98135 Tested-by: Jenkins Reviewed-by: Markus Mohrhard diff --git a/include/vcl/ivctrl.hxx b/include/vcl/ivctrl.hxx index adadcc9fefc4..399079c69f9d 100644 --- a/include/vcl/ivctrl.hxx +++ b/include/vcl/ivctrl.hxx @@ -323,6 +323,8 @@ public: void SetPageText(const OString& rPageId, const OUString& rText); vcl::Window* GetPageParent() { return m_xBox.get(); } + +virtual FactoryFunction GetUITestFactory() const override; }; #endif // INCLUDED_VCL_IVCTRL_HXX diff --git a/include/vcl/uitest/uiobject.hxx b/include/vcl/uitest/uiobject.hxx index 2c9a3e36cc60..15686e406904 100644 --- a/include/vcl/uitest/uiobject.hxx +++ b/include/vcl/uitest/uiobject.hxx @@ -32,6 +32,7 @@ class SvTreeListBox; class SvTreeListEntry; class SpinButton; class SpinField; +class VerticalTabControl; class VclMultiLineEdit; typedef std::map StringMap; @@ -410,6 +411,28 @@ private: virtual OUString get_name() const override; }; +class VerticalTabControlUIObject final : public WindowUIObject +{ +private: +VclPtr mxTabControl; + +public: + +VerticalTabControlUIObject(const VclPtr& mxTabControl); +virtual ~VerticalTabControlUIObject() override; + +virtual void execute(const OUString& rAction, +const StringMap& rParameters) override; + +virtual StringMap get_state() override; + +static std::unique_ptr create(vcl::Window* pWindow); + +private: + +virtual OUString get_name() const override; +}; + class TreeListUIObject final : public WindowUIObject { public: diff --git a/vcl/source/control/ivctrl.cxx b/vcl/source/control/ivctrl.cxx index 82e2bbc0c08b..c0c78a986b0d 100644 --- a/vcl/source/control/ivctrl.cxx +++ b/vcl/source/control/ivctrl.cxx @@ -27,6 +27,7 @@ #include #include #include +#include using namespace ::com::sun::star::accessibility; @@ -628,4 +629,9 @@ void VerticalTabControl::SetPageText(const OString& rPageId, const OUString& rTe pData->pEntry->SetText(rText); } +FactoryFunction VerticalTabControl::GetUITestFactory() const +{ +return VerticalTabControlUIObject::create; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/uitest/uiobject.cxx b/vcl/source/uitest/uiobject.cxx index 29b3c296b8d2..fc32de562701 100644 --- a/vcl/source/uitest/uiobject.cxx +++ b/vcl/source/uitest/uiobject.cxx @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -1508,4 +1509,55 @@ std::unique_ptr RoadmapWizardUIObject::create(vcl::Window* pWindow) return std::unique_ptr(new RoadmapWizardUIObject(pRoadmapWizard)); } +VerticalTabControlUIObject::VerticalTabControlUIObject(const VclPtr& xTabControl): +WindowUIObject(xTabControl), +mxTabControl(xTabControl) +{ +} + +VerticalTabControlUIObject::~VerticalTabControlUIObject() +{ +} + +void VerticalTabControlUIObject::execute(const OUString& rAction, +const StringMap& rParameters) +{ +if (rAction == "SELECT") +{ +if (rParameters.find("POS") != rParameters.end()) +{ +auto itr = rParameters.find("POS"); +sal_uInt32 nPos = itr->second.toUInt32(); +OString xid = mxTabControl->GetPageId(nPos); +mxTabControl->SetCurPageId(xid); +} +} +else +WindowUIObject::execute(rAction, rParameters); +} + +StringMap VerticalTabControlUIObject::get_state() +{ +StringMap aMap = WindowUIObject::get_state(); +aMap["PageCount"] = OUString::number(mxTabControl->GetPageCount()); + +OString nPageId = mxTabControl->GetCurPageId(); +aMap["CurrPageTitel"] = mxTabControl->GetPageText(nPageId); +aMap["CurrPagePos"] = OUString::number(mxTabControl->GetPagePos(nPageId)); + +return aMap; +} + +OUString VerticalTabControlUIObject::get_name() const +{ +return "VerticalTabControlUIObject"; +} + +std::unique_ptr VerticalTabControlUIObject::create(vcl::Window* pWi
[Libreoffice-commits] core.git: sw/qa
sw/qa/uitest/writer_tests3/hyperlinkdialog.py | 83 ++ 1 file changed, 83 insertions(+) New commits: commit 5701b35279444a635e6ef33ba2ffd35965e1c25d Author: Ahmed ElShreif AuthorDate: Sun Jul 5 15:18:51 2020 +0200 Commit: Ahmed ElShreif CommitDate: Wed Jul 8 11:12:43 2020 +0200 uitest : sw: Add UItest for Hyperlink Dialog This test case tests the Hyperlink Dialog in inserting a Hyperlink . Also it tests the Vertical TabControl Support that added here: https://gerrit.libreoffice.org/c/core/+/98135 Change-Id: Ic7975cc12425dbcba24b0261404585ded006e5e0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98160 Tested-by: Jenkins Reviewed-by: Markus Mohrhard diff --git a/sw/qa/uitest/writer_tests3/hyperlinkdialog.py b/sw/qa/uitest/writer_tests3/hyperlinkdialog.py new file mode 100644 index ..5b414242babc --- /dev/null +++ b/sw/qa/uitest/writer_tests3/hyperlinkdialog.py @@ -0,0 +1,83 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +from uitest.framework import UITestCase +import time +from uitest.uihelper.common import get_state_as_dict, type_text +from libreoffice.uno.propertyvalue import mkPropertyValues +from uitest.debug import sleep + +#test Hyperlink dialog +class HyperlinkDialog(UITestCase): + +def test_hyperlink_dialog_vertical_tab(self): + +self.ui_test.create_doc_in_start_center("writer") +MainWindow = self.xUITest.getTopFocusWindow() + +self.ui_test.execute_dialog_through_command(".uno:HyperlinkDialog") +xDialog = self.xUITest.getTopFocusWindow() + +# Test the vertical tab +xtab=xDialog.getChild("tabcontrol") +self.assertEqual(get_state_as_dict(xtab)["PageCount"], "4") + +xtab.executeAction("SELECT", mkPropertyValues({"POS": "0"})) +self.assertEqual(get_state_as_dict(xtab)["CurrPageTitel"], "Internet") +self.assertEqual(get_state_as_dict(xtab)["CurrPagePos"], "0") + +xtab.executeAction("SELECT", mkPropertyValues({"POS": "1"})) +self.assertEqual(get_state_as_dict(xtab)["CurrPageTitel"], "Mail") +self.assertEqual(get_state_as_dict(xtab)["CurrPagePos"], "1") + +xtab.executeAction("SELECT", mkPropertyValues({"POS": "2"})) +self.assertEqual(get_state_as_dict(xtab)["CurrPageTitel"], "Document") +self.assertEqual(get_state_as_dict(xtab)["CurrPagePos"], "2") + +xtab.executeAction("SELECT", mkPropertyValues({"POS": "3"})) +self.assertEqual(get_state_as_dict(xtab)["CurrPageTitel"], "New Document") +self.assertEqual(get_state_as_dict(xtab)["CurrPagePos"], "3") + +xcancel = xDialog.getChild("cancel") +self.ui_test.close_dialog_through_button(xcancel) + +self.ui_test.close_doc() + +def test_insert_hyperlink(self): + +self.ui_test.create_doc_in_start_center("writer") +xMainWindow = self.xUITest.getTopFocusWindow() + +self.ui_test.execute_dialog_through_command(".uno:HyperlinkDialog") +xDialog = self.xUITest.getTopFocusWindow() + +# insert link +xtab=xDialog.getChild("tabcontrol") +xtab.executeAction("SELECT", mkPropertyValues({"POS": "0"})) + +xtarget = xDialog.getChild("target") +xtarget.executeAction("TYPE", mkPropertyValues({"TEXT": "http://www.libreoffice.org/"})) +self.assertEqual(get_state_as_dict(xtarget)["Text"], "http://www.libreoffice.org/";) + +xindication = xDialog.getChild("indication") +xindication.executeAction("TYPE", mkPropertyValues({"TEXT": "link"})) +self.assertEqual(get_state_as_dict(xindication)["Text"], "link") + +xok = xDialog.getChild("ok") +self.ui_test.close_dialog_through_button(xok) + +# Check that the link is added +xMainWindow = self.xUITest.getTopFocusWindow() +xedit = xMainWindow.getChild("writer_edit") +xedit.executeAction("SELECT", mkPropertyValues({"END_POS": "0", "START_POS": "4"})) +self.assertEqual(get_state_as_dict(xedit)["SelectedText"], "link") + +self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/qa
sw/qa/uitest/writer_tests2/formatBulletsNumbering.py | 81 +++ 1 file changed, 81 insertions(+) New commits: commit 29d3978de0687770bd223b639a77a6dd305e765d Author: Ahmed ElShreif AuthorDate: Sun Jun 28 01:41:04 2020 +0200 Commit: Ahmed ElShreif CommitDate: Fri Jul 3 11:49:35 2020 +0200 uitest : Add demo for SvxNumValueSet support The demo is just a test case added to BulletsAndNumbering Dialog test cases . The BulletsAndNumbering Dialog has 4 SvxNumValueSet so The test case works with each one of them . We now have support for "Writer: Format-Bullets and numbering dialog- Selection" item . Change-Id: I3a0827991a5fd004489459feb7c49214c9e2b766 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97341 Tested-by: Jenkins Reviewed-by: Markus Mohrhard diff --git a/sw/qa/uitest/writer_tests2/formatBulletsNumbering.py b/sw/qa/uitest/writer_tests2/formatBulletsNumbering.py index 0d245b858174..f10f543af047 100644 --- a/sw/qa/uitest/writer_tests2/formatBulletsNumbering.py +++ b/sw/qa/uitest/writer_tests2/formatBulletsNumbering.py @@ -289,5 +289,86 @@ class formatBulletsNumbering(UITestCase): xcancbtn = xDialog.getChild("cancel") self.ui_test.close_dialog_through_button(xcancbtn) +self.ui_test.close_doc() + + def test_bullets_and_numbering_selection(self): +self.ui_test.create_doc_in_start_center("writer") +document = self.ui_test.get_component() +xWriterDoc = self.xUITest.getTopFocusWindow() + +# Test Bullet Page + self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog") +xDialog = self.xUITest.getTopFocusWindow() + +# Select the BulletPage's Selector +xTabs = xDialog.getChild("tabcontrol") +select_pos(xTabs, "0") +xBulletPage = xDialog.getChild("PickBulletPage") +xselector = xBulletPage.getChild("valueset") +self.assertEqual(get_state_as_dict(xselector)["ItemsCount"], "8") +# Select elemet num 3 +xselector.executeAction("CHOOSE", mkPropertyValues({"POS": "3"})) +self.assertEqual(get_state_as_dict(xselector)["SelectedItemPos"], "2") +self.assertEqual(get_state_as_dict(xselector)["SelectedItemId"], "3") +self.assertEqual(get_state_as_dict(xselector)["ItemText"], "Solid diamond bullets") +# Select elemet num 7 +xselector.executeAction("CHOOSE", mkPropertyValues({"POS": "7"})) +self.assertEqual(get_state_as_dict(xselector)["SelectedItemPos"], "6") +self.assertEqual(get_state_as_dict(xselector)["SelectedItemId"], "7") +self.assertEqual(get_state_as_dict(xselector)["ItemText"], "Cross mark bullets") + +xOKBtn = xDialog.getChild("ok") +self.ui_test.close_dialog_through_button(xOKBtn) + +# Test other Pages + self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog") +xDialog = self.xUITest.getTopFocusWindow() +# Select the NumberingPage's Selector +xTabs = xDialog.getChild("tabcontrol") +select_pos(xTabs, "1") +xNumberingPage = xDialog.getChild("PickNumberingPage") +xselector = xNumberingPage.getChild("valueset") +self.assertEqual(get_state_as_dict(xselector)["ItemsCount"], "8") +# Select elemet num 5 +xselector.executeAction("CHOOSE", mkPropertyValues({"POS": "5"})) +self.assertEqual(get_state_as_dict(xselector)["SelectedItemPos"], "4") +self.assertEqual(get_state_as_dict(xselector)["SelectedItemId"], "5") +self.assertEqual(get_state_as_dict(xselector)["ItemText"], "Uppercase letter A) B) C)") +# Select elemet num 8 +xselector.executeAction("CHOOSE", mkPropertyValues({"POS": "8"})) +self.assertEqual(get_state_as_dict(xselector)["SelectedItemPos"], "7") +self.assertEqual(get_state_as_dict(xselector)["SelectedItemId"], "8") +self.assertEqual(get_state_as_dict(xselector)["ItemText"], "Lowercase Roman number i. ii. iii.") + +# Select the OutlinePage's Selector +xTabs = xDialog.getChild("tabcontrol") +select_pos(xTabs, "2") +xOutlinePage = xDialog.getChild("PickOutlinePage") +xselector = xOutlinePage.getChild("valueset") +self.assertEqual(get_state_as_dict(xselector)["ItemsCount"], "8") +# Select elemet num 1 +xselector.executeAction("CHOOSE", mkPropertyValues({"POS": "1"})) +self.assertEqual(get_state_as_dict(xselector)["SelectedItemPos"], "0") +self.assertEqual(get_state_as_dict(xselector)["SelectedItemId"], "1") +self.assertEqual(get_state_as_dict(xselector)["ItemText"], "Numeric, numeric, lowercase letters, solid small circular bullet") + +# Select the GraphicPage's Selector +xTabs = xDialog.getChild("tabcontrol") +select_pos(xTabs, "3") +xGraphicPage = xDialog.getChild("PickGraphicPage") +xselecto
[Libreoffice-commits] core.git: uitest/ui_logger_dsl
uitest/ui_logger_dsl/UI_Object_commands.tx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 287adbce9a6e5d045a1d6873ac312370630a922d Author: Ahmed ElShreif AuthorDate: Thu Jul 2 07:11:26 2020 +0200 Commit: Ahmed ElShreif CommitDate: Fri Jul 3 11:46:38 2020 +0200 uitest: Fix small issue in UI Logger DSL grammar "EditUIObject" Change-Id: I5ce8f14f4075e6d2f79b3c20ce1686b644f87d27 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97691 Tested-by: Jenkins Reviewed-by: Ahmed ElShreif diff --git a/uitest/ui_logger_dsl/UI_Object_commands.tx b/uitest/ui_logger_dsl/UI_Object_commands.tx index 0f766d87a4dc..2d3724f2d11e 100644 --- a/uitest/ui_logger_dsl/UI_Object_commands.tx +++ b/uitest/ui_logger_dsl/UI_Object_commands.tx @@ -52,7 +52,7 @@ Type_action: ; SELECT: 'Select in ' edit_button=STRING - '{"FROM": "' from_pos=INT '" , "TO" : "'to_pos=INT '"}' + '{' + '"FROM"' + ':' + '"' from_pos=INT '"' + ',' + '"TO"' + ':' + '"' to_pos=INT '"'+'}' ; Clear: 'Clear' edit_button=STRING ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sc/qa sc/source
sc/qa/uitest/calc_tests/CellDropDownItems.py | 88 +++ sc/source/ui/uitest/uiobject.cxx | 22 ++ 2 files changed, 108 insertions(+), 2 deletions(-) New commits: commit 058f4f3c3d7204421c3e947b845a84eb8bf54675 Author: Ahmed ElShreif AuthorDate: Fri Jun 19 04:17:08 2020 +0200 Commit: Ahmed ElShreif CommitDate: Sun Jun 21 22:17:10 2020 +0200 uitest : Add support for Dropdown items in grid window This patch add support for test cases that test Dropdown list of cells in Calc that can be created using: Data -> Validity -> List. You can select items from the list by it's id or it's text . This may help in tdf#133855 . Change-Id: I830149fd5520df72f07540fd4eebd3f3bad48616 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96670 Tested-by: Jenkins Reviewed-by: Markus Mohrhard diff --git a/sc/qa/uitest/calc_tests/CellDropDownItems.py b/sc/qa/uitest/calc_tests/CellDropDownItems.py new file mode 100644 index ..2843181eaaca --- /dev/null +++ b/sc/qa/uitest/calc_tests/CellDropDownItems.py @@ -0,0 +1,88 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +from uitest.framework import UITestCase +from uitest.uihelper.common import get_state_as_dict +from uitest.uihelper.common import select_pos +from libreoffice.calc.document import get_cell_by_position +from libreoffice.uno.propertyvalue import mkPropertyValues + +class CellDropDownItems(UITestCase): + +def test_dropdownitems(self): + +#This is to test Dropdown items in grid window +calc_doc = self.ui_test.create_doc_in_start_center("calc") +xCalcDoc = self.xUITest.getTopFocusWindow() +gridwin = xCalcDoc.getChild("grid_window") +document = self.ui_test.get_component() + +#select cell C10 +gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C10"})) + +#Open Validation Dialog +self.ui_test.execute_dialog_through_command(".uno:Validation") +xDialog = self.xUITest.getTopFocusWindow() + +#Select List option +xallow = xDialog.getChild("allow") +xallow.executeAction("SELECT", mkPropertyValues({"POS": "6"})) + +#Add items to the List +xminlist = xDialog.getChild("minlist") +xminlist.executeAction("TYPE", mkPropertyValues({"TEXT": "Item1"})) +xminlist.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"})) +xminlist.executeAction("TYPE", mkPropertyValues({"TEXT": "Item2"})) +xminlist.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"})) +xminlist.executeAction("TYPE", mkPropertyValues({"TEXT": "Item3"})) +xminlist.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"})) +xminlist.executeAction("TYPE", mkPropertyValues({"TEXT": "Item4"})) +xminlist.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"})) +xminlist.executeAction("TYPE", mkPropertyValues({"TEXT": "Item5"})) + +#Close the dialog +xOk = xDialog.getChild("ok") +self.ui_test.close_dialog_through_button(xOk) + +#Launch the Select Menu to view the list ans select first item in the list +gridwin = xCalcDoc.getChild("grid_window") +gridwin.executeAction("LAUNCH", mkPropertyValues({"SELECTMENU": "", "COL": "2", "ROW": "9"})) + +#Select the TreeList UI Object +xWin = self.xUITest.getTopFocusWindow() +xlist = xWin.getChild("list") + +xListItem = xlist.getChild('0') +xListItem.executeAction("DOUBLECLICK" , mkPropertyValues({}) ) +self.assertEqual(get_cell_by_position(document, 0, 2, 9).getString(), "Item1") + +#Launch the Select Menu to view the list ans select Third item in the list +gridwin = xCalcDoc.getChild("grid_window") +gridwin.executeAction("LAUNCH", mkPropertyValues({"SELECTMENU": "", "COL": "2", "ROW": "9"})) + +#Select the TreeList UI Object +xWin = self.xUITest.getTopFocusWindow() +xlist = xWin.getChild("list") + +xListItem = xlist.getChild('2') +xListItem.executeAction("DOUBLECLICK" , mkPropertyValues({}) ) +self.assertEqual(get_cell_by_position(document, 0, 2, 9).getString(), "Item3") + +#Launch the Select Menu to view the list ans select Fifth item in the list +gridwin = xCalcDoc.getChild("grid_window") +gridwin.executeAction("LAUNCH", mkPropertyValues({"SELECTMENU": "", "COL": "2", "ROW": "9"})) + +#Select the TreeList UI Object +xWin = self.xUITest.getTopFocusWindow() +xlist = xWin.getChild("list") + +xListItem = xlist.getChild('4') +xListItem.executeAction("DOUBLECLICK" , mkPropertyValues({}) ) +
[Libreoffice-commits] core.git: uitest/ui_logger_dsl vcl/source
uitest/ui_logger_dsl/General_commands.tx |4 ++-- uitest/ui_logger_dsl/Special_commands.tx | 26 +- uitest/ui_logger_dsl/UI_Object_commands.tx|4 ++-- uitest/ui_logger_dsl/dsl_core.py | 16 uitest/ui_logger_dsl/starter_commands.tx |4 ++-- uitest/ui_logger_dsl/ui_logger_dsl_grammar.tx |4 ++-- uitest/ui_logger_dsl/uno_commands.tx |4 ++-- vcl/source/uitest/logger.cxx |4 ++-- 8 files changed, 33 insertions(+), 33 deletions(-) New commits: commit 01af2d7122e8de8cbf96d1a04eb88817276db410 Author: Ahmed ElShreif AuthorDate: Tue Aug 20 22:37:17 2019 -0500 Commit: Ahmed ElShreif CommitDate: Tue Aug 20 22:37:17 2019 -0500 uitest: Fix typos Change-Id: I41023dd1fd06ca48849726d3372f74a4990c27a3 diff --git a/uitest/ui_logger_dsl/General_commands.tx b/uitest/ui_logger_dsl/General_commands.tx index aa3645112569..5f5c404402f5 100644 --- a/uitest/ui_logger_dsl/General_commands.tx +++ b/uitest/ui_logger_dsl/General_commands.tx @@ -1,6 +1,6 @@ /* -This file for the log statments that is general for all application -we can use it as general commands then relate it to its application +This file for the log statements that is general for all application +we can use it as general commands then relate it to its application as we have in the starter command // also I make set zoom to be general as it will be better diff --git a/uitest/ui_logger_dsl/Special_commands.tx b/uitest/ui_logger_dsl/Special_commands.tx index a4bf1a697504..1667eace0ef3 100644 --- a/uitest/ui_logger_dsl/Special_commands.tx +++ b/uitest/ui_logger_dsl/Special_commands.tx @@ -1,7 +1,7 @@ import type_options /* -This file for the log statments that relates to each diffrent applications +This file for the log statements that relates to each different applications Each Grammar Command here is related to his own application */ @@ -10,8 +10,8 @@ SpecialCommand: ; /* - This part for all the writer log statments: - + This part for all the writer log statements: + 1) Type 2) Select 3) GOTO page @@ -55,7 +55,7 @@ writer_Insert_BreakPage: //=// /* - This part for all the calc log statments: + This part for all the calc log statements: 1) select sheet 2) Select cell or range @@ -87,7 +87,7 @@ calc_Select_cell: 'Select from calc' select_op=select_options ; calc_AutoFill_filter: - 'Lanuch AutoFilter from Col' col_num=INT 'and Row' row_num=INT + 'Launch AutoFilter from Col' col_num=INT 'and Row' row_num=INT ; range_of_cells: '{' '"RANGE":' input_range=STRING '}' @@ -132,9 +132,9 @@ select_options: //=// /* - This part for all the impress log statments: - -1) Type + This part for all the impress log statements: + +1) Type 2) Insert New Slide 3) Delete Slide 4) Duplicate Slide @@ -163,9 +163,9 @@ impress_Rename_Slide: ; //=// /* - This part for all the math log statments: - -1) element selector + This part for all the math log statements: + +1) element selector 2) Type then we can add whatever we need in the future @@ -182,8 +182,8 @@ math_Type_command: //=// /* - This part for all the draw log statments: - + This part for all the draw log statements: + 1) Type 2) Insert New Page 3) Delete Page diff --git a/uitest/ui_logger_dsl/UI_Object_commands.tx b/uitest/ui_logger_dsl/UI_Object_commands.tx index 9b25e09c6efc..58697a0fe216 100644 --- a/uitest/ui_logger_dsl/UI_Object_commands.tx +++ b/uitest/ui_logger_dsl/UI_Object_commands.tx @@ -37,13 +37,13 @@ EditUIObject: action=action_on_UIObject ('from' parent_id=ID)? ; SpinFieldUIObject: - change=increase_or_ecrease Spin_id=STRING ('from' parent_id=ID)? + change=increase_or_ecrease Spin_id=STRING ('from' parent_id=ID)? ; ListBoxUIObject: 'Select element with position ' POS=INT 'in' list_id=STRING ('from' parent_id=ID)? ; //= -//hellper grammer for EditUIObject +//hellper grammar for EditUIObject action_on_UIObject: Type_action | SELECT | Clear ; diff --git a/uitest/ui_logger_dsl/dsl_core.py b/uitest/ui_logger_dsl/dsl_core.py index d0e563f99fa6..074e4b871467 100644 --- a/uitest/ui_logger_dsl/dsl_core.py +++ b/uitest/ui_logger_dsl/dsl_core.py @@ -103,7 +103,7 @@ class ul_Compiler: "EditUIObject": self.handle_Edit_uiObject, "writer_Type_command": self.handle_writer_type, "writer_Select_command": self.handle_writer_select, -"writer_GOTO_comm
[Libreoffice-commits] core.git: uitest/ui_logger_dsl
uitest/ui_logger_dsl/dsl_core.py | 880 +-- 1 file changed, 570 insertions(+), 310 deletions(-) New commits: commit 471b185b8b1ce3982271bbb77261fbb5e6860d17 Author: Ahmed ElShreif AuthorDate: Mon Aug 19 13:09:38 2019 -0500 Commit: Ahmed ElShreif CommitDate: Mon Aug 19 13:09:38 2019 -0500 uitest: Reformat the python script of the Compiler Change-Id: I502aa9e998d084a82e738c0c0c68ad634cb5c76a diff --git a/uitest/ui_logger_dsl/dsl_core.py b/uitest/ui_logger_dsl/dsl_core.py index 210713b4478b..d0e563f99fa6 100644 --- a/uitest/ui_logger_dsl/dsl_core.py +++ b/uitest/ui_logger_dsl/dsl_core.py @@ -10,572 +10,832 @@ import os import sys import argparse import keyword + try: from textx.metamodel import metamodel_from_file except ImportError: print("textx is a required package.") -print("Please install the package for example with \"pip3 install --user textx\"") +print('Please install the package for example with "pip3 install --user textx"') sys.exit(1) -tab="" -double_tab="" +tab = "" +double_tab = "" + def parse_args(): """ This function parses the command-line arguments to get the input and output file details """ -parser = argparse.ArgumentParser(description = "Generate a UI test file from log") -parser.add_argument("input_address", type = str, help = "The log file address") -parser.add_argument("output_address", type = str, help = "The test file address") +parser = argparse.ArgumentParser(description="Generate a UI test file from log") +parser.add_argument("input_address", type=str, help="The log file address") +parser.add_argument("output_address", type=str, help="The test file address") args = parser.parse_args() return args + class ul_Compiler: -prev_command="" -variables=[] +prev_command = "" +variables = [] objects = dict() -current_app="" -parent_hierarchy_count=0 -last_parent=[] -flag_for_QuerySaveDialog=False +current_app = "" +parent_hierarchy_count = 0 +last_parent = [] +flag_for_QuerySaveDialog = False -def __init__(self , input_address , output_address): -self.ui_dsl_mm = metamodel_from_file('ui_logger_dsl_grammar.tx') -self.output_stream=self.initiate_test_generation(output_address) -self.input_address=input_address +def __init__(self, input_address, output_address): +self.ui_dsl_mm = metamodel_from_file("ui_logger_dsl_grammar.tx") +self.output_stream = self.initiate_test_generation(output_address) +self.input_address = input_address -def get_log_file(self , input_address): +def get_log_file(self, input_address): try: # load the program content = self.ui_dsl_mm.model_from_file(input_address) except IOError as err: print("IO error: {0}".format(err)) -print("Use " + os.path.basename(sys.argv[0]) + " -h to get usage instructions") +print( +"Use " + os.path.basename(sys.argv[0]) + " -h to get usage instructions" +) sys.exit(1) return content -def initiate_test_generation(self,output_address): +def initiate_test_generation(self, output_address): self.last_parent.append("MainWindow") try: -f = open(output_address,"w") +f = open(output_address, "w") except IOError as err: print("IO error: {0}".format(err)) -print("Use " + os.path.basename(sys.argv[0]) + " -h to get usage instructions") +print( +"Use " + os.path.basename(sys.argv[0]) + " -h to get usage instructions" +) sys.exit(1) -line="# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-\n\n" + \ -"from uitest.framework import UITestCase\n" + \ -"from libreoffice.uno.propertyvalue import mkPropertyValues\n" + \ -"import importlib\n\n" + \ -"class TestClass(UITestCase):\n" + \ -tab+"def test_function(self):\n" +line = ( +"# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-\n\n" ++ "from uitest.framework import UITestCase\n" ++ "from libreoffice.uno.propertyvalue import mkPropertyValues\n" ++ "import importlib\n\n" ++ "class TestClass(UITestCase):\n" ++ tab ++ "def test_function(self):\n" +) self.variables.append(line) return f def compile(self): -self.ui_dsl_mm.register_obj_processors({ -'UNOCommand': self.handle_uno, -'StarterCommand': self.handle_start, -'CloseDialog': self.handle_Dialog, -'OpenModelessDialog': self.handle_Dialog, -'OpenModalDialog':self.handle_Dialog, -'ButtonUIObject':self.handle_b
[Libreoffice-commits] core.git: Branch 'private/EL-SHREIF/ui_logger' - uitest/ui_logger_dsl
uitest/ui_logger_dsl/dsl_core.py | 879 +-- 1 file changed, 569 insertions(+), 310 deletions(-) New commits: commit ef62c15cd3e55f4788e7c5baeda6f6625b0483ff Author: Ahmed ElShreif AuthorDate: Sun Aug 18 13:00:28 2019 -0500 Commit: Ahmed ElShreif CommitDate: Sun Aug 18 13:00:28 2019 -0500 uitest: Reformat the python script of the Compiler Change-Id: Ifd3139b4dce984831a0e2d1b428928be11c79bee diff --git a/uitest/ui_logger_dsl/dsl_core.py b/uitest/ui_logger_dsl/dsl_core.py index b77a3449aa6e..424e191333a9 100644 --- a/uitest/ui_logger_dsl/dsl_core.py +++ b/uitest/ui_logger_dsl/dsl_core.py @@ -12,565 +12,824 @@ import argparse import keyword from textx.metamodel import metamodel_from_file -tab="" -double_tab="" +tab = "" +double_tab = "" + def parse_args(): """ This function parses the command-line arguments to get the input and output file details """ -parser = argparse.ArgumentParser(description = "Generate a UI test file from log") -parser.add_argument("input_address", type = str, help = "The log file address") -parser.add_argument("output_address", type = str, help = "The test file address") +parser = argparse.ArgumentParser(description="Generate a UI test file from log") +parser.add_argument("input_address", type=str, help="The log file address") +parser.add_argument("output_address", type=str, help="The test file address") args = parser.parse_args() return args + class ul_Compiler: -prev_command="" -variables=[] +prev_command = "" +variables = [] objects = dict() -current_app="" -parent_hierarchy_count=0 -last_parent=[] -flag_for_QuerySaveDialog=False +current_app = "" +parent_hierarchy_count = 0 +last_parent = [] +flag_for_QuerySaveDialog = False -def __init__(self , input_address , output_address): -self.ui_dsl_mm = metamodel_from_file('ui_logger_dsl_grammar.tx') -self.output_stream=self.initiate_test_generation(output_address) -self.input_address=input_address +def __init__(self, input_address, output_address): +self.ui_dsl_mm = metamodel_from_file("ui_logger_dsl_grammar.tx") +self.output_stream = self.initiate_test_generation(output_address) +self.input_address = input_address -def get_log_file(self , input_address): +def get_log_file(self, input_address): try: # load the program content = self.ui_dsl_mm.model_from_file(input_address) except IOError as err: print("IO error: {0}".format(err)) -print("Use " + os.path.basename(sys.argv[0]) + " -h to get usage instructions") +print( +"Use " + os.path.basename(sys.argv[0]) + " -h to get usage instructions" +) sys.exit(1) return content -def initiate_test_generation(self,output_address): +def initiate_test_generation(self, output_address): self.last_parent.append("MainWindow") try: -f = open(output_address,"w") +f = open(output_address, "w") except IOError as err: print("IO error: {0}".format(err)) -print("Use " + os.path.basename(sys.argv[0]) + " -h to get usage instructions") +print( +"Use " + os.path.basename(sys.argv[0]) + " -h to get usage instructions" +) sys.exit(1) -line="# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-\n\n" + \ -"from uitest.framework import UITestCase\n" + \ -"from libreoffice.uno.propertyvalue import mkPropertyValues\n" + \ -"import importlib\n\n" + \ -"class TestClass(UITestCase):\n" + \ -tab+"def test_function(self):\n" +line = ( +"# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-\n\n" ++ "from uitest.framework import UITestCase\n" ++ "from libreoffice.uno.propertyvalue import mkPropertyValues\n" ++ "import importlib\n\n" ++ "class TestClass(UITestCase):\n" ++ tab ++ "def test_function(self):\n" +) self.variables.append(line) return f def compile(self): -self.ui_dsl_mm.register_obj_processors({ -'UNOCommand': self.handle_uno, -'StarterCommand': self.handle_start, -'CloseDialog': self.handle_Dialog, -'OpenModelessDialog': self.handle_Dialog, -'OpenModalDialog':self.handle_Dialog, -'ButtonUIObject':self.handle_button, -'CheckBoxUIObject':self.handle_check_box, -'TabControlUIObject':self.handle_tab, -'ComboBoxUIObject':self.handle_Combo_box, -'RadioButtonUIObject':self.handle_Radio_button, -'ListBoxUIObject':self.handle_List_box, -
[Libreoffice-commits] core.git: Branch 'private/EL-SHREIF/ui_logger' - sc/source sw/source vcl/source
sc/source/core/data/document.cxx |2 +- sc/source/ui/view/viewdata.cxx |2 +- sc/source/ui/view/viewfun2.cxx |2 +- sc/source/ui/view/viewfun3.cxx |2 +- sc/source/ui/view/viewfunc.cxx |2 +- sw/source/core/edit/edtab.cxx|2 +- sw/source/uibase/dochdl/swdtflvr.cxx |2 +- sw/source/uibase/wrtsh/wrtsh1.cxx|2 +- vcl/source/uitest/logger.cxx | 10 +- vcl/source/uitest/uiobject.cxx | 20 ++-- 10 files changed, 23 insertions(+), 23 deletions(-) New commits: commit fb4360cf8c18ab1c4d7e1631f7d5101342573739 Author: Ahmed ElShreif AuthorDate: Sun Aug 18 12:24:08 2019 -0500 Commit: Ahmed ElShreif CommitDate: Sun Aug 18 12:54:50 2019 -0500 uitest: Fix Jenkins errors while building Change-Id: I51b849d39d541ac5af372d969de8c5d39edefc0a diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index d0a6043c7565..26e44b2a1784 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -109,7 +109,7 @@ using ::std::set; namespace { -void collectUIInformation(const std::map& aParameters,const OUString action) +void collectUIInformation(const std::map& aParameters,const OUString& action) { EventDescription aDescription; aDescription.aID = "grid_window"; diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index d5b80a363cb9..9152d61b4a5e 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -97,7 +97,7 @@ void lcl_LOKRemoveWindow(ScTabViewShell* pTabViewShell, ScSplitPos eWhich) namespace { -void collectUIInformation(const std::map& aParameters,const OUString action) +void collectUIInformation(const std::map& aParameters,const OUString& action) { EventDescription aDescription; aDescription.aID = "grid_window"; diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index f01fbff2ccf6..eccd19f2b215 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -104,7 +104,7 @@ using ::editeng::SvxBorderLine; namespace { -void collectUIInformation(const std::map& aParameters,const OUString action) +void collectUIInformation(const std::map& aParameters,const OUString& action) { EventDescription aDescription; aDescription.aID = "grid_window"; diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx index d818f2389d60..0e3e8de2fba5 100644 --- a/sc/source/ui/view/viewfun3.cxx +++ b/sc/source/ui/view/viewfun3.cxx @@ -80,7 +80,7 @@ using namespace com::sun::star; namespace { -void collectUIInformation(const std::map& aParameters,OUString action) +void collectUIInformation(const std::map& aParameters,OUString& action) { EventDescription aDescription; aDescription.aID = "grid_window"; diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index b664263aafdc..83cc4bc4f618 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -112,7 +112,7 @@ ScViewFunc::~ScViewFunc() namespace { -void collectUIInformation(const std::map& aParameters,const OUString action) +void collectUIInformation(const std::map& aParameters,const OUString& action) { EventDescription aDescription; aDescription.aID = "grid_window"; diff --git a/sw/source/core/edit/edtab.cxx b/sw/source/core/edit/edtab.cxx index 905b426f3d26..b4dfa6ce4bff 100644 --- a/sw/source/core/edit/edtab.cxx +++ b/sw/source/core/edit/edtab.cxx @@ -55,7 +55,7 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; namespace { -void collectUIInformation(const OUString action,const OUString aParameters) +void collectUIInformation(const OUString& action,const OUString& aParameters) { EventDescription aDescription; aDescription.aAction = action; diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index e97ca1523eff..abe92248c1d7 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -164,7 +164,7 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::datatransfer; namespace { -void collectUIInformation(const OUString action,const OUString aParameters) +void collectUIInformation(const OUString& action,const OUString& aParameters) { EventDescription aDescription; aDescription.aAction = action; diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx index b4e836b6dc35..42241f4c8b01 100644 --- a/sw/source/uibase/wrtsh/wrtsh1.cxx +++ b/sw/source/uibase/wrtsh/wrtsh1.cxx @@ -121,7 +121,7 @@ using namespace sw::mark; using namespace com::sun::star; namespace { -void collectUIInformation(const OUString action,const OUString aParameters) +void collectUIInformation(const OUString& action,const OUString& aParameters) { EventDescription aDescription; aDescription.aAction = action; d
[Libreoffice-commits] core.git: Changes to 'feature/gsoc-uitest-2019'
New branch 'feature/gsoc-uitest-2019' available with the following commits: commit d4183e69c9988ce83f19b67972d0535a654a Author: Ahmed ElShreif Date: Sat Aug 17 21:37:21 2019 -0500 uitest: add the SideBar implementation Change-Id: I7de9bd97e868624476b5c39a5e37afc945206e4e commit fe39679b306129c2f3c06f27790146ecc30770a5 Author: Ahmed ElShreif Date: Fri Aug 16 21:56:42 2019 -0500 uitest: ignore the logging part of the QuerySaveDialog while closing the app Change-Id: I18fcc81fa54362dfaa574ec04125e66b37a5aad8 commit 1944bf8fb8e97a3c1b98a0bb71a9a7fe70579f54 Author: Ahmed ElShreif Date: Thu Aug 15 22:48:14 2019 -0500 uitest: use prefix for names that has conflict with python's keywords Change-Id: I01d044a96eeae60a070a5ca0fc8d6105d7333414 commit abce92813f2db94feb41c3d0f12ae7ad205eec6a Author: Ahmed ElShreif Date: Thu Aug 15 12:24:09 2019 -0500 uitest: replace tabs with spaces Change-Id: I40779dfdb65037838e1a1b7bed5d89a656047ce6 commit fe2237fb94f5f4f196f1efa157febd10221bfd7b Author: Ahmed ElShreif Date: Tue Aug 13 12:23:06 2019 -0500 uitest: add footer line support Change-Id: I740995d811be030f406f9d3ff53c56d28af2b786 commit 6c0dee555491f9624596c8c2ddd9463a9777d9be Author: Ahmed ElShreif Date: Fri Aug 9 23:23:11 2019 -0500 uitest: solve problem with un-named parents 1) Add recursively query for the parent until find an parent with a name. 2) Remove the parent part "from xx" from the log statment if there is un-named parent 3) Update the compiler to use the most top parent if there is command with no un-named parent Change-Id: Id7dd5092bc995312494b5536720141908e73af9a commit d3019d6d732e3072b0a71da05973107fc8cb5ae1 Author: Ahmed ElShreif Date: Sun Aug 4 13:42:09 2019 -0500 uitest: log more events in Calc: 1) Rename Tab 2) Insert Tab Change-Id: I7a653a4b274c0c8058672c5b0aa1645bb5a51e3a commit d340256bb2ac95367c68aad947a94f17a4796528 Author: Ahmed ElShreif Date: Sat Aug 3 11:51:11 2019 -0500 uitest: log more events Impress: 1) Delete Slide 2) Duplicate Slide 3) Rename Slide Draw: 1) Delte Page 2) Rename Page Change-Id: I124bdf96c58dfe00bdb039c5e93afc0dc6e7163d commit c37f0153c76f280ea893a9c9cf19cd491b81092e Author: Ahmed ElShreif Date: Fri Aug 2 22:16:31 2019 -0500 uitest: add more events to ui logger for Impress: add new Slide for Draw: add new Page Modify the UILogger System to save information about the name of the app Change-Id: I87fd98b2a11783e3410f1c0eba633631addf389b commit 5c638b0dd26d4dcd766b55bb8b7bccfd8b598566 Author: Ahmed ElShreif Date: Mon Jul 29 00:29:24 2019 -0500 uitest: start logging draw events Change-Id: I1b77b106db181a8cadc1ff0b2a5de6ad19fe6762 commit a41834c71a0a6f10c0b4beb879cce903ec63f01f Author: Ahmed ElShreif Date: Sun Jul 28 23:07:25 2019 -0500 uitest: update UI logger grammar 1) Make small changes in the UI logger Grammar 2) Add Comments to be more documented Change-Id: I5e68c33375870cf4a1f2537ee1a7eb997145f24f commit 0b64657a1c8149e89eea8ad8ed46818e6675bbb4 Author: Ahmed ElShreif Date: Thu Jul 18 13:53:08 2019 -0500 uitest: log more events for Calc: 1) Delete some Cells 2) Remove content from some cells 3) Insert Cells 4) Cut Cells 5) Copy Cells 6) Paste Cells 7) Merge Cells 8) Split Cell ( Delete Merge ) for Writer: 1) Insert Table 2) Copy Text 3) Cut Text 4) Paste Text 5) Inser Break Page Also, Solve some bugs in the UI logger and UNO Commands. Change-Id: Ic7cacbc20e1e400900a9760b61e8b45ae96c84ff commit dcceafbda6b998e4e9d4443f109b56e856290ca7 Author: Ahmed ElShreif Date: Thu Jul 18 12:25:05 2019 -0500 uitest: solve some bugs in the ui logger Change-Id: I39836423fad8cb361a8f007f648108618906be8a commit e6257cb6d6491c950095e52e60066d858569727b Author: Ahmed ElShreif Date: Sat Jul 13 15:09:25 2019 +0200 uitest: add general functions to remove redundunt lines 1) init_app 2) init_Object 3) write_line_without_parameters 4) write_line_with_one_parameters Then Rewrite the handlers again Change-Id: I8ceb01f4eaa48f1544ada8966c7585dcbd3e15aa commit fc32bf8919f28e5f9f82c94eeca604b5ba93397d Author: Ahmed ElShreif Date: Sat Jul 13 14:39:17 2019 +0200 uitest: add more DSL commands 1) Calc (calc_Type_command - calc_switch_sheet - calc_Select_cell - calc_AutoFill_filter) 2) impress (impress_Type_command) 3) math (math_element_selector - math_Type_command) 4) General Commands Compiler: (setZoom_command) Change-Id: Ifd2608c38474633b579a216356fe53c859c24975 commit a2145a52098882bc095761d7dbc50aec4d47662c Author: Ahmed ElShreif Date: Sun Jul 7 00:5
[Libreoffice-commits] core.git: Branch 'private/EL-SHREIF/ui_logger' - uitest/ui_logger_dsl
uitest/ui_logger_dsl/dsl_core.py | 10 ++ 1 file changed, 10 insertions(+) New commits: commit 671858c12e2eee7deacb2b7503ee7400e0f0bf5f Author: Ahmed ElShreif AuthorDate: Sat Aug 17 21:37:21 2019 -0500 Commit: Ahmed ElShreif CommitDate: Sat Aug 17 21:37:21 2019 -0500 Fix some Logger issues: add the SideBar implementation Change-Id: I7de9bd97e868624476b5c39a5e37afc945206e4e diff --git a/uitest/ui_logger_dsl/dsl_core.py b/uitest/ui_logger_dsl/dsl_core.py index 088fcf4a0d64..b77a3449aa6e 100644 --- a/uitest/ui_logger_dsl/dsl_core.py +++ b/uitest/ui_logger_dsl/dsl_core.py @@ -97,6 +97,7 @@ class ul_Compiler: 'math_Type_command':self.handle_math_Type_command, 'setZoom_command':self.handle_setZoom_command, 'draw_Type_command':self.handle_draw_Type_command, +'SideBar':self.handle_SideBar, 'writer_Copy_Text':self.do_nothing, 'writer_Cut_Text':self.do_nothing, @@ -188,6 +189,15 @@ class ul_Compiler: self.current_app=app[StarterCommand.program_name] self.prev_command=StarterCommand +def handle_SideBar(self , SideBar): + +line="self.xUITest.executeCommand(\".uno:Sidebar\")\n" +self.variables.append(line) + + self.write_line_with_one_parameters("MainWindow","SIDEBAR","PANEL",SideBar.name) + +self.prev_command=SideBar + def handle_Dialog(self, DialogCommand): if (DialogCommand.__class__.__name__ == "OpenModalDialog"): ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'private/EL-SHREIF/ui_logger' - uitest/ui_logger_dsl
uitest/ui_logger_dsl/dsl_core.py | 88 +++ 1 file changed, 52 insertions(+), 36 deletions(-) New commits: commit 25fbad996379ca0b73a95268253828d73d2be6f9 Author: Ahmed ElShreif AuthorDate: Fri Aug 16 21:56:42 2019 -0500 Commit: Ahmed ElShreif CommitDate: Fri Aug 16 22:33:41 2019 -0500 Fix some Logger issues: Ignore the logging part of the QuerySaveDialog while closing the app Change-Id: I18fcc81fa54362dfaa574ec04125e66b37a5aad8 diff --git a/uitest/ui_logger_dsl/dsl_core.py b/uitest/ui_logger_dsl/dsl_core.py index b8e0b9b7269c..088fcf4a0d64 100644 --- a/uitest/ui_logger_dsl/dsl_core.py +++ b/uitest/ui_logger_dsl/dsl_core.py @@ -33,6 +33,7 @@ class ul_Compiler: current_app="" parent_hierarchy_count=0 last_parent=[] +flag_for_QuerySaveDialog=False def __init__(self , input_address , output_address): self.ui_dsl_mm = metamodel_from_file('ui_logger_dsl_grammar.tx') @@ -190,21 +191,27 @@ class ul_Compiler: def handle_Dialog(self, DialogCommand): if (DialogCommand.__class__.__name__ == "OpenModalDialog"): -old_line = self.variables.pop() -if (self.prev_command.__class__.__name__ == "UNOCommand"): -key_word=self.prev_command.uno_command_name[-6:] -else: -key_word=old_line[-9:-3] +if( DialogCommand.dialog_name != "QuerySaveDialog" ): +# This part is just to ignore saving the Save dialog while closing the app -if ( key_word == "Dialog"): -old_line= double_tab + "self.ui_test.execute_dialog_through_command(\""+\ -self.prev_command.uno_command_name+"\")\n" -self.variables.append(old_line) -line = double_tab + DialogCommand.dialog_name + " = self.xUITest.getTopFocusWindow()\n" -self.variables.append(line) -self.last_parent.append(DialogCommand.dialog_name) -self.parent_hierarchy_count=self.parent_hierarchy_count+1 +old_line = self.variables.pop() +if (self.prev_command.__class__.__name__ == "UNOCommand"): +key_word=self.prev_command.uno_command_name[-6:] +else: +key_word=old_line[-9:-3] + +if ( key_word == "Dialog"): +old_line= double_tab + "self.ui_test.execute_dialog_through_command(\""+\ +self.prev_command.uno_command_name+"\")\n" +self.variables.append(old_line) +line = double_tab + DialogCommand.dialog_name + " = self.xUITest.getTopFocusWindow()\n" +self.variables.append(line) +self.last_parent.append(DialogCommand.dialog_name) +self.parent_hierarchy_count=self.parent_hierarchy_count+1 + +else: +self.flag_for_QuerySaveDialog=True elif (DialogCommand.__class__.__name__ == "OpenModelessDialog"): old_line = self.variables.pop() @@ -223,37 +230,46 @@ class ul_Compiler: self.parent_hierarchy_count=self.parent_hierarchy_count+1 elif (DialogCommand.__class__.__name__ == "CloseDialog"): -if (self.prev_command.__class__.__name__ == "ButtonUIObject"): -old_line = self.variables.pop() -line="" -if(keyword.iskeyword( self.prev_command.ui_button )): -line= double_tab + "self.ui_test.close_dialog_through_button(x"+\ -self.prev_command.ui_button+")\n" -else: -line= double_tab + "self.ui_test.close_dialog_through_button("+\ -self.prev_command.ui_button+")\n" -self.variables.append(line) -self.last_parent.pop() -self.parent_hierarchy_count=self.parent_hierarchy_count-1 + +if( not ( self.flag_for_QuerySaveDialog ) ): +# This part is just to ignore saving the Save dialog while closing the app + +if (self.prev_command.__class__.__name__ == "ButtonUIObject"): +old_line = self.variables.pop() +line="" +if(keyword.iskeyword( self.prev_command.ui_button )): +line= double_tab + "self.ui_test.close_dialog_through_button(x"+\ +self.prev_command.ui_button+")\n" +else: +line= double_tab + "self.ui_test.close_dialog_through_button("+\ +self.prev_command.ui_button+")\n" +self.variables.append(line) +self.last_parent.pop() +self.parent_hierarchy_count=self.parent_hierarchy_count-1 +else: +self.flag_for_QuerySaveDialog=False self.prev_command=DialogCommand def handle_button(self, ButtonUIObje
[Libreoffice-commits] core.git: Branch 'private/EL-SHREIF/ui_logger' - uitest/ui_logger_dsl
uitest/ui_logger_dsl/dsl_core.py | 118 --- 1 file changed, 86 insertions(+), 32 deletions(-) New commits: commit e45c9cf958dea4074b9e7544067a8242ea0cf27e Author: Ahmed ElShreif AuthorDate: Thu Aug 15 22:48:14 2019 -0500 Commit: Ahmed ElShreif CommitDate: Thu Aug 15 22:48:14 2019 -0500 Fix some Logger issues: Use prefix for names that has conflict with python's words Change-Id: I01d044a96eeae60a070a5ca0fc8d6105d7333414 diff --git a/uitest/ui_logger_dsl/dsl_core.py b/uitest/ui_logger_dsl/dsl_core.py index 5d2a7e93ba82..b8e0b9b7269c 100644 --- a/uitest/ui_logger_dsl/dsl_core.py +++ b/uitest/ui_logger_dsl/dsl_core.py @@ -9,6 +9,7 @@ import os import sys import argparse +import keyword from textx.metamodel import metamodel_from_file tab="" @@ -129,14 +130,14 @@ class ul_Compiler: line=double_tab+self.current_app+" = MainWindow.getChild(\""+self.current_app+"\")\n" self.variables.append(line) -def init_Object(self,Id_of_Object,Obj_parent): +def init_Object(self,Id_of_Object,name_of_child,Obj_parent): if Id_of_Object in self.objects: self.objects[Id_of_Object]+=1 else: self.objects[Id_of_Object]=1 line=double_tab+Id_of_Object+" = "+Obj_parent+\ -".getChild(\""+Id_of_Object+"\")\n" +".getChild(\""+name_of_child+"\")\n" self.variables.append(line) def write_line_without_parameters(self,Action_holder,Action,Action_type): @@ -224,8 +225,13 @@ class ul_Compiler: elif (DialogCommand.__class__.__name__ == "CloseDialog"): if (self.prev_command.__class__.__name__ == "ButtonUIObject"): old_line = self.variables.pop() -line= double_tab + "self.ui_test.close_dialog_through_button("+\ -self.prev_command.ui_button+")\n" +line="" +if(keyword.iskeyword( self.prev_command.ui_button )): +line= double_tab + "self.ui_test.close_dialog_through_button(x"+\ +self.prev_command.ui_button+")\n" +else: +line= double_tab + "self.ui_test.close_dialog_through_button("+\ +self.prev_command.ui_button+")\n" self.variables.append(line) self.last_parent.pop() self.parent_hierarchy_count=self.parent_hierarchy_count-1 @@ -234,109 +240,157 @@ class ul_Compiler: def handle_button(self, ButtonUIObject): +name_of_obj="" +if(keyword.iskeyword( ButtonUIObject.ui_button )): +name_of_obj = "x" +ButtonUIObject.ui_button +else: +name_of_obj = ButtonUIObject.ui_button + if ButtonUIObject.parent_id == "" : -self.init_Object( ButtonUIObject.ui_button , self.last_parent[self.parent_hierarchy_count] ) +self.init_Object( name_of_obj , ButtonUIObject.ui_button , self.last_parent[self.parent_hierarchy_count] ) else: -self.init_Object(ButtonUIObject.ui_button,ButtonUIObject.parent_id) +self.init_Object( name_of_obj , ButtonUIObject.ui_button,ButtonUIObject.parent_id) - self.write_line_without_parameters(ButtonUIObject.ui_button,"CLICK","tuple") +self.write_line_without_parameters(name_of_obj,"CLICK","tuple") self.prev_command=ButtonUIObject def handle_check_box(self, CheckBoxUIObject): +name_of_obj="" +if(keyword.iskeyword( CheckBoxUIObject.Check_box_id )): +name_of_obj = "x" + CheckBoxUIObject.Check_box_id +else: +name_of_obj = CheckBoxUIObject.Check_box_id + if CheckBoxUIObject.parent_id == "" : -self.init_Object( CheckBoxUIObject.Check_box_id , self.last_parent[self.parent_hierarchy_count] ) +self.init_Object( name_of_obj , CheckBoxUIObject.Check_box_id , self.last_parent[self.parent_hierarchy_count] ) else: - self.init_Object(CheckBoxUIObject.Check_box_id,CheckBoxUIObject.parent_id) +self.init_Object( name_of_obj , CheckBoxUIObject.Check_box_id,CheckBoxUIObject.parent_id) - self.write_line_without_parameters(CheckBoxUIObject.Check_box_id,"CLICK","tuple") +self.write_line_without_parameters(name_of_obj,"CLICK","tuple") self.prev_command=CheckBoxUIObject def handle_tab(self, TabControlUIObject): +name_of_obj="" +if(keyword.iskeyword( TabControlUIObject.tab_id )): +name_of_obj = "x" + TabControlUIObject.tab_id +else: +name_of_obj = TabControlUIObject.tab_id + if TabControlUIObject.parent_id == "" : -self.init_Object( TabControlUIObject.tab_id , self.last_parent[self.parent_hierarchy_count] ) +self.init_Object( name_of_obj , TabControlUIObject.tab_id , self.last_parent[self.parent_hierarchy
[Libreoffice-commits] core.git: Branch 'private/EL-SHREIF/ui_logger' - uitest/ui_logger_dsl
uitest/ui_logger_dsl/dsl_core.py | 39 +-- 1 file changed, 21 insertions(+), 18 deletions(-) New commits: commit 2d3dd958b58876d63781855ad69459fa52fac0bf Author: Ahmed ElShreif AuthorDate: Thu Aug 15 12:24:09 2019 -0500 Commit: Ahmed ElShreif CommitDate: Thu Aug 15 12:25:58 2019 -0500 Fix some Logger issues: Replace tabs with spaces Change-Id: I40779dfdb65037838e1a1b7bed5d89a656047ce6 diff --git a/uitest/ui_logger_dsl/dsl_core.py b/uitest/ui_logger_dsl/dsl_core.py index a695ec009d22..5d2a7e93ba82 100644 --- a/uitest/ui_logger_dsl/dsl_core.py +++ b/uitest/ui_logger_dsl/dsl_core.py @@ -11,6 +11,9 @@ import sys import argparse from textx.metamodel import metamodel_from_file +tab="" +double_tab="" + def parse_args(): """ This function parses the command-line arguments @@ -59,7 +62,7 @@ class ul_Compiler: "from libreoffice.uno.propertyvalue import mkPropertyValues\n" + \ "import importlib\n\n" + \ "class TestClass(UITestCase):\n" + \ -"\tdef test_function(self):\n" +tab+"def test_function(self):\n" self.variables.append(line) @@ -123,7 +126,7 @@ class ul_Compiler: self.objects[self.current_app]+=1 else: self.objects[self.current_app]=1 -line="\t\t"+self.current_app+" = MainWindow.getChild(\""+self.current_app+"\")\n" +line=double_tab+self.current_app+" = MainWindow.getChild(\""+self.current_app+"\")\n" self.variables.append(line) def init_Object(self,Id_of_Object,Obj_parent): @@ -132,16 +135,16 @@ class ul_Compiler: self.objects[Id_of_Object]+=1 else: self.objects[Id_of_Object]=1 -line="\t\t"+Id_of_Object+" = "+Obj_parent+\ +line=double_tab+Id_of_Object+" = "+Obj_parent+\ ".getChild(\""+Id_of_Object+"\")\n" self.variables.append(line) def write_line_without_parameters(self,Action_holder,Action,Action_type): - line="\t\t"+Action_holder+".executeAction(\""+Action+"\","+Action_type+"())\n" + line=double_tab+Action_holder+".executeAction(\""+Action+"\","+Action_type+"())\n" self.variables.append(line) def write_line_with_one_parameters(self,Action_holder,Action,Paramerter_name,parameter_value): -line="\t\t"+Action_holder+".executeAction(\""+Action+"\", mkPropertyValues({\""+\ +line=double_tab+Action_holder+".executeAction(\""+Action+"\", mkPropertyValues({\""+\ Paramerter_name+"\": \""+\ str(parameter_value)+"\"}))\n" self.variables.append(line) @@ -149,7 +152,7 @@ class ul_Compiler: def write_line_with_two_parameters(self,Action_holder,Action,Paramerter_name_1,parameter_value_1, Paramerter_name_2,parameter_value_2): -line="\t\t"+Action_holder+\ +line=double_tab+Action_holder+\ ".executeAction(\""+Action+"\", mkPropertyValues({\""+Paramerter_name_1+"\": \""+\ str(parameter_value_1)+"\", \""+Paramerter_name_2+"\": \""+\ str(parameter_value_2)+"\"}))\n" @@ -157,7 +160,7 @@ class ul_Compiler: def handle_uno(self, UNOCommand): if(UNOCommand.prameters==None): -line = "\t\tself.xUITest.executeCommand(\"" + \ +line = double_tab +"self.xUITest.executeCommand(\"" + \ UNOCommand.uno_command_name +"\")\n" else: paramaters="" @@ -165,18 +168,18 @@ class ul_Compiler: paramaters = paramaters + "\"" + p.key + "\" : " + str(p.value) + " ," paramaters = paramaters[:-1] -line = "\t\tself.xUITest.executeCommandWithParameters(\"" + \ +line = double_tab + "self.xUITest.executeCommandWithParameters(\"" + \ UNOCommand.uno_command_name +"\", mkPropertyValues({"+ paramaters +"}) )\n" self.variables.append(line) self.prev_command=UNOCommand def handle_start(self, StarterCommand): -line="\t\tMainDoc = self.ui_test.create_doc_in_start_center(\""+\ +line= double_tab + "MainDoc = self.ui_test.create_doc_in_start_center(\""+\ StarterCommand.program_name+"\")\n" self.variables.append(line) -line="\t\tMainWindow = self.xUITest.getTopFocusWindow()\n" +line= double_tab + "MainWindow = self.xUITest.getTopFocusWindow()\n" self.variables.append(line) app={"writer":"writer_edit","calc":"grid_window","impress":"impress_win"\ ,"math":"math_edit","draw":"draw_win"} @@ -194,10 +197,10 @@ class ul_Compiler: key_word=old_line[-9:-3] if ( key_word == "Dialog"): -old_line="\t\tself.ui_test.execute_dialog_through_command(\""+\ +old_line= double_tab + "self.ui_test.execute_dialog_through_command(\""+\ self.prev_command.un
[Libreoffice-commits] core.git: Branch 'private/EL-SHREIF/ui_logger' - uitest/ui_logger_dsl
uitest/ui_logger_dsl/dsl_core.py |3 +++ 1 file changed, 3 insertions(+) New commits: commit d387d8ea72e4e91db0ceb1f7b1cbba17b6bf6880 Author: Ahmed ElShreif AuthorDate: Tue Aug 13 12:23:06 2019 -0500 Commit: Ahmed ElShreif CommitDate: Tue Aug 13 12:23:06 2019 -0500 Add footer line Change-Id: I740995d811be030f406f9d3ff53c56d28af2b786 diff --git a/uitest/ui_logger_dsl/dsl_core.py b/uitest/ui_logger_dsl/dsl_core.py index a1d1da8b60a2..a695ec009d22 100644 --- a/uitest/ui_logger_dsl/dsl_core.py +++ b/uitest/ui_logger_dsl/dsl_core.py @@ -468,6 +468,9 @@ class ul_Compiler: line="\t\tself.ui_test.close_doc()" self.variables.append(line) +line="\n\n# vim: set shiftwidth=4 softtabstop=4 expandtab:" +self.variables.append(line) + for line in self.variables: self.output_stream.write(str(line)) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'private/EL-SHREIF/ui_logger' - uitest/ui_logger_dsl vcl/source
uitest/ui_logger_dsl/UI_Object_commands.tx | 18 +++ uitest/ui_logger_dsl/dsl_core.py | 50 ++--- vcl/source/uitest/logger.cxx | 67 - vcl/source/uitest/uiobject.cxx | 51 ++ 4 files changed, 166 insertions(+), 20 deletions(-) New commits: commit 21e46d5e3739704f4ee0ac365309762b1e45a792 Author: Ahmed ElShreif AuthorDate: Fri Aug 9 23:23:11 2019 -0500 Commit: Ahmed ElShreif CommitDate: Mon Aug 12 22:10:40 2019 -0500 Solving problem of un-named parent: 1) Add recursively query for the parent until find an parent with a name. 2) Remove the parent part "from xx" from the log statment if there is un-named parent 3) Update the compiler to use the most top parent if there is command with no un-named parent Change-Id: Id7dd5092bc995312494b5536720141908e73af9a diff --git a/uitest/ui_logger_dsl/UI_Object_commands.tx b/uitest/ui_logger_dsl/UI_Object_commands.tx index fbdab9c4e6ca..9b25e09c6efc 100644 --- a/uitest/ui_logger_dsl/UI_Object_commands.tx +++ b/uitest/ui_logger_dsl/UI_Object_commands.tx @@ -19,31 +19,29 @@ UIObjectCommand: ; ButtonUIObject: - 'Click on' ui_button=STRING 'from' parent_id=ID + 'Click on' ui_button=STRING ('from' parent_id=ID)? ; CheckBoxUIObject: - 'Toggle' Check_box_id=STRING 'CheckBox' 'from' parent_id=ID + 'Toggle' Check_box_id=STRING 'CheckBox' ('from' parent_id=ID)? ; RadioButtonUIObject: - 'Select' Radio_button_id=STRING 'RadioButton' 'from' parent_id=ID + 'Select' Radio_button_id=STRING 'RadioButton' ('from' parent_id=ID)? ; ComboBoxUIObject: - 'Select in' Combo_box_id=STRING 'ComboBox' 'item number' item_num=INT 'from' parent_id=ID + 'Select in' Combo_box_id=STRING 'ComboBox' 'item number' item_num=INT ('from' parent_id=ID)? ; TabControlUIObject: - 'Choose Tab number' tab_page_number=INT 'in' tab_id=STRING 'from' parent_id=ID + 'Choose Tab number' tab_page_number=INT 'in' tab_id=STRING ('from' parent_id=ID)? ; - EditUIObject: - action=action_on_UIObject 'from' parent_id=ID + action=action_on_UIObject ('from' parent_id=ID)? ; SpinFieldUIObject: - change=increase_or_ecrease Spin_id=STRING 'from' parent_id=ID + change=increase_or_ecrease Spin_id=STRING ('from' parent_id=ID)? ; ListBoxUIObject: - 'Select element with position ' POS=INT 'in' list_id=STRING 'from' parent_id=ID + 'Select element with position ' POS=INT 'in' list_id=STRING ('from' parent_id=ID)? ; - //= //hellper grammer for EditUIObject action_on_UIObject: diff --git a/uitest/ui_logger_dsl/dsl_core.py b/uitest/ui_logger_dsl/dsl_core.py index 827f2ca45b20..a1d1da8b60a2 100644 --- a/uitest/ui_logger_dsl/dsl_core.py +++ b/uitest/ui_logger_dsl/dsl_core.py @@ -27,6 +27,9 @@ class ul_Compiler: variables=[] objects = dict() current_app="" +parent_hierarchy_count=0 +last_parent=[] + def __init__(self , input_address , output_address): self.ui_dsl_mm = metamodel_from_file('ui_logger_dsl_grammar.tx') self.output_stream=self.initiate_test_generation(output_address) @@ -44,6 +47,7 @@ class ul_Compiler: return content def initiate_test_generation(self,output_address): +self.last_parent.append("MainWindow") try: f = open(output_address,"w") except IOError as err: @@ -195,6 +199,8 @@ class ul_Compiler: self.variables.append(old_line) line = "\t\t" + DialogCommand.dialog_name + " = self.xUITest.getTopFocusWindow()\n" self.variables.append(line) +self.last_parent.append(DialogCommand.dialog_name) +self.parent_hierarchy_count=self.parent_hierarchy_count+1 elif (DialogCommand.__class__.__name__ == "OpenModelessDialog"): old_line = self.variables.pop() @@ -209,6 +215,8 @@ class ul_Compiler: self.variables.append(old_line) line = "\t\t" + DialogCommand.dialog_name + " = self.xUITest.getTopFocusWindow()\n" self.variables.append(line) +self.last_parent.append(DialogCommand.dialog_name) +self.parent_hierarchy_count=self.parent_hierarchy_count+1 elif (DialogCommand.__class__.__name__ == "CloseDialog"): if (self.prev_command.__class__.__name__ == "ButtonUIObject"): @@ -216,12 +224,17 @@ class ul_Compiler: line="\t\tself.ui_test.close_dialog_through_button("+\ self.prev_command.ui_button+")\n" self.variables.append(line) +self.last_parent.pop() +self.parent_hierarchy_count=self.parent_hierarchy_count-1 self.prev_command=DialogCommand def handle_button(self, ButtonUIObject): -self.init_Object(ButtonUIObject.ui_button,ButtonUIObject.parent_id) +if
[Libreoffice-commits] core.git: Branch 'private/EL-SHREIF/ui_logger' - sc/source uitest/ui_logger_dsl vcl/source
sc/source/core/data/document.cxx | 19 +++ sc/source/ui/view/viewdata.cxx | 19 +++ uitest/ui_logger_dsl/Special_commands.tx |9 - uitest/ui_logger_dsl/dsl_core.py |2 ++ vcl/source/uitest/logger.cxx |7 +++ 5 files changed, 55 insertions(+), 1 deletion(-) New commits: commit 46160bebb756077de2408370de817f33d72cc1ad Author: Ahmed ElShreif AuthorDate: Sun Aug 4 13:42:09 2019 -0500 Commit: Ahmed ElShreif CommitDate: Sun Aug 4 13:53:57 2019 -0500 Log More Events in Calc: 1) Rename Tab 2) Insert Tab Change-Id: I7a653a4b274c0c8058672c5b0aa1645bb5a51e3a diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 106ca902534e..d0a6043c7565 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -94,6 +94,9 @@ #include #include +#include +#include + #include using ::editeng::SvxBorderLine; @@ -106,6 +109,21 @@ using ::std::set; namespace { +void collectUIInformation(const std::map& aParameters,const OUString action) +{ +EventDescription aDescription; +aDescription.aID = "grid_window"; +aDescription.aAction = action; +aDescription.aParameters = aParameters; +aDescription.aParent = "MainWindow"; +aDescription.aKeyWord = "ScGridWinUIObject"; + +UITestLogger::getInstance().logEvent(aDescription); +} +} + +namespace { + std::pair getMarkedTableRange(const std::vector& rTables, const ScMarkData& rMark) { SCTAB nTabStart = MAXTAB; @@ -895,6 +913,7 @@ bool ScDocument::RenameTab( SCTAB nTab, const OUString& rName, bool bExternalDoc } } } +collectUIInformation({{"NewName",rName}},"Rename_Sheet"); return bValid; } diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index d0c5f0e66d2f..d5b80a363cb9 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -66,6 +66,9 @@ #include #include +#include +#include + #include #include @@ -92,6 +95,21 @@ void lcl_LOKRemoveWindow(ScTabViewShell* pTabViewShell, ScSplitPos eWhich) } // anonymous namespace +namespace { + +void collectUIInformation(const std::map& aParameters,const OUString action) +{ +EventDescription aDescription; +aDescription.aID = "grid_window"; +aDescription.aAction = action; +aDescription.aParameters = aParameters; +aDescription.aParent = "MainWindow"; +aDescription.aKeyWord = "ScGridWinUIObject"; + +UITestLogger::getInstance().logEvent(aDescription); +} +} + const ScPositionHelper::index_type ScPositionHelper::null; // definition bool ScPositionHelper::Comp::operator() (const value_type& rValue1, const value_type& rValue2) const @@ -846,6 +864,7 @@ void ScViewData::InsertTab( SCTAB nTab ) UpdateCurrentTab(); mpMarkData->InsertTab( nTab ); +collectUIInformation({{}},"InsertTab"); } void ScViewData::InsertTabs( SCTAB nTab, SCTAB nNewSheets ) diff --git a/uitest/ui_logger_dsl/Special_commands.tx b/uitest/ui_logger_dsl/Special_commands.tx index 335b6d24e7d3..a4bf1a697504 100644 --- a/uitest/ui_logger_dsl/Special_commands.tx +++ b/uitest/ui_logger_dsl/Special_commands.tx @@ -74,7 +74,8 @@ writer_Insert_BreakPage: calc_command: calc_Type_command | calc_switch_sheet | calc_Select_cell | calc_AutoFill_filter | calc_Delete_Cells | calc_Remove_Content | calc_insert_cells | calc_Cut_Cells | - calc_Copy_Cells | calc_Paste_Cells | calc_UNMerge_Cells | calc_Merge_Cells + calc_Copy_Cells | calc_Paste_Cells | calc_UNMerge_Cells | calc_Merge_Cells | + calc_Rename_Sheet | calc_Insert_sheet ; calc_Type_command: 'Type on current cell' what_to_type=Type_options @@ -118,6 +119,12 @@ calc_Merge_Cells: calc_UNMerge_Cells: 'Delete the merge between' '{' '"CELL":' input_range=STRING '}' ; +calc_Rename_Sheet: +'Rename The Selected Tab to ' new_name=STRING +; +calc_Insert_sheet: +'Insert New Tab ' +; //this is the select options select_options: one_cell | range_of_cells diff --git a/uitest/ui_logger_dsl/dsl_core.py b/uitest/ui_logger_dsl/dsl_core.py index 1eaa33a441cd..827f2ca45b20 100644 --- a/uitest/ui_logger_dsl/dsl_core.py +++ b/uitest/ui_logger_dsl/dsl_core.py @@ -101,6 +101,8 @@ class ul_Compiler: 'calc_Copy_Cells':self.do_nothing, 'calc_Merge_Cells':self.do_nothing, 'calc_UNMerge_Cells':self.do_nothing, +'calc_Rename_Sheet':self.do_nothing, +'calc_Insert_sheet':self.do_nothing, 'impress_Insert_Slide':self.do_nothing, 'impress_Delete_Page':self.do_nothing, 'impress_Duplicate_Slide':self.do_nothing, diff --git a/vcl/source/uitest/logger.cxx b/vcl/source/uitest/logger.cxx index d2bcab4b6726..eafcef0a2997 100644 --- a/vcl/source/uitest/logger.cxx +++ b/vcl/source/uitest/logger.cxx @@ -369,6 +369,13 @@ void UITestLogger::logE
[Libreoffice-commits] core.git: Branch 'private/EL-SHREIF/ui_logger' - sd/source uitest/ui_logger_dsl vcl/source
sd/source/ui/slidesorter/controller/SlsSlotManager.cxx | 12 +-- sd/source/ui/slidesorter/model/SlideSorterModel.cxx| 23 + uitest/ui_logger_dsl/Special_commands.tx | 28 +++-- uitest/ui_logger_dsl/dsl_core.py |5 +++ vcl/source/uitest/logger.cxx | 21 5 files changed, 82 insertions(+), 7 deletions(-) New commits: commit 1b7c69bf8d03479b55fac25a5f7fcb06a823ce0f Author: Ahmed ElShreif AuthorDate: Sat Aug 3 11:51:11 2019 -0500 Commit: Ahmed ElShreif CommitDate: Sun Aug 4 12:39:57 2019 -0500 log more events: Impress: 1) Delete Slide 2) Duplicate Slide 3) Rename Slide Draw: 1) Delte Page 2) Rename Page Change-Id: I124bdf96c58dfe00bdb039c5e93afc0dc6e7163d diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx index 9d16edf5a63f..26bbd0cb46d3 100644 --- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx +++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx @@ -113,11 +113,11 @@ SlideExclusionState GetSlideExclusionState (model::PageEnumeration& rPageSet); namespace { -void collectUIInformation(const OUString& num,const OUString& action) +void collectUIInformation(const std::map& aParameters,const OUString& action) { EventDescription aDescription; aDescription.aID = "impress_win_or_draw_win"; -aDescription.aParameters = {{"POS", num}}; +aDescription.aParameters = aParameters; aDescription.aAction = action; aDescription.aKeyWord = "ImpressWindowUIObject"; aDescription.aParent = "MainWindow"; @@ -904,6 +904,8 @@ void SlotManager::RenameSlide(const SfxRequest& rRequest) ScopedVclPtr aNameDlg(pFact->CreateSvxNameDialog( pWin ? pWin->GetFrameWeld() : nullptr, aPageName, aDescr)); +OUString aOldName; +aNameDlg->GetName( aOldName ); aNameDlg->SetText( aTitle ); aNameDlg->SetCheckNameHdl( LINK( this, SlotManager, RenameSlideHdl ), true ); aNameDlg->SetEditHelpId( HID_SD_NAMEDIALOG_PAGE ); @@ -920,6 +922,9 @@ void SlotManager::RenameSlide(const SfxRequest& rRequest) DBG_ASSERT( bResult, "Couldn't rename slide" ); } } +OUString aNewName; +aNameDlg->GetName( aNewName ); + collectUIInformation({{"OldName",aOldName},{"NewName",aNewName}},"RENAME"); aNameDlg.disposeAndClear(); } // Tell the slide sorter about the name change (necessary for @@ -1086,7 +1091,7 @@ void SlotManager::InsertSlide (SfxRequest& rRequest) PageSelector::UpdateLock aUpdateLock (mrSlideSorter); mrSlideSorter.GetController().GetPageSelector().DeselectAllPages(); mrSlideSorter.GetController().GetPageSelector().SelectPage(pNewPage); - collectUIInformation(OUString::number(nInsertionIndex+2),"Insert_New_Page_or_Slide"); +collectUIInformation({{"POS", OUString::number(nInsertionIndex+2)}},"Insert_New_Page_or_Slide"); } void SlotManager::DuplicateSelectedSlides (SfxRequest& rRequest) @@ -1133,6 +1138,7 @@ void SlotManager::DuplicateSelectedSlides (SfxRequest& rRequest) { rSelector.SelectPage(it); } +collectUIInformation({{"POS", OUString::number(nInsertPosition+2)}},"Duplicate"); } void SlotManager::ChangeSlideExclusionState ( diff --git a/sd/source/ui/slidesorter/model/SlideSorterModel.cxx b/sd/source/ui/slidesorter/model/SlideSorterModel.cxx index ec35f545448b..cae9d9314b70 100644 --- a/sd/source/ui/slidesorter/model/SlideSorterModel.cxx +++ b/sd/source/ui/slidesorter/model/SlideSorterModel.cxx @@ -35,6 +35,9 @@ #include #include +#include +#include + #include #include #include @@ -101,6 +104,22 @@ namespace { } } +namespace { + +void collectUIInformation(const OUString& num,const OUString& action) +{ +EventDescription aDescription; +aDescription.aID = "impress_win_or_draw_win"; +aDescription.aParameters = {{"POS", num}}; +aDescription.aAction = action; +aDescription.aKeyWord = "ImpressWindowUIObject"; +aDescription.aParent = "MainWindow"; + +UITestLogger::getInstance().logEvent(aDescription); +} + +} + SlideSorterModel::SlideSorterModel (SlideSorter& rSlideSorter) : maMutex(), mrSlideSorter(rSlideSorter), @@ -614,7 +633,9 @@ bool SlideSorterModel::DeleteSlide (const SdPage* pPage) maPageDescriptors.erase(iter); UpdateIndices(nIndex); } - +if(nIndex>=0){ + collectUIInformation(OUString::number(nIndex+1),"Delete_Slide_or_Page"); +} return bMarkedSelected; } diff --git a/uitest/ui_logger_dsl/Special_commands.tx b/uitest/ui_logger_dsl/Special_commands.tx index 1d11067424a9..335b6d24e7d3 100644 --- a/uitest/ui_logger_dsl/Special_comm
[Libreoffice-commits] core.git: Branch 'private/EL-SHREIF/ui_logger' - include/vcl sd/source uitest/ui_logger_dsl vcl/source
include/vcl/uitest/logger.hxx | 10 +++ sd/source/ui/slidesorter/controller/SlsSlotManager.cxx | 22 + uitest/ui_logger_dsl/Special_commands.tx | 14 +++--- uitest/ui_logger_dsl/dsl_core.py |2 + vcl/source/uitest/logger.cxx | 11 vcl/source/uitest/uiobject.cxx |8 ++ 6 files changed, 63 insertions(+), 4 deletions(-) New commits: commit 20d0760cc256ab9bcd15c60d68ddc1baccdedada Author: Ahmed ElShreif AuthorDate: Fri Aug 2 22:16:31 2019 -0500 Commit: Ahmed ElShreif CommitDate: Fri Aug 2 22:16:31 2019 -0500 Add more events to ui logger for Impress: add new Slide for Draw add new Page Modify the UILogger System to save information about the name of the app Change-Id: I87fd98b2a11783e3410f1c0eba633631addf389b diff --git a/include/vcl/uitest/logger.hxx b/include/vcl/uitest/logger.hxx index f707049040fe..6c8c5008541a 100644 --- a/include/vcl/uitest/logger.hxx +++ b/include/vcl/uitest/logger.hxx @@ -32,6 +32,8 @@ private: bool mbValid; +OUString app_name; + public: UITestLogger(); @@ -48,6 +50,14 @@ public: static UITestLogger& getInstance(); +void setAppName(OUString name){ +app_name=name; +} + +OUString getAppName(){ +return app_name; +} + }; #endif diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx index 55b58e197f1c..9d16edf5a63f 100644 --- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx +++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx @@ -67,6 +67,9 @@ #include #include +#include +#include + #include #include #include @@ -84,6 +87,7 @@ #include #include + #include using namespace ::com::sun::star; @@ -106,6 +110,23 @@ SlideExclusionState GetSlideExclusionState (model::PageEnumeration& rPageSet); } // end of anonymous namespace + +namespace { + +void collectUIInformation(const OUString& num,const OUString& action) +{ +EventDescription aDescription; +aDescription.aID = "impress_win_or_draw_win"; +aDescription.aParameters = {{"POS", num}}; +aDescription.aAction = action; +aDescription.aKeyWord = "ImpressWindowUIObject"; +aDescription.aParent = "MainWindow"; + +UITestLogger::getInstance().logEvent(aDescription); +} + +} + SlotManager::SlotManager (SlideSorter& rSlideSorter) : mrSlideSorter(rSlideSorter) { @@ -1065,6 +1086,7 @@ void SlotManager::InsertSlide (SfxRequest& rRequest) PageSelector::UpdateLock aUpdateLock (mrSlideSorter); mrSlideSorter.GetController().GetPageSelector().DeselectAllPages(); mrSlideSorter.GetController().GetPageSelector().SelectPage(pNewPage); + collectUIInformation(OUString::number(nInsertionIndex+2),"Insert_New_Page_or_Slide"); } void SlotManager::DuplicateSelectedSlides (SfxRequest& rRequest) diff --git a/uitest/ui_logger_dsl/Special_commands.tx b/uitest/ui_logger_dsl/Special_commands.tx index 5fbd9972a275..1d11067424a9 100644 --- a/uitest/ui_logger_dsl/Special_commands.tx +++ b/uitest/ui_logger_dsl/Special_commands.tx @@ -128,17 +128,19 @@ select_options: This part for all the impress log statments: 1) Type -2) Set zoom +2) Insert New Page then we can add whatever we need in the future */ impress_command: -impress_Type_command +impress_Type_command | impress_Insert_Slide ; impress_Type_command: 'Type on impress ' what_to_type=Type_options ; - +impress_Insert_Slide: +'Insert New Slide at Position ' position_num=INT +; //=// /* This part for all the math log statments: @@ -163,12 +165,16 @@ math_Type_command: This part for all the draw log statments: 1) Type +2) Insert New Page then we can add whatever we need in the future */ draw_command: -draw_Type_command +draw_Type_command | draw_Insert_Page ; draw_Type_command: 'Type on draw ' what_to_type=Type_options +; +draw_Insert_Page: +'Insert New Page at Position ' position_num=INT ; \ No newline at end of file diff --git a/uitest/ui_logger_dsl/dsl_core.py b/uitest/ui_logger_dsl/dsl_core.py index 8d5a8a82ac0b..9a5f375b5aa9 100644 --- a/uitest/ui_logger_dsl/dsl_core.py +++ b/uitest/ui_logger_dsl/dsl_core.py @@ -101,6 +101,8 @@ class ul_Compiler: 'calc_Copy_Cells':self.do_nothing, 'calc_Merge_Cells':self.do_nothing, 'calc_UNMerge_Cells':self.do_nothing, +'impress_Insert_Slide':self.do_nothing, +'draw_Insert_Page':self.do_nothing, }) self.log_lines=self.get_log_file(self.input_address) diff --git a/vcl/source/uitest/logger.cxx b/vcl/source/uitest/logger.cxx index bd0d91940b1e..552b09d961b3
[Libreoffice-commits] core.git: Branch 'private/EL-SHREIF/ui_logger' - uitest/ui_logger_dsl vcl/source
uitest/ui_logger_dsl/Special_commands.tx | 19 +-- uitest/ui_logger_dsl/dsl_core.py | 14 +- vcl/source/uitest/logger.cxx |3 +++ 3 files changed, 33 insertions(+), 3 deletions(-) New commits: commit af7f51648553b2e6c66439921574dd474bf01447 Author: Ahmed ElShreif AuthorDate: Mon Jul 29 00:29:24 2019 -0500 Commit: Ahmed ElShreif CommitDate: Mon Jul 29 00:29:24 2019 -0500 Start logging draw Events Change-Id: I1b77b106db181a8cadc1ff0b2a5de6ad19fe6762 diff --git a/uitest/ui_logger_dsl/Special_commands.tx b/uitest/ui_logger_dsl/Special_commands.tx index fc1940c7ef91..5fbd9972a275 100644 --- a/uitest/ui_logger_dsl/Special_commands.tx +++ b/uitest/ui_logger_dsl/Special_commands.tx @@ -6,7 +6,7 @@ import type_options */ SpecialCommand: - writer_command | calc_command | impress_command | math_command + writer_command | calc_command | impress_command | math_command | draw_command ; /* @@ -144,7 +144,7 @@ impress_Type_command: This part for all the math log statments: 1) element selector -2) Type +2) Type then we can add whatever we need in the future */ @@ -156,4 +156,19 @@ math_element_selector: ; math_Type_command: 'Type on math ' what_to_type=Type_options +; + +//=// +/* + This part for all the draw log statments: + +1) Type + + then we can add whatever we need in the future +*/ +draw_command: +draw_Type_command +; +draw_Type_command: +'Type on draw ' what_to_type=Type_options ; \ No newline at end of file diff --git a/uitest/ui_logger_dsl/dsl_core.py b/uitest/ui_logger_dsl/dsl_core.py index ab198a6d234f..8d5a8a82ac0b 100644 --- a/uitest/ui_logger_dsl/dsl_core.py +++ b/uitest/ui_logger_dsl/dsl_core.py @@ -87,6 +87,7 @@ class ul_Compiler: 'math_element_selector':self.handle_math_element_selector, 'math_Type_command':self.handle_math_Type_command, 'setZoom_command':self.handle_setZoom_command, +'draw_Type_command':self.handle_draw_Type_command, 'writer_Copy_Text':self.do_nothing, 'writer_Cut_Text':self.do_nothing, @@ -165,7 +166,7 @@ class ul_Compiler: line="\t\tMainWindow = self.xUITest.getTopFocusWindow()\n" self.variables.append(line) app={"writer":"writer_edit","calc":"grid_window","impress":"impress_win"\ -,"math":"math_edit"} +,"math":"math_edit","draw":"draw_win"} self.current_app=app[StarterCommand.program_name] self.prev_command=StarterCommand @@ -391,6 +392,17 @@ class ul_Compiler: self.prev_command=math_Type_command +def handle_draw_Type_command (self,draw_Type_command): + +self.init_app() +if(draw_Type_command.what_to_type.__class__.__name__=="char"): + self.write_line_with_one_parameters(self.current_app,"TYPE","TEXT",draw_Type_command.what_to_type.input_char) + +elif(draw_Type_command.what_to_type.__class__.__name__=="KeyCode"): + self.write_line_with_one_parameters(self.current_app,"TYPE","KEYCODE",draw_Type_command.what_to_type.input_key_code) + +self.prev_command=draw_Type_command + def handle_math_element_selector (self,math_element_selector): line="\t\t"+str(math_element_selector.element_no)+" = element_selector.getChild(\""+\ diff --git a/vcl/source/uitest/logger.cxx b/vcl/source/uitest/logger.cxx index 2713188c104f..bd0d91940b1e 100644 --- a/vcl/source/uitest/logger.cxx +++ b/vcl/source/uitest/logger.cxx @@ -230,6 +230,9 @@ void UITestLogger::logKeyInput(VclPtr const & xUIElement, const Key else if(pUIObject->get_type()=="WindowUIObject" && rID=="math_edit"){ aContent = "Type on math " + aKeyCode ; } +else if(rID=="draw_win"){ +aContent = "Type on draw " + aKeyCode ; +} else{ aContent = "Type on '" + rID + "' " + aKeyCode + " from " + aParentID ; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'private/EL-SHREIF/ui_logger' - uitest/ui_logger_dsl
uitest/ui_logger_dsl/General_commands.tx | 16 +-- uitest/ui_logger_dsl/Special_commands.tx | 35 +++ uitest/ui_logger_dsl/UI_Object_commands.tx| 37 ++-- uitest/ui_logger_dsl/dialog_commands.tx |8 ++- uitest/ui_logger_dsl/example.ul | 57 ++ uitest/ui_logger_dsl/starter_commands.tx |1 uitest/ui_logger_dsl/ui_logger_dsl_grammar.tx | 15 +- uitest/ui_logger_dsl/uno_commands.tx |7 +++ 8 files changed, 109 insertions(+), 67 deletions(-) New commits: commit 12bc88fa01d5e8fc82cee0efdb1d402173b73d0d Author: Ahmed ElShreif AuthorDate: Sun Jul 28 23:07:25 2019 -0500 Commit: Ahmed ElShreif CommitDate: Sun Jul 28 23:07:25 2019 -0500 Update UI logger Grammar: 1) Make small changes in the UI logger Grammar 2) Add Comments to be more documented Change-Id: I5e68c33375870cf4a1f2537ee1a7eb997145f24f diff --git a/uitest/ui_logger_dsl/General_commands.tx b/uitest/ui_logger_dsl/General_commands.tx index 1eb15f17733d..aa3645112569 100644 --- a/uitest/ui_logger_dsl/General_commands.tx +++ b/uitest/ui_logger_dsl/General_commands.tx @@ -1,12 +1,15 @@ /* This file for the log statments that is general for all application we can use it as general commands then relate it to its application -as we have starter command +as we have in the starter command // also I make set zoom to be general as it will be better -*/ +*/ + +import type_options + GeneralCommand: -SideBar | setZoom_command | Select_command +SideBar | setZoom_command | Select_command | General_type_command_on_UI_Object ; SideBar: 'From SIDEBAR ' 'Choose ' '{"PANEL":' name=STRING '}' @@ -17,3 +20,10 @@ setZoom_command: Select_command: 'Select ' '{"OBJECT":' name=STRING '}' ; + +//== +//This Part if you want to type text in any of these UI elements This will be handled with this Grammar + +General_type_command_on_UI_Object: + 'Type on' UI_Obj=STRING what_to_type=Type_options 'from' parent_id=ID +; \ No newline at end of file diff --git a/uitest/ui_logger_dsl/Special_commands.tx b/uitest/ui_logger_dsl/Special_commands.tx index ec35418d0ab8..fc1940c7ef91 100644 --- a/uitest/ui_logger_dsl/Special_commands.tx +++ b/uitest/ui_logger_dsl/Special_commands.tx @@ -1,6 +1,8 @@ import type_options + /* This file for the log statments that relates to each diffrent applications +Each Grammar Command here is related to his own application */ SpecialCommand: @@ -10,9 +12,14 @@ SpecialCommand: /* This part for all the writer log statments: -1) Type +1) Type 2) Select 3) GOTO page +4) Create Table +5) Copy Text +6) Cut Text +7) Paste Text +8) Insert Break Page then we can add whatever we need in the future */ @@ -45,6 +52,7 @@ writer_Paste_Text: writer_Insert_BreakPage: 'Insert Break Page' ; + //=// /* This part for all the calc log statments: @@ -52,6 +60,14 @@ writer_Insert_BreakPage: 1) select sheet 2) Select cell or range 3) launch AutoFill +4) Delete Cells +5) Remove Content of a cell +6) Insert new Cells +7) Cut Cells +8) Copy Cells +9) Paste Cells +10) Merge Cells +11) Unmerge Cells then we can add whatever we need in the future */ @@ -72,10 +88,6 @@ calc_Select_cell: calc_AutoFill_filter: 'Lanuch AutoFilter from Col' col_num=INT 'and Row' row_num=INT ; -//this is the select options -select_options: -one_cell | range_of_cells -; range_of_cells: '{' '"RANGE":' input_range=STRING '}' ; @@ -106,12 +118,17 @@ calc_Merge_Cells: calc_UNMerge_Cells: 'Delete the merge between' '{' '"CELL":' input_range=STRING '}' ; +//this is the select options +select_options: +one_cell | range_of_cells +; + //=// /* This part for all the impress log statments: 1) Type -3) Set zoom +2) Set zoom then we can add whatever we need in the future */ @@ -121,6 +138,7 @@ impress_command: impress_Type_command: 'Type on impress ' what_to_type=Type_options ; + //=// /* This part for all the math log statments: @@ -138,7 +156,4 @@ math_element_selector: ; math_Type_command: 'Type on math ' what_to_type=Type_options -; - - - +; \ No newline at end of file diff --git a/uitest/ui_logger_dsl/UI_Object_commands.tx b/uitest/ui_logger_dsl/UI_Object_commands.tx index d80ff0744119..fbdab9c4e6ca 100644 --- a/uitest/ui_logger_dsl/UI_Object_commands.tx +++ b/uitest/ui_logger_dsl/UI_Object_commands.tx @@ -1,21 +1,21 @@ import type_options + /* -this file is for: -ButtonUIObject
[Libreoffice-commits] core.git: Branch 'private/EL-SHREIF/ui_logger' - sc/source sw/source uitest/ui_logger_dsl vcl/source
sc/source/ui/view/viewfun2.cxx | 25 ++- sc/source/ui/view/viewfun3.cxx | 33 +++- sc/source/ui/view/viewfunc.cxx | 28 + sw/source/core/edit/edtab.cxx | 19 +++ sw/source/uibase/dochdl/swdtflvr.cxx | 24 ++ sw/source/uibase/wrtsh/wrtsh1.cxx | 17 ++ uitest/ui_logger_dsl/Special_commands.tx | 47 +++-- uitest/ui_logger_dsl/UI_Object_commands.tx |9 - uitest/ui_logger_dsl/dsl_core.py | 18 ++- uitest/ui_logger_dsl/uno_commands.tx |4 +- vcl/source/uitest/logger.cxx | 46 +--- 11 files changed, 256 insertions(+), 14 deletions(-) New commits: commit d29c7d9fe6251a77f5c6390103f92e08e0ca6cf2 Author: Ahmed ElShreif AuthorDate: Thu Jul 18 13:53:08 2019 -0500 Commit: Ahmed ElShreif CommitDate: Sun Jul 21 21:57:41 2019 -0500 Log more Events: Calc: 1) Delete some Cells 2) Remove content from some cells 3) Insert Cells 4) Cut Cells 5) Copy Cells 6) Paste Cells 7) Merge Cells 8) Split Cell ( Delete Merge ) Writer: 1) Insert Table 2) Copy Text 3) Cut Text 4) Paste Text 5) Inser Break Page Also, Solve some bugs in the UI logger and UNO Commands. Change-Id: Ic7cacbc20e1e400900a9760b61e8b45ae96c84ff diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index f0772bab4aa2..f01fbff2ccf6 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -44,6 +44,8 @@ #include #include +#include +#include #include #include @@ -100,6 +102,21 @@ using namespace com::sun::star; using ::editeng::SvxBorderLine; +namespace { + +void collectUIInformation(const std::map& aParameters,const OUString action) +{ +EventDescription aDescription; +aDescription.aID = "grid_window"; +aDescription.aAction = action; +aDescription.aParameters = aParameters; +aDescription.aParent = "MainWindow"; +aDescription.aKeyWord = "ScGridWinUIObject"; + +UITestLogger::getInstance().logEvent(aDescription); +} +} + using ::std::vector; using ::std::unique_ptr; @@ -1222,7 +1239,9 @@ bool ScViewFunc::MergeCells( bool bApi, bool& rDoContents, bool bCenter ) UpdateInputLine(); } } - +OUString aStartAddress = aMarkRange.aStart.GetColRowString(); +OUString aEndAddress = aMarkRange.aEnd.GetColRowString(); +collectUIInformation({{"RANGE", aStartAddress + ":" + aEndAddress}},"MERGE_CELLS"); return bOk; } @@ -1308,6 +1327,10 @@ bool ScViewFunc::RemoveMerge() if (bOk) pDocSh->UpdateOle(&GetViewData()); } + +OUString Cell_location = aRange.aStart.GetColRowString(); +collectUIInformation({{"CELL", Cell_location }},"UNMERGE_CELL"); + return true;//! bOk ?? } diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx index 89aa916d26ab..d818f2389d60 100644 --- a/sc/source/ui/view/viewfun3.cxx +++ b/sc/source/ui/view/viewfun3.cxx @@ -37,6 +37,8 @@ #include #include #include +#include +#include #include @@ -76,6 +78,22 @@ using namespace com::sun::star; +namespace { + +void collectUIInformation(const std::map& aParameters,OUString action) +{ +EventDescription aDescription; +aDescription.aID = "grid_window"; +aDescription.aAction = action; +aDescription.aParameters = aParameters; +aDescription.aParent = "MainWindow"; +aDescription.aKeyWord = "ScGridWinUIObject"; + +UITestLogger::getInstance().logEvent(aDescription); +} + +} + // GlobalName of writer-DocShell from comphelper/classids.hxx // C U T @@ -146,6 +164,10 @@ void ScViewFunc::CutToClip() pDocSh->UpdateOle(&GetViewData()); CellContentChanged(); + +OUString aStartAddress = aRange.aStart.GetColRowString(); +OUString aEndAddress = aRange.aEnd.GetColRowString(); +collectUIInformation({{"RANGE", aStartAddress + ":" + aEndAddress}},"CUT"); } else ErrorMessage( STR_NOMULTISELECT ); @@ -177,7 +199,11 @@ bool ScViewFunc::CopyToClip( ScDocument* pClipDoc, bool bCut, bool bApi, bool bI if (!bApi) ErrorMessage(STR_NOMULTISELECT); } - +if( !bCut ){ +OUString aStartAddress = aRange.aStart.GetColRowString(); +OUString aEndAddress = aRange.aEnd.GetColRowString(); +collectUIInformation({{"RANGE", aStartAddress + ":" + aEndAddress}},"COPY"); +} return bDone; } @@ -194,6 +220,7 @@ bool ScViewFunc::CopyToClip( ScDocument* pClipDoc, const ScRangeList& rRanges, b
[Libreoffice-commits] core.git: Branch 'private/EL-SHREIF/ui_logger' - uitest/ui_logger_dsl vcl/source
uitest/ui_logger_dsl/dsl_core.py |4 ++- uitest/ui_logger_dsl/example.ul | 51 ++- vcl/source/uitest/logger.cxx |4 +-- vcl/source/uitest/uiobject.cxx |2 - 4 files changed, 35 insertions(+), 26 deletions(-) New commits: commit c7633b8427130dc4649aef0e80e24aa1b52dacef Author: Ahmed ElShreif AuthorDate: Thu Jul 18 12:25:05 2019 -0500 Commit: Ahmed ElShreif CommitDate: Thu Jul 18 12:25:05 2019 -0500 Solving some bugs in the ui logger Change-Id: I39836423fad8cb361a8f007f648108618906be8a diff --git a/uitest/ui_logger_dsl/dsl_core.py b/uitest/ui_logger_dsl/dsl_core.py index a43399c190a4..0d5593081693 100644 --- a/uitest/ui_logger_dsl/dsl_core.py +++ b/uitest/ui_logger_dsl/dsl_core.py @@ -171,6 +171,7 @@ class ul_Compiler: self.prev_command.uno_command_name+"\")\n" self.variables.append(old_line) line = "\t\t" + DialogCommand.dialog_name + " = self.xUITest.getTopFocusWindow()\n" +self.variables.append(line) elif (DialogCommand.__class__.__name__ == "OpenModelessDialog"): old_line = self.variables.pop() @@ -184,14 +185,15 @@ class ul_Compiler: self.prev_command.uno_command_name+"\")\n" self.variables.append(old_line) line = "\t\t" + DialogCommand.dialog_name + " = self.xUITest.getTopFocusWindow()\n" +self.variables.append(line) elif (DialogCommand.__class__.__name__ == "CloseDialog"): if (self.prev_command.__class__.__name__ == "ButtonUIObject"): old_line = self.variables.pop() line="\t\tself.ui_test.close_dialog_through_button("+\ self.prev_command.ui_button+")\n" +self.variables.append(line) -self.variables.append(line) self.prev_command=DialogCommand def handle_button(self, ButtonUIObject): diff --git a/uitest/ui_logger_dsl/example.ul b/uitest/ui_logger_dsl/example.ul index 93bc14c59c5a..dc78ac14dcd6 100644 --- a/uitest/ui_logger_dsl/example.ul +++ b/uitest/ui_logger_dsl/example.ul @@ -1,22 +1,29 @@ -Start writer -Send UNO Command (".uno:UpdateInputFields") -Send UNO Command (".uno:FontDialog") -Open CharacterPropertiesDialog -Choose Tab number 0 from CharacterPropertiesDialog -Choose Tab number 2 from CharacterPropertiesDialog -Select "90deg" Radio Button from CharacterPropertiesDialog -Toggle "pairkerning" CheckBox from CharacterPropertiesDialog -Select in "weststylelb-cjk" ComboBox item number 2 from CharacterPropertiesDialog -Increase "scalewidthsb" from CharacterPropertiesDialog -Decrease "scalewidthsb" from CharacterPropertiesDialog -Type on "linewidthmf" {"TEXT": "1"} from CharacterPropertiesDialog -Select element with position 2 in "effectslb" from CharacterPropertiesDialog -Click on "ok" from CharacterPropertiesDialog -Close Dialog -Type on writer {"TEXT": "s"} -Select from Pos 5 to Pos 7 -Set Zoom to 100 -GOTO page number 1 -Open QuerySaveDialog -Click on "ok" from QuerySaveDialog -Close Dialog +Start calc +Switch to sheet number 0 +Select from calc {"CELL": "A1"} +Select from calc {"CELL": "B5"} +Select from calc {"CELL": "C6"} +Switch to sheet number 1 +Select from calc {"CELL": "A1"} +Switch to sheet number 0 +Select from calc {"CELL": "C6"} +Switch to sheet number 1 +Select from calc {"CELL": "A1"} +Switch to sheet number 2 +Select from calc {"CELL": "A1"} +Select from calc {"CELL": "C5"} +Type on current cell {"TEXT": "a"} +Type on current cell {"TEXT": "a"} +Select from calc {"CELL": "C7"} +Type on current cell {"TEXT": "a"} +Type on current cell {"TEXT": "v"} +Select from calc {"CELL": "C5"} +Send UNO Command (".uno:ZoomSlider") +Send UNO Command (".uno:ZoomSlider") {} +Send UNO Command (".uno:DataFilterAutoFilter") +Lanuch AutoFilter from Col 0 and Row 2 +Click on 'ok' from check_list_menu +Select from calc {"RANGE": "C1:C7"} +Open Modal QuerySaveDialog +Click on 'discard' from QuerySaveDialog +Close Dialog \ No newline at end of file diff --git a/vcl/source/uitest/logger.cxx b/vcl/source/uitest/logger.cxx index 4b3f69245ae6..0dac10050023 100644 --- a/vcl/source/uitest/logger.cxx +++ b/vcl/source/uitest/logger.cxx @@ -292,7 +292,7 @@ void UITestLogger::logEvent(const EventDescription& rDescription) OUString aLogLine ; //first check on general commands if(rDescription.aAction=="SET"){ -aLogLine = "Set Zoom to be " + GetValueInMapWithIndex(rDescription.aParameters,0); +aLogLine = "Set Zoom to " + GetValueInMapWithIndex(rDescription.aParameters,0); } else if(rDescription.aAction=="SIDEBAR"){ aLogLine = "From SIDEBAR Choose " + aParameterString; @@ -308,7 +308,7 @@ void UITestLogger::logEvent(const EventDescription& rDescription) else if(rDescription.aAction=="SELECT"){ OUString to = GetValueInMapWithIndex(rDescription.aParameters,0); OUString from = G
[Libreoffice-commits] core.git: Branch 'private/EL-SHREIF/ui_logger' - uitest/ui_logger_dsl
uitest/ui_logger_dsl/dsl_core.py | 323 --- 1 file changed, 107 insertions(+), 216 deletions(-) New commits: commit 9f0ebbfcdc480b727162b108c509e020cf7e215b Author: Ahmed ElShreif AuthorDate: Sat Jul 13 15:09:25 2019 +0200 Commit: Ahmed ElShreif CommitDate: Sat Jul 13 17:36:52 2019 +0200 Adding General Functions to remove Redundunt lines: 1) init_app 2) init_Object 3) write_line_without_parameters 4) write_line_with_one_parameters Then Rewrite the handlers again Change-Id: I8ceb01f4eaa48f1544ada8966c7585dcbd3e15aa diff --git a/uitest/ui_logger_dsl/dsl_core.py b/uitest/ui_logger_dsl/dsl_core.py index c81a099b6de5..a43399c190a4 100644 --- a/uitest/ui_logger_dsl/dsl_core.py +++ b/uitest/ui_logger_dsl/dsl_core.py @@ -91,6 +91,43 @@ class ul_Compiler: self.log_lines=self.get_log_file(self.input_address) +def init_app(self): +if self.current_app in self.objects: +self.objects[self.current_app]+=1 +else: +self.objects[self.current_app]=1 +line="\t\t"+self.current_app+" = MainWindow.getChild(\""+self.current_app+"\")\n" +self.variables.append(line) + +def init_Object(self,Id_of_Object,Obj_parent): + +if Id_of_Object in self.objects: +self.objects[Id_of_Object]+=1 +else: +self.objects[Id_of_Object]=1 +line="\t\t"+Id_of_Object+" = "+Obj_parent+\ +".getChild(\""+Id_of_Object+"\")\n" +self.variables.append(line) + +def write_line_without_parameters(self,Action_holder,Action,Action_type): + line="\t\t"+Action_holder+".executeAction(\""+Action+"\","+Action_type+"())\n" +self.variables.append(line) + +def write_line_with_one_parameters(self,Action_holder,Action,Paramerter_name,parameter_value): +line="\t\t"+Action_holder+".executeAction(\""+Action+"\", mkPropertyValues({\""+\ +Paramerter_name+"\": \""+\ +str(parameter_value)+"\"}))\n" +self.variables.append(line) + +def write_line_with_two_parameters(self,Action_holder,Action,Paramerter_name_1,parameter_value_1, +Paramerter_name_2,parameter_value_2): + +line="\t\t"+Action_holder+\ +".executeAction(\""+Action+"\", mkPropertyValues({\""+Paramerter_name_1+"\": \""+\ +str(parameter_value_1)+"\", \""+Paramerter_name_2+"\": \""+\ +str(parameter_value_2)+"\"}))\n" +self.variables.append(line) + def handle_uno(self, UNOCommand): if(UNOCommand.prameters==None): line = "\t\tself.xUITest.executeCommand(\"" + \ @@ -159,275 +196,153 @@ class ul_Compiler: def handle_button(self, ButtonUIObject): -if ButtonUIObject.ui_button in self.objects: -self.objects[ButtonUIObject.ui_button]+=1 -else: -self.objects[ButtonUIObject.ui_button]=1 -line="\t\t"+ButtonUIObject.ui_button+" = "+ButtonUIObject.parent_id+\ -".getChild(\""+ButtonUIObject.ui_button+"\")\n" -self.variables.append(line) +self.init_Object(ButtonUIObject.ui_button,ButtonUIObject.parent_id) + + self.write_line_without_parameters(ButtonUIObject.ui_button,"CLICK","tuple") - line="\t\t"+ButtonUIObject.ui_button+".executeAction(\"CLICK\",tuple())\n" -self.variables.append(line) self.prev_command=ButtonUIObject def handle_check_box(self, CheckBoxUIObject): -if CheckBoxUIObject.Check_box_id in self.objects: -self.objects[CheckBoxUIObject.Check_box_id]+=1 -else: -self.objects[CheckBoxUIObject.Check_box_id]=1 -line="\t\t"+CheckBoxUIObject.Check_box_id+" = "+CheckBoxUIObject.parent_id+\ -".getChild(\""+CheckBoxUIObject.Check_box_id+"\")\n" -self.variables.append(line) + self.init_Object(CheckBoxUIObject.Check_box_id,CheckBoxUIObject.parent_id) + + self.write_line_without_parameters(CheckBoxUIObject.Check_box_id,"CLICK","tuple") - line="\t\t"+CheckBoxUIObject.Check_box_id+".executeAction(\"CLICK\",tuple())\n" -self.variables.append(line) self.prev_command=CheckBoxUIObject def handle_tab(self, TabControlUIObject): -if TabControlUIObject.tab_id in self.objects: -self.objects[TabControlUIObject.tab_id]+=1 -else: -self.objects[TabControlUIObject.tab_id]=1 -line="\t\t"+TabControlUIObject.tab_id+" = "+TabControlUIObject.parent_id+\ -".getChild(\""+TabControlUIObject.tab_id+"\")\n" -self.variables.append(line) + self.init_Object(TabControlUIObject.tab_id,TabControlUIObject.parent_id) + + self.write_line_with_one_parameters(TabControlUIObject.tab_id,"SELECT","POS",TabControlUIObject.tab_page_number) -line="\t\t"+TabControlU
[Libreoffice-commits] core.git: Branch 'private/EL-SHREIF/ui_logger' - uitest/ui_logger_dsl
uitest/ui_logger_dsl/Special_commands.tx | 12 +- uitest/ui_logger_dsl/dsl_core.py | 150 ++- 2 files changed, 155 insertions(+), 7 deletions(-) New commits: commit 7f9fb99e0da8690463fca230f28e2a7b5349a0af Author: Ahmed ElShreif AuthorDate: Sat Jul 13 14:39:17 2019 +0200 Commit: Ahmed ElShreif CommitDate: Sat Jul 13 14:39:17 2019 +0200 Adding the Compiler of this Commands 1) Calc (calc_Type_command - calc_switch_sheet - calc_Select_cell - calc_AutoFill_filter) 2) impress (impress_Type_command) 3) math (math_element_selector - math_Type_command) 4) General Commands Compiler: (setZoom_command) Change-Id: Ifd2608c38474633b579a216356fe53c859c24975 diff --git a/uitest/ui_logger_dsl/Special_commands.tx b/uitest/ui_logger_dsl/Special_commands.tx index 3ef28f65bdaf..ac0f4d9a30aa 100644 --- a/uitest/ui_logger_dsl/Special_commands.tx +++ b/uitest/ui_logger_dsl/Special_commands.tx @@ -39,18 +39,18 @@ writer_GOTO_command: then we can add whatever we need in the future */ calc_command: - calc_Type_command | switch_sheet | Select_cell | AutoFill_filter + calc_Type_command | calc_switch_sheet | calc_Select_cell | calc_AutoFill_filter ; calc_Type_command: 'Type on current cell' what_to_type=Type_options ; -switch_sheet: +calc_switch_sheet: 'Switch to sheet number' sheet_num=INT ; -Select_cell: +calc_Select_cell: 'Select from calc' select_op=select_options ; -AutoFill_filter: +calc_AutoFill_filter: 'Lanuch AutoFilter from Col' col_num=INT 'and Row' row_num=INT ; //this is the select options @@ -88,9 +88,9 @@ impress_Type_command: then we can add whatever we need in the future */ math_command: -element_selector | math_Type_command +math_element_selector | math_Type_command ; -element_selector: +math_element_selector: 'Select element no ' element_no=INT ' From ' place=ID ; math_Type_command: diff --git a/uitest/ui_logger_dsl/dsl_core.py b/uitest/ui_logger_dsl/dsl_core.py index d914e2ed2dc4..c81a099b6de5 100644 --- a/uitest/ui_logger_dsl/dsl_core.py +++ b/uitest/ui_logger_dsl/dsl_core.py @@ -79,6 +79,14 @@ class ul_Compiler: 'writer_Type_command':self.handle_writer_type, 'writer_Select_command':self.handle_writer_select, 'writer_GOTO_command':self.handle_wirter_goto, +'calc_Select_cell':self.handle_calc_select, +'calc_switch_sheet':self.handle_calc_switch_sheet, +'calc_Type_command':self.handle_calc_Type_command, +'calc_AutoFill_filter':self.handle_calc_AutoFill_filter, +'impress_Type_command':self.handle_impress_Type_command, +'math_element_selector':self.handle_math_element_selector, +'math_Type_command':self.handle_math_Type_command, +'setZoom_command':self.handle_setZoom_command }) self.log_lines=self.get_log_file(self.input_address) @@ -106,7 +114,8 @@ class ul_Compiler: line="\t\tMainWindow = self.xUITest.getTopFocusWindow()\n" self.variables.append(line) -app={"writer":"writer_edit","calc":"grid_window"}#to be continue + app={"writer":"writer_edit","calc":"grid_window","impress":"impress_win"\ +,"math":"math_edit"} self.current_app=app[StarterCommand.program_name] self.prev_command=StarterCommand @@ -355,6 +364,145 @@ class ul_Compiler: self.variables.append(line) self.prev_command=writer_GOTO_command +def handle_calc_select (self,calc_Select_cell): + +if self.current_app in self.objects: +self.objects[self.current_app]+=1 +else: +self.objects[self.current_app]=1 +line="\t\t"+self.current_app+" = MainWindow.getChild(\""+self.current_app+"\")\n" +self.variables.append(line) + +if(calc_Select_cell.select_op.__class__.__name__=="range_of_cells"): +line="\t\t"+self.current_app+".executeAction(\"SELECT\", mkPropertyValues({\"RANGE\": \""+\ +calc_Select_cell.select_op.input_range+"\"}))\n" + +elif(calc_Select_cell.select_op.__class__.__name__=="one_cell"): +line="\t\t"+self.current_app+".executeAction(\"SELECT\", mkPropertyValues({\"CELL\": \""+\ +calc_Select_cell.select_op.input_cell+"\"}))\n" + +self.variables.append(line) +self.prev_command=calc_Select_cell + +def handle_calc_switch_sheet (self,calc_switch_sheet): + +if self.current_app in self.objects: +self.objects[self.current_app]+=1 +else: +self.objects[self.current_app]=1 +line="\t\t"+self.current_app+" = MainWindow.getChild(\""+self.current_app+"\")\n" +self.variables.append(line) + +line="\t\t"+self.current_app+".executeAction(\"SELECT\"
[Libreoffice-commits] core.git: Branch 'private/EL-SHREIF/ui_logger' - uitest/ui_logger_dsl
uitest/ui_logger_dsl/Special_commands.tx | 13 +++ uitest/ui_logger_dsl/dsl_core.py | 55 +++ 2 files changed, 61 insertions(+), 7 deletions(-) New commits: commit f2c28aceb1493b57e65aa33cc0a367b96a0ee05f Author: Ahmed ElShreif AuthorDate: Sun Jul 7 00:52:06 2019 +0200 Commit: Ahmed ElShreif CommitDate: Sun Jul 7 00:52:06 2019 +0200 Special Commands of writer app implementation: 1) Type Command 2) Select Command 3) GoTo page Change-Id: I5ee773b6cd322c2c1bf0eba58e704b2ff1399ce7 diff --git a/uitest/ui_logger_dsl/Special_commands.tx b/uitest/ui_logger_dsl/Special_commands.tx index c6f0a1d3305e..3ef28f65bdaf 100644 --- a/uitest/ui_logger_dsl/Special_commands.tx +++ b/uitest/ui_logger_dsl/Special_commands.tx @@ -12,21 +12,20 @@ SpecialCommand: 1) Type 2) Select -3) Set zoom -4) GOTO page +3) GOTO page then we can add whatever we need in the future */ writer_command: - Type_command | Select_command | GOTO_command +writer_Type_command | writer_Select_command | writer_GOTO_command ; -Type_command: +writer_Type_command: 'Type on writer' what_to_type=Type_options ; -Select_command: - 'Select from Pos' from=INT 'to Pos' to=INT +writer_Select_command: + 'Select from Pos' from_pos=INT 'to Pos' to_pos=INT ; -GOTO_command: +writer_GOTO_command: 'GOTO page number' page_num=INT ; //=// diff --git a/uitest/ui_logger_dsl/dsl_core.py b/uitest/ui_logger_dsl/dsl_core.py index e212c82a67d1..d914e2ed2dc4 100644 --- a/uitest/ui_logger_dsl/dsl_core.py +++ b/uitest/ui_logger_dsl/dsl_core.py @@ -26,6 +26,7 @@ class ul_Compiler: prev_command="" variables=[] objects = dict() +current_app="" def __init__(self , input_address , output_address): self.ui_dsl_mm = metamodel_from_file('ui_logger_dsl_grammar.tx') self.output_stream=self.initiate_test_generation(output_address) @@ -75,6 +76,9 @@ class ul_Compiler: 'ListBoxUIObject':self.handle_List_box, 'SpinFieldUIObject':self.handle_spin_field, 'EditUIObject':self.handle_Edit_uiObject, +'writer_Type_command':self.handle_writer_type, +'writer_Select_command':self.handle_writer_select, +'writer_GOTO_command':self.handle_wirter_goto, }) self.log_lines=self.get_log_file(self.input_address) @@ -102,6 +106,8 @@ class ul_Compiler: line="\t\tMainWindow = self.xUITest.getTopFocusWindow()\n" self.variables.append(line) +app={"writer":"writer_edit","calc":"grid_window"}#to be continue +self.current_app=app[StarterCommand.program_name] self.prev_command=StarterCommand def handle_Dialog(self, DialogCommand): @@ -300,6 +306,55 @@ class ul_Compiler: self.variables.append(line) self.prev_command=EditUIObject +def handle_writer_type (self,writer_Type_command): + +if "writer_edit" in self.objects: +self.objects["writer_edit"]+=1 +else: +self.objects["writer_edit"]=1 +line="\t\twriter_edit = MainWindow.getChild(\"writer_edit\")\n" +self.variables.append(line) + +if(writer_Type_command.what_to_type.__class__.__name__=="char"): +line="\t\twriter_edit.executeAction(\"TYPE\", mkPropertyValues"+\ +"({\"TEXT\": \""+\ +writer_Type_command.what_to_type.input_char+"\"}))\n" +elif(writer_Type_command.what_to_type.__class__.__name__=="KeyCode"): +line="\t\twriter_edit.executeAction(\"TYPE\", mkPropertyValues"+\ +"({\"KEYCODE\": \""+\ +writer_Type_command.what_to_type.input_key_code+"\"}))\n" +self.variables.append(line) +self.prev_command=writer_Type_command + +def handle_writer_select (self,writer_Select_command): + +if "writer_edit" in self.objects: +self.objects["writer_edit"]+=1 +else: +self.objects["writer_edit"]=1 +line="\t\twriter_edit = MainWindow.getChild(\"writer_edit\")\n" +self.variables.append(line) + +line="\t\twriter_edit.executeAction(\"SELECT\", mkPropertyValues({\"END_POS\": \""+\ +str(writer_Select_command.from_pos)+"\", \"START_POS\": \""+\ +str(writer_Select_command.to_pos)+"\"}))\n" +self.variables.append(line) +self.prev_command=writer_Select_command + +def handle_wirter_goto (self,writer_GOTO_command): + +if "writer_edit" in self.objects: +self.objects["writer_edit"]+=1 +else: +self.objects["writer_edit"]=1 +line="\t\twriter_edit = MainWindow.getChild(\"writer_edit\")\n" +self.variables.append(line) + +line="\t\twriter_edit.executeAction(\"GOTO\", mkPropertyValues({\"PAGE\": \""+\ +
[Libreoffice-commits] core.git: Branch 'private/EL-SHREIF/ui_logger' - uitest/ui_logger_dsl
uitest/ui_logger_dsl/dsl_core.py | 32 +++- 1 file changed, 27 insertions(+), 5 deletions(-) New commits: commit fe20f71b67474c60a3fac3abefd40a34aeb9f296 Author: Ahmed ElShreif AuthorDate: Sat Jul 6 14:49:49 2019 +0200 Commit: Ahmed ElShreif CommitDate: Sat Jul 6 14:49:49 2019 +0200 Implement the missing part of the Dialog Compiler Change-Id: I08881b738b3e7922b74f9d007733278e2b6ef54e diff --git a/uitest/ui_logger_dsl/dsl_core.py b/uitest/ui_logger_dsl/dsl_core.py index 6f04762cc96e..e212c82a67d1 100644 --- a/uitest/ui_logger_dsl/dsl_core.py +++ b/uitest/ui_logger_dsl/dsl_core.py @@ -23,6 +23,7 @@ def parse_args(): return args class ul_Compiler: +prev_command="" variables=[] objects = dict() def __init__(self , input_address , output_address): @@ -92,6 +93,7 @@ class ul_Compiler: UNOCommand.uno_command_name +"\", mkPropertyValues({"+ paramaters +"}) )\n" self.variables.append(line) +self.prev_command=UNOCommand def handle_start(self, StarterCommand): line="\t\tMainDoc = self.ui_test.create_doc_in_start_center(\""+\ @@ -100,33 +102,45 @@ class ul_Compiler: line="\t\tMainWindow = self.xUITest.getTopFocusWindow()\n" self.variables.append(line) +self.prev_command=StarterCommand def handle_Dialog(self, DialogCommand): if (DialogCommand.__class__.__name__ == "OpenModalDialog"): old_line = self.variables.pop() -key_word=old_line[-9:-3] +if (self.prev_command.__class__.__name__ == "UNOCommand"): +key_word=self.prev_command.uno_command_name[-6:] +else: +key_word=old_line[-9:-3] + if ( key_word == "Dialog"): old_line="\t\tself.ui_test.execute_dialog_through_command(\""+\ -old_line[31:-3]+"\")\n" +self.prev_command.uno_command_name+"\")\n" self.variables.append(old_line) line = "\t\t" + DialogCommand.dialog_name + " = self.xUITest.getTopFocusWindow()\n" elif (DialogCommand.__class__.__name__ == "OpenModelessDialog"): old_line = self.variables.pop() +if (self.prev_command.__class__.__name__ == "UNOCommand"): +key_word=self.prev_command.uno_command_name[-6:] +else: +key_word=old_line[-9:-3] -key_word=old_line[-9:-3] if ( key_word == "Dialog"): old_line="\t\tself.ui_test.execute_modeless_dialog_through_command(\""+\ -old_line[31:-3]+"\")\n" +self.prev_command.uno_command_name+"\")\n" self.variables.append(old_line) line = "\t\t" + DialogCommand.dialog_name + " = self.xUITest.getTopFocusWindow()\n" elif (DialogCommand.__class__.__name__ == "CloseDialog"): -line="\t\tto be implemented after ui Objects\n" +if (self.prev_command.__class__.__name__ == "ButtonUIObject"): +old_line = self.variables.pop() +line="\t\tself.ui_test.close_dialog_through_button("+\ +self.prev_command.ui_button+")\n" self.variables.append(line) +self.prev_command=DialogCommand def handle_button(self, ButtonUIObject): @@ -140,6 +154,7 @@ class ul_Compiler: line="\t\t"+ButtonUIObject.ui_button+".executeAction(\"CLICK\",tuple())\n" self.variables.append(line) +self.prev_command=ButtonUIObject def handle_check_box(self, CheckBoxUIObject): @@ -153,6 +168,7 @@ class ul_Compiler: line="\t\t"+CheckBoxUIObject.Check_box_id+".executeAction(\"CLICK\",tuple())\n" self.variables.append(line) +self.prev_command=CheckBoxUIObject def handle_tab(self, TabControlUIObject): @@ -168,6 +184,7 @@ class ul_Compiler: ".executeAction(\"SELECT\", mkPropertyValues({\"POS\": \""+\ str(TabControlUIObject.tab_page_number)+"\"}))\n" self.variables.append(line) +self.prev_command=TabControlUIObject def handle_Combo_box(self, ComboBoxUIObject): @@ -183,6 +200,7 @@ class ul_Compiler: ".executeAction(\"SELECT\", mkPropertyValues({\"POS\": \""+\ str(ComboBoxUIObject.item_num)+"\"}))\n" self.variables.append(line) +self.prev_command=ComboBoxUIObject def handle_Radio_button(self,RadioButtonUIObject): @@ -196,6 +214,7 @@ class ul_Compiler: line="\t\t"+RadioButtonUIObject.Radio_button_id+".executeAction(\"CLICK\",tuple())\n" self.variables.append(line) +self.prev_command=RadioButtonUIObject def handle_List_box(self, ListBoxUIObject): @@ -211,6 +230,7 @@ class ul_Compiler: ".executeAction(\"SELECT\", mkPropertyValues({\"POS\": \""+\ str(ListBoxUIObject.POS)+"\"}))\n" self.variables.app
[Libreoffice-commits] core.git: Branch 'private/EL-SHREIF/ui_logger' - uitest/ui_logger_dsl vcl/source
uitest/ui_logger_dsl/UI_Object_commands.tx |6 - uitest/ui_logger_dsl/dsl_core.py | 161 - vcl/source/uitest/uiobject.cxx |3 3 files changed, 165 insertions(+), 5 deletions(-) New commits: commit 58eabef2d605984d2e13c1d7faeb6ea9faaf7466 Author: Ahmed ElShreif AuthorDate: Sat Jul 6 05:23:08 2019 +0200 Commit: Ahmed ElShreif CommitDate: Sat Jul 6 05:23:08 2019 +0200 This Commit is implementation of the Compiler of these items: 1) ButtonUIObject 2) CheckBoxUIObject 3) TabControlUIObject 4) ComboBoxUIObject 5) RadioButtonUIObject 6) ListBoxUIObject 7) SpinFieldUIObject 8) EditUIObject Change-Id: Ic81c2a0511351cf91f4514316b9c5854a64a4b05 diff --git a/uitest/ui_logger_dsl/UI_Object_commands.tx b/uitest/ui_logger_dsl/UI_Object_commands.tx index 58339e6c752f..03bb0f78ded1 100644 --- a/uitest/ui_logger_dsl/UI_Object_commands.tx +++ b/uitest/ui_logger_dsl/UI_Object_commands.tx @@ -31,7 +31,7 @@ ComboBoxUIObject: 'Select in' Combo_box_id=STRING 'ComboBox' 'item number' item_num=INT 'from' parent_id=ID ; TabControlUIObject: - 'Choose Tab number' tab_page_number=INT 'from' parent_id=ID + 'Choose Tab number' tab_page_number=INT 'in' tab_id=STRING 'from' parent_id=ID ; EditUIObject: @@ -41,7 +41,7 @@ SpinFieldUIObject: change=increase_or_ecrease Spin_id=STRING 'from' parent_id=ID ; ListBoxUIObject: - 'Select element with position ' POS=INT 'in' list=STRING 'from' parent_id=ID + 'Select element with position ' POS=INT 'in' list_id=STRING 'from' parent_id=ID ; //== SpinUIObject: @@ -59,7 +59,7 @@ Type_action: ; SELECT: 'Select in ' edit_button=STRING - '{"FROM": "' from=INT '", "' To=INT '": "0"}' + '{"FROM": "' from_pos=INT '" , "TO" : "'to_pos=INT '"}' ; Clear: 'Clear' edit_button=STRING diff --git a/uitest/ui_logger_dsl/dsl_core.py b/uitest/ui_logger_dsl/dsl_core.py index 94dc4c8b716e..6f04762cc96e 100644 --- a/uitest/ui_logger_dsl/dsl_core.py +++ b/uitest/ui_logger_dsl/dsl_core.py @@ -24,6 +24,7 @@ def parse_args(): class ul_Compiler: variables=[] +objects = dict() def __init__(self , input_address , output_address): self.ui_dsl_mm = metamodel_from_file('ui_logger_dsl_grammar.tx') self.output_stream=self.initiate_test_generation(output_address) @@ -65,6 +66,14 @@ class ul_Compiler: 'CloseDialog': self.handle_Dialog, 'OpenModelessDialog': self.handle_Dialog, 'OpenModalDialog':self.handle_Dialog, +'ButtonUIObject':self.handle_button, +'CheckBoxUIObject':self.handle_check_box, +'TabControlUIObject':self.handle_tab, +'ComboBoxUIObject':self.handle_Combo_box, +'RadioButtonUIObject':self.handle_Radio_button, +'ListBoxUIObject':self.handle_List_box, +'SpinFieldUIObject':self.handle_spin_field, +'EditUIObject':self.handle_Edit_uiObject, }) self.log_lines=self.get_log_file(self.input_address) @@ -119,6 +128,156 @@ class ul_Compiler: self.variables.append(line) +def handle_button(self, ButtonUIObject): + +if ButtonUIObject.ui_button in self.objects: +self.objects[ButtonUIObject.ui_button]+=1 +else: +self.objects[ButtonUIObject.ui_button]=1 +line="\t\t"+ButtonUIObject.ui_button+" = "+ButtonUIObject.parent_id+\ +".getChild(\""+ButtonUIObject.ui_button+"\")\n" +self.variables.append(line) + + line="\t\t"+ButtonUIObject.ui_button+".executeAction(\"CLICK\",tuple())\n" +self.variables.append(line) + +def handle_check_box(self, CheckBoxUIObject): + +if CheckBoxUIObject.Check_box_id in self.objects: +self.objects[CheckBoxUIObject.Check_box_id]+=1 +else: +self.objects[CheckBoxUIObject.Check_box_id]=1 +line="\t\t"+CheckBoxUIObject.Check_box_id+" = "+CheckBoxUIObject.parent_id+\ +".getChild(\""+CheckBoxUIObject.Check_box_id+"\")\n" +self.variables.append(line) + + line="\t\t"+CheckBoxUIObject.Check_box_id+".executeAction(\"CLICK\",tuple())\n" +self.variables.append(line) + +def handle_tab(self, TabControlUIObject): + +if TabControlUIObject.tab_id in self.objects: +self.objects[TabControlUIObject.tab_id]+=1 +else: +self.objects[TabControlUIObject.tab_id]=1 +line="\t\t"+TabControlUIObject.tab_id+" = "+TabControlUIObject.parent_id+\ +".getChild(\""+TabControlUIObject.tab_id+"\")\n" +self.variables.append(line) + +line="\t\t"+TabControlUIObject.tab_id+\ +".executeAction(\"SELECT\", mkPropertyValues({\"
[Libreoffice-commits] core.git: Branch 'private/EL-SHREIF/ui_logger' - uitest/ui_logger_dsl
uitest/ui_logger_dsl/dsl_core.py | 142 +-- 1 file changed, 137 insertions(+), 5 deletions(-) New commits: commit f6ced6841462eeb302dd52424e01384f76283c65 Author: Ahmed ElShreif AuthorDate: Mon Jul 1 17:42:53 2019 +0200 Commit: Ahmed ElShreif CommitDate: Mon Jul 1 17:42:53 2019 +0200 Start the Implementation of the new dsl Compiler by: 1) finish the functions that will parse inputs 2) add function to initialize the UI test Case 3) add function to print the ui new test case 4) add the UNO caommands handler 5) add the Dialog commands handler 6) add the Starter commands handler Change-Id: Ided1c050023c5284457f62c4b8d5ea1cfa38c043 diff --git a/uitest/ui_logger_dsl/dsl_core.py b/uitest/ui_logger_dsl/dsl_core.py index 7c324083e2b7..94dc4c8b716e 100644 --- a/uitest/ui_logger_dsl/dsl_core.py +++ b/uitest/ui_logger_dsl/dsl_core.py @@ -1,10 +1,142 @@ +#!/usr/bin/env python3 +# This file is part of the LibreOffice UI_logger project. +# +# This file contain the implementation of the Compiler +# for the new logger grammar +# +# ul stands for Ui_Logger + +import os +import sys +import argparse from textx.metamodel import metamodel_from_file -ui_dsl_mm = metamodel_from_file('ui_logger_dsl_grammar.tx') +def parse_args(): +""" +This function parses the command-line arguments +to get the input and output file details +""" +parser = argparse.ArgumentParser(description = "Generate a UI test file from log") +parser.add_argument("input_address", type = str, help = "The log file address") +parser.add_argument("output_address", type = str, help = "The test file address") +args = parser.parse_args() +return args + +class ul_Compiler: +variables=[] +def __init__(self , input_address , output_address): +self.ui_dsl_mm = metamodel_from_file('ui_logger_dsl_grammar.tx') +self.output_stream=self.initiate_test_generation(output_address) +self.input_address=input_address + +def get_log_file(self , input_address): +try: +# load the program +content = self.ui_dsl_mm.model_from_file(input_address) +except IOError as err: +print("IO error: {0}".format(err)) +print("Use " + os.path.basename(sys.argv[0]) + " -h to get usage instructions") +sys.exit(1) + +return content + +def initiate_test_generation(self,output_address): +try: +f = open(output_address,"w") +except IOError as err: +print("IO error: {0}".format(err)) +print("Use " + os.path.basename(sys.argv[0]) + " -h to get usage instructions") +sys.exit(1) +line="# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-\n\n" + \ +"from uitest.framework import UITestCase\n" + \ +"from libreoffice.uno.propertyvalue import mkPropertyValues\n" + \ +"import importlib\n\n" + \ +"class TestClass(UITestCase):\n" + \ +"\tdef test_function(self):\n" + +self.variables.append(line) + +return f + +def compile(self): +self.ui_dsl_mm.register_obj_processors({ +'UNOCommand': self.handle_uno, +'StarterCommand': self.handle_start, +'CloseDialog': self.handle_Dialog, +'OpenModelessDialog': self.handle_Dialog, +'OpenModalDialog':self.handle_Dialog, +}) + +self.log_lines=self.get_log_file(self.input_address) + +def handle_uno(self, UNOCommand): +if(UNOCommand.prameters==None): +line = "\t\tself.xUITest.executeCommand(\"" + \ +UNOCommand.uno_command_name +"\")\n" +else: +paramaters="" +for p in UNOCommand.prameters.parameter_data : +paramaters = paramaters + "\"" + p.key + "\" : " + str(p.value) + " ," +paramaters = paramaters[:-1] + +line = "\t\tself.xUITest.executeCommandWithParameters(\"" + \ +UNOCommand.uno_command_name +"\", mkPropertyValues({"+ paramaters +"}) )\n" + +self.variables.append(line) + +def handle_start(self, StarterCommand): +line="\t\tMainDoc = self.ui_test.create_doc_in_start_center(\""+\ +StarterCommand.program_name+"\")\n" +self.variables.append(line) + +line="\t\tMainWindow = self.xUITest.getTopFocusWindow()\n" +self.variables.append(line) + +def handle_Dialog(self, DialogCommand): + +if (DialogCommand.__class__.__name__ == "OpenModalDialog"): +old_line = self.variables.pop() + +key_word=old_line[-9:-3] +if ( key_word == "Dialog"): +old_line="\t\tself.ui_test.execute_dialog_through_command(\""+\ +old_line[31:-3]+"\")\n" +self.variables.append(old_line) +line = "\t\t" + Dial
[Libreoffice-commits] core.git: Branch 'private/EL-SHREIF/ui_logger' - uitest/ui_logger_dsl vcl/source
uitest/ui_logger_dsl/General_commands.tx | 10 -- uitest/ui_logger_dsl/Special_commands.tx |2 +- uitest/ui_logger_dsl/dialog_commands.tx | 13 ++--- uitest/ui_logger_dsl/starter_commands.tx |1 + uitest/ui_logger_dsl/uno_commands.tx |5 +++-- vcl/source/window/dialog.cxx |4 ++-- 6 files changed, 21 insertions(+), 14 deletions(-) New commits: commit 4ef4e9237a0e9401b2c5d5ed8f5aaf79e6ebe180 Author: Ahmed ElShreif AuthorDate: Mon Jul 1 17:02:05 2019 +0200 Commit: Ahmed ElShreif CommitDate: Mon Jul 1 17:02:05 2019 +0200 Change small parts of the grammar and Dialog logger Change-Id: I615989baafe65a6f6ae26fcd452c1e21081168b4 diff --git a/uitest/ui_logger_dsl/General_commands.tx b/uitest/ui_logger_dsl/General_commands.tx index fb8f6115f450..1eb15f17733d 100644 --- a/uitest/ui_logger_dsl/General_commands.tx +++ b/uitest/ui_logger_dsl/General_commands.tx @@ -4,18 +4,16 @@ as we have starter command // also I make set zoom to be general as it will be better -*/ - -SpecialCommand: +*/ +GeneralCommand: SideBar | setZoom_command | Select_command ; - SideBar: 'From SIDEBAR ' 'Choose ' '{"PANEL":' name=STRING '}' ; setZoom_command: -'Set Zoom to ' zoom_value=INT +'Set Zoom to ' zoom_value=INT ; Select_command: 'Select ' '{"OBJECT":' name=STRING '}' -; \ No newline at end of file +; diff --git a/uitest/ui_logger_dsl/Special_commands.tx b/uitest/ui_logger_dsl/Special_commands.tx index 40113495ac9e..c6f0a1d3305e 100644 --- a/uitest/ui_logger_dsl/Special_commands.tx +++ b/uitest/ui_logger_dsl/Special_commands.tx @@ -18,7 +18,7 @@ SpecialCommand: then we can add whatever we need in the future */ writer_command: - Type_command | Select_command | setZoom_command | GOTO_command + Type_command | Select_command | GOTO_command ; Type_command: 'Type on writer' what_to_type=Type_options diff --git a/uitest/ui_logger_dsl/dialog_commands.tx b/uitest/ui_logger_dsl/dialog_commands.tx index abe32a53a992..a752442e5f1f 100644 --- a/uitest/ui_logger_dsl/dialog_commands.tx +++ b/uitest/ui_logger_dsl/dialog_commands.tx @@ -5,9 +5,16 @@ DialogCommand: ; OpenDialog: - 'Open' dialog_name=ID + OpenModalDialog | OpenModelessDialog +; +OpenModalDialog : + 'Open Modal ' dialog_name=ID +; +OpenModelessDialog : + 'Open Modeless ' dialog_name=ID ; - CloseDialog: - 'Close Dialog' + //the additional_note=STRING? if you need to add name in the future + //Also it's used to make instance of the command of type CloseDialog + 'Close Dialog' additional_note=STRING? ; diff --git a/uitest/ui_logger_dsl/starter_commands.tx b/uitest/ui_logger_dsl/starter_commands.tx index c2d6296569b9..0461b8d149bd 100644 --- a/uitest/ui_logger_dsl/starter_commands.tx +++ b/uitest/ui_logger_dsl/starter_commands.tx @@ -9,3 +9,4 @@ Program: "writer"|"calc"|"impress"|"draw"|"math"|"database" ; + diff --git a/uitest/ui_logger_dsl/uno_commands.tx b/uitest/ui_logger_dsl/uno_commands.tx index 5dca5514b237..1cf702de62a2 100644 --- a/uitest/ui_logger_dsl/uno_commands.tx +++ b/uitest/ui_logger_dsl/uno_commands.tx @@ -1,9 +1,10 @@ UNOCommand: -'Send UNO Command' '(' uno_command=STRING ')' prameters*=parameter +'Send UNO Command' '(' uno_command_name=STRING ')' (prameters=parameter)? ; parameter: '{' parameter_data *= data '}' ; data: -key=STRING ':' value=ID ',' +key=STRING ':' value= INT|ID ',' ; + diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index cd9f8d72d977..2039f59c4b87 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -988,9 +988,9 @@ bool Dialog::ImplStartExecute() aObject.EventName = "DialogExecute"; xEventBroadcaster->documentEventOccured(aObject); if (bModal) -UITestLogger::getInstance().log("Open " + get_id()); +UITestLogger::getInstance().log("Open Modal " + get_id()); else -UITestLogger::getInstance().log("Open " + get_id()); +UITestLogger::getInstance().log("Open Modeless " + get_id()); return true; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sfx2/source vcl/source
sfx2/source/control/unoctitm.cxx |2 vcl/source/uitest/logger.cxx | 82 --- vcl/source/uitest/uiobject.cxx | 68 +--- vcl/source/window/dialog.cxx |6 +- 4 files changed, 127 insertions(+), 31 deletions(-) New commits: commit 624530549f30572cb7fb137cbadecfab9a75fc8c Author: Ahmed ElShreif AuthorDate: Mon Jun 10 01:20:59 2019 +0200 Commit: Ahmed ElShreif CommitDate: Sat Jun 29 18:28:14 2019 +0200 Rewrite all the logger statements with the new grammar syntax Finished parts from old logger: 1) UNOCommands 2) StarterCommands 3) UIObjectCommand 4) DialogCommand 5) SpecialCommand Change-Id: Ia521efef0abe1a351b9a4fcabaab6dbf20e8fc89 diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index aba1357b0ddc..71cccb05d4e2 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -601,7 +601,7 @@ void collectUIInformation(const util::URL& rURL, const css::uno::Sequence< css:: if (!pFile) return; -UITestLogger::getInstance().logCommand("CommandSent Name:" + rURL.Complete, rArgs); +UITestLogger::getInstance().logCommand("Send UNO Command (\"" + rURL.Complete + "\") ", rArgs); } } diff --git a/vcl/source/uitest/logger.cxx b/vcl/source/uitest/logger.cxx index d100d1bbf125..742d8f4ab63a 100644 --- a/vcl/source/uitest/logger.cxx +++ b/vcl/source/uitest/logger.cxx @@ -213,8 +213,21 @@ void UITestLogger::logKeyInput(VclPtr const & xUIElement, const Key OUString aParentID = pParent->get_id(); -OUString aContent = pUIObject->get_type() + " Action:TYPE Id:" + -rID + " Parent:"+ aParentID +" " + aKeyCode; +OUString aContent; + +if(pUIObject->get_type()=="EditUIObject"){ +aContent = "Type on '" + rID + "' " + aKeyCode + " from " + aParentID ; +} +else if(pUIObject->get_type()=="SwEditWinUIObject" && rID=="writer_edit"){ +aContent = "Type on writer " + aKeyCode ; +} +else if(pUIObject->get_type()=="ScGridWinUIObject" && rID=="grid_window"){ +aContent = "Type on current cell " + aKeyCode ; +} +else{ +aContent= pUIObject->get_type() + " Action:TYPE Id:" + +rID + " Parent:"+ aParentID +" " + aKeyCode; +} maStream.WriteLine(OUStringToOString(aContent, RTL_TEXTENCODING_UTF8)); } @@ -240,16 +253,75 @@ OUString StringMapToOUString(const std::map& rParameters) return aParameterString.makeStringAndClear(); } +OUString GetValueInMapWithIndex(const std::map& rParameters,sal_Int32 index) +{ +sal_Int32 j=0; + +std::map::const_iterator itr = rParameters.begin(); + +for ( ; itr != rParameters.end() && jsecond; +} + + +OUString GetKeyInMapWithIndex(const std::map& rParameters,sal_Int32 index) +{ +sal_Int32 j=0; + +std::map::const_iterator itr = rParameters.begin(); + +for ( ; itr != rParameters.end() && jfirst; +} + } void UITestLogger::logEvent(const EventDescription& rDescription) { OUString aParameterString = StringMapToOUString(rDescription.aParameters); -OUString aLogLine = rDescription.aKeyWord + " Action:" + -rDescription.aAction + " Id:" + rDescription.aID + -" Parent:" + rDescription.aParent + aParameterString; +//here we will customize our statments depending on the caller of this function +OUString aLogLine ; + +if(rDescription.aID=="writer_edit"){ + +if(rDescription.aAction=="GOTO"){ +aLogLine = "GOTO page number " + GetValueInMapWithIndex(rDescription.aParameters,0); +} +else if(rDescription.aAction=="SET"){ +aLogLine = "Set Zoom to be " + GetValueInMapWithIndex(rDescription.aParameters,0); +} +else if(rDescription.aAction=="SELECT"){ +OUString to = GetValueInMapWithIndex(rDescription.aParameters,0); +OUString from = GetValueInMapWithIndex(rDescription.aParameters,1); +aLogLine = "Select from Pos " + from + " to " + to ; +} +} +else if(rDescription.aID=="grid_window"){ +if(rDescription.aAction=="SELECT"){ +OUString type = GetKeyInMapWithIndex(rDescription.aParameters,0); +if(type=="CELL" || type=="RANGE"){ +aLogLine = "Select from calc" + aParameterString ; +} +else if(type=="TABLE") +{ +aLogLine = "Switch to sheet number " + GetValueInMapWithIndex(rDescription.aParameters,0) ; +} +} +else if(rDescription.aAction=="LAUNCH"){ +aLogLine = "Lanuch AutoFilter from Col "+ +GetValueInMapWithIndex(rDescription.aParameters,2) + +" and Row " + GetValueInMapWithIndex(rDescription.aParameters,1); +} +} +else{ +aLogLine = rDescription.aKeyWord + " Action:" + +rDe
[Libreoffice-commits] core.git: Branch 'private/EL-SHREIF/ui_logger' - uitest/ui_logger_dsl vcl/source
uitest/ui_logger_dsl/General_commands.tx | 21 ++ uitest/ui_logger_dsl/Special_commands.tx | 39 +++--- uitest/ui_logger_dsl/ui_logger_dsl_grammar.tx |4 +- vcl/source/uitest/logger.cxx | 26 ++--- vcl/source/uitest/uiobject.cxx|4 +- 5 files changed, 81 insertions(+), 13 deletions(-) New commits: commit 690238b1a0a613cbb279a52b39100aca77631223 Author: Ahmed ElShreif AuthorDate: Mon Jun 24 11:40:17 2019 +0200 Commit: Ahmed ElShreif CommitDate: Mon Jun 24 11:40:17 2019 +0200 Some new features in ui_logger project this patch for: 1) general commands grammar 2) special commands of impress and math 3) log select element action 4) log SideBar Actions Change-Id: If375cd3396cfde45f70d7c202339c829b1c43471 diff --git a/uitest/ui_logger_dsl/General_commands.tx b/uitest/ui_logger_dsl/General_commands.tx new file mode 100644 index ..fb8f6115f450 --- /dev/null +++ b/uitest/ui_logger_dsl/General_commands.tx @@ -0,0 +1,21 @@ +/* +This file for the log statments that is general for all application +we can use it as general commands then relate it to its application +as we have starter command +// +also I make set zoom to be general as it will be better +*/ + +SpecialCommand: +SideBar | setZoom_command | Select_command +; + +SideBar: +'From SIDEBAR ' 'Choose ' '{"PANEL":' name=STRING '}' +; +setZoom_command: +'Set Zoom to ' zoom_value=INT +; +Select_command: +'Select ' '{"OBJECT":' name=STRING '}' +; \ No newline at end of file diff --git a/uitest/ui_logger_dsl/Special_commands.tx b/uitest/ui_logger_dsl/Special_commands.tx index b73fddf805a4..40113495ac9e 100644 --- a/uitest/ui_logger_dsl/Special_commands.tx +++ b/uitest/ui_logger_dsl/Special_commands.tx @@ -4,7 +4,7 @@ import type_options */ SpecialCommand: - writer_command | calc_command + writer_command | calc_command | impress_command | math_command ; /* @@ -26,9 +26,6 @@ Type_command: Select_command: 'Select from Pos' from=INT 'to Pos' to=INT ; -setZoom_command: - 'Set Zoom to ' zoom_value=INT -; GOTO_command: 'GOTO page number' page_num=INT ; @@ -68,4 +65,38 @@ one_cell: '{' '"CELL":' input_cell=STRING '}' ; //=// +/* + This part for all the impress log statments: + +1) Type +3) Set zoom + + then we can add whatever we need in the future +*/ +impress_command: +impress_Type_command +; +impress_Type_command: +'Type on impress ' what_to_type=Type_options +; +//=// +/* + This part for all the math log statments: + +1) element selector +2) Type + + then we can add whatever we need in the future +*/ +math_command: +element_selector | math_Type_command +; +element_selector: +'Select element no ' element_no=INT ' From ' place=ID +; +math_Type_command: +'Type on math ' what_to_type=Type_options +; + + diff --git a/uitest/ui_logger_dsl/ui_logger_dsl_grammar.tx b/uitest/ui_logger_dsl/ui_logger_dsl_grammar.tx index 516ee8694923..ffde0c4c1525 100644 --- a/uitest/ui_logger_dsl/ui_logger_dsl_grammar.tx +++ b/uitest/ui_logger_dsl/ui_logger_dsl_grammar.tx @@ -5,14 +5,14 @@ import starter_commands import uno_commands import UI_Object_commands import Special_commands - +import General_commands UILogger: commands*=Command ; Command: - UNOCommand | StarterCommand | UIObjectCommand | DialogCommand | SpecialCommand + UNOCommand | StarterCommand | UIObjectCommand | DialogCommand | SpecialCommand | GeneralCommand ; Comment: diff --git a/vcl/source/uitest/logger.cxx b/vcl/source/uitest/logger.cxx index 3c664b76db98..4b3f69245ae6 100644 --- a/vcl/source/uitest/logger.cxx +++ b/vcl/source/uitest/logger.cxx @@ -224,6 +224,12 @@ void UITestLogger::logKeyInput(VclPtr const & xUIElement, const Key else if(pUIObject->get_type()=="ScGridWinUIObject" && rID=="grid_window"){ aContent = "Type on current cell " + aKeyCode ; } +else if(pUIObject->get_type()=="ImpressWindowUIObject" && rID=="impress_win"){ +aContent = "Type on impress " + aKeyCode ; +} +else if(pUIObject->get_type()=="WindowUIObject" && rID=="math_edit"){ +aContent = "Type on math " + aKeyCode ; +} else{ aContent= pUIObject->get_type() + " Action:TYPE Id:" + rID + " Parent:"+ aParentID +" " + aKeyCode; @@ -284,15 +290,21 @@ void UITestLogger::logEvent(const EventDescription& rDescription) //here we will customize our statments depending on the caller of this function OUString aLogLine ; - -if(rDescription.aID=="writer_edit"){ +//first check on general commands +if(rDescription.aAction=="SET"){ +aLogLine = "Set Zoom to be " + GetValueInMapWithInde
[Libreoffice-commits] core.git: Changes to 'private/EL-SHREIF/ui_logger'
New branch 'private/EL-SHREIF/ui_logger' available with the following commits: commit 111d9c89c8a062f06766f717305a94be9d8bf52c Author: Ahmed ElShreif Date: Mon Jun 24 00:54:19 2019 +0200 just update zoom statement Change-Id: I0bc5c4179dcb94ed2cc4a551165fd135d884a75a commit acbba67460fd30debd3e387758a55177aec96c58 Author: Ahmed ElShreif Date: Sun Jun 23 23:45:50 2019 +0200 update the grammar Change-Id: I15fe20f1c5e8339f6d5a857b0d0bbfa30b09b44a commit 2d7d76e62eea426b9e752fee60c9e06606843ff4 Author: Ahmed ElShreif Date: Sun Jun 23 23:14:14 2019 +0200 new logger DSL grammar This patch is the first and second parts of the new DSL grammar. The grammar of all the UIObjects , Dialogs , starter commands , All of uno commands and Special commands for applications. example.ul shows an example of the new syntax of the expected new logger. Change-Id: Ib58aeab1da6627ebc464e4cb64253fd3bf91200e commit a3be03242d724dd1dcb5a3bcbec8acf427dea196 Author: Ahmed ElShreif Date: Mon Jun 10 01:20:59 2019 +0200 Rewrite all the logger statements with the new grammar syntax Finished parts from old logger: 1) UNOCommands 2) StarterCommands 3) UIObjectCommand 4) DialogCommand 5) SpecialCommand Change-Id: Ia521efef0abe1a351b9a4fcabaab6dbf20e8fc89 ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits