[Libreoffice-commits] core.git: uitest/ui_logger_dsl vcl/source
uitest/ui_logger_dsl/UI_Object_commands.tx | 24 +--- vcl/source/control/ivctrl.cxx |5 ++--- vcl/source/uitest/logger.cxx |2 +- 3 files changed, 16 insertions(+), 15 deletions(-) New commits: commit bcc83732f906bb7e89f8d67e4817fe0f4bf09b0e Author: Ilmari Lauhakangas AuthorDate: Thu Feb 17 18:25:20 2022 +0200 Commit: Ilmari Lauhakangas CommitDate: Sat Feb 19 08:03:31 2022 +0100 uilogger: make vertical tab handling more robust For example hyperlink dialog does not have numeric ids for tabs. Now the rule matches both integers and "common identifiers" as per https://textx.github.io/textX/stable/grammar/#textx-base-types Parent argument was removed as it does not seem to be used and it was empty in the case of the hyperlink dialog, causing the DSL parser to fail. More work is needed as self.xUITest.getTopFocusWindow() in a hyperlink dialog opening test does not contain the child "tabcontrol" and thus it errors out. Change-Id: I1637f7300884881ee4d869e8f04700e56935f2d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130111 Tested-by: Jenkins Reviewed-by: Ilmari Lauhakangas diff --git a/uitest/ui_logger_dsl/UI_Object_commands.tx b/uitest/ui_logger_dsl/UI_Object_commands.tx index 04f975a39066..f3d5d42903e5 100644 --- a/uitest/ui_logger_dsl/UI_Object_commands.tx +++ b/uitest/ui_logger_dsl/UI_Object_commands.tx @@ -1,7 +1,7 @@ import type_options /* -this file is for The Grammar of: +this file is for The Grammar of: 1) ButtonUIObject : ( Click event ) 2) EditUIObject : ( Type event - Clear event - Select Text event ) 3) CheckBoxUIObject : ( Toggle the value ) @@ -16,26 +16,28 @@ import type_options */ UIObjectCommand: - ButtonUIObject | CheckBoxUIObject | EditUIObject | - RadioButtonUIObject | ListBoxUIObject | ComboBoxUIObject | + ButtonUIObject | CheckBoxUIObject | EditUIObject | + RadioButtonUIObject | ListBoxUIObject | ComboBoxUIObject | SpinFieldUIObject | TabControlUIObject | ToolBoxUIObject | ValueSetUIObject | MenuBtnUIObject ; - +TabPageNumber: + INT | ID +; ButtonUIObject: '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=TabPageNumber 'in' tab_id=STRING ('from' parent_id=ID)? ; EditUIObject: action=action_on_UIObject ('from' parent_id=ID)? diff --git a/vcl/source/control/ivctrl.cxx b/vcl/source/control/ivctrl.cxx index dc55deed29d4..54b64373cde0 100644 --- a/vcl/source/control/ivctrl.cxx +++ b/vcl/source/control/ivctrl.cxx @@ -36,13 +36,12 @@ using namespace ::com::sun::star::accessibility; namespace { -void collectUIInformation( const OUString& aID, const OUString& aPos , const OUString& aParent ) +void collectUIInformation( const OUString& aID, const OUString& aPos) { EventDescription aDescription; aDescription.aID = aID; aDescription.aParameters = {{ "POS" , aPos}}; aDescription.aAction = "SELECT"; -aDescription.aParent = aParent; aDescription.aKeyWord = "VerticalTab"; UITestLogger::getInstance().logEvent(aDescription); } @@ -544,7 +543,7 @@ void VerticalTabControl::SetCurPageId(const OString& rId) ActivatePage(); pNewData->xPage->Show(); } - collectUIInformation(get_id(),OStringToOUString(m_sCurrentPageId,RTL_TEXTENCODING_UTF8), GetPageParent()->get_id()); + collectUIInformation(get_id(),OStringToOUString(m_sCurrentPageId,RTL_TEXTENCODING_UTF8)); } const OString & VerticalTabControl::GetPageId(sal_uInt16 nIndex) const diff --git a/vcl/source/uitest/logger.cxx b/vcl/source/uitest/logger.cxx index 4eef2ee0ebb1..29520fd61331 100644 --- a/vcl/source/uitest/logger.cxx +++ b/vcl/source/uitest/logger.cxx @@ -598,7 +598,7 @@ void UITestLogger::logEvent(const EventDescription& rDescription) else if (rDescription.aKeyWord == "VerticalTab") { aLogLine = "Choose Tab number " + GetValueInMapWithIndex(rDescription.aParameters, 0) - + " in '" + rDescription.aID + "' from " + rDescription.aParent; + + " in '" + rDescription.aID + "'"; } else {
[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, +
[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, -