From 08e2e7c3ea16f08fce07346a748ed0513565e534 Mon Sep 17 00:00:00 2001 From: HelioGuilherme66 Date: Sat, 17 Aug 2024 03:38:11 +0100 Subject: [PATCH 01/11] New transform_doc_language function. WIP --- src/robotide/editor/texteditor.py | 41 ++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/src/robotide/editor/texteditor.py b/src/robotide/editor/texteditor.py index a1e30b618..d49b84b1f 100644 --- a/src/robotide/editor/texteditor.py +++ b/src/robotide/editor/texteditor.py @@ -40,7 +40,7 @@ from ..widgets import TextField, Label, HtmlDialog from ..widgets import VerticalSizer, HorizontalSizer, ButtonWithHandler, RIDEDialog -from robotide.lib.compat.parsing.language import Language +from robotide.lib.compat.parsing.language import Language, get_headers_for, get_settings_for, get_language_name robotframeworklexer = None if Language: try: # import our modified version @@ -125,6 +125,39 @@ def get_rf_lang_code(lang: (str, list)) -> str: return clean_lang[0].title() +def transform_doc_language(old_lang, new_lang, m_text): + print(f"DEBUG: texteditor.py transform_doc_language ENTER old_lang={old_lang} new_lang={new_lang}" + f"\n T old_lang={type(old_lang)} T new_lang={type(new_lang)}") + if isinstance(old_lang, list): + old_lang = old_lang[0] + if isinstance(new_lang, list): + new_lang = new_lang[0] + old_lang = old_lang.title() + new_lang = new_lang.title() + if old_lang == new_lang: + return m_text + try: + old_lang_class = Language.from_name(old_lang) + except ValueError as ex: + print(ex) + return m_text + try: + new_lang_class = Language.from_name(new_lang) + except ValueError as ex: + print(ex) + return m_text + old_lang_name = old_lang_class.name + old_lang_headers = old_lang_class.headers + new_lang_name = new_lang_class.name + new_lang_headers = new_lang_class.headers + if old_lang_name == new_lang_name: + return m_text + print(f"DEBUG: texteditor.py transform_doc_language old_lang_name={old_lang_name} " + f"headers={old_lang_headers}\n new_lang_name={new_lang_name}" + f" headers={new_lang_headers}") + return m_text + + class TextEditorPlugin(Plugin, TreeAwarePluginMixin): title = PLUGIN_NAME @@ -397,6 +430,12 @@ def validate_and_update(self, data, text, lang='en'): # f"set to={self._doc_language}") self._editor.language = self._doc_language + # if initial_lang[0].lower() != self._doc_language[0].lower(): + print(f"DEBUG: textedit.py validate_and_update Language in doc--> lang={self._doc_language}" + f" initial_lang={initial_lang}") + m_text = transform_doc_language(initial_lang, self._doc_language, m_text) + + print(f"DEBUG: textedit.py validate_and_update AFTER TRANSFORM m_text={m_text}") result = self._sanity_check(data, m_text) if isinstance(result, tuple): handled = self._handle_sanity_check_failure(result) From a55c33fc42bc46c43b83524a1e2db98df7a134e0 Mon Sep 17 00:00:00 2001 From: HelioGuilherme66 Date: Mon, 19 Aug 2024 18:52:02 +0100 Subject: [PATCH 02/11] More DEBUG in transform_doc_language function. WIP --- src/robotide/editor/texteditor.py | 110 ++++++++++++++----- src/robotide/lib/compat/parsing/validator.py | 4 +- 2 files changed, 82 insertions(+), 32 deletions(-) diff --git a/src/robotide/editor/texteditor.py b/src/robotide/editor/texteditor.py index d49b84b1f..4019b7be2 100644 --- a/src/robotide/editor/texteditor.py +++ b/src/robotide/editor/texteditor.py @@ -40,7 +40,7 @@ from ..widgets import TextField, Label, HtmlDialog from ..widgets import VerticalSizer, HorizontalSizer, ButtonWithHandler, RIDEDialog -from robotide.lib.compat.parsing.language import Language, get_headers_for, get_settings_for, get_language_name +from robotide.lib.compat.parsing.language import Language, get_headers_for, get_settings_for, get_language_name, get_english_label robotframeworklexer = None if Language: try: # import our modified version @@ -125,9 +125,9 @@ def get_rf_lang_code(lang: (str, list)) -> str: return clean_lang[0].title() -def transform_doc_language(old_lang, new_lang, m_text): +def transform_doc_language(old_lang, new_lang, m_text, node_info: tuple =('', )): print(f"DEBUG: texteditor.py transform_doc_language ENTER old_lang={old_lang} new_lang={new_lang}" - f"\n T old_lang={type(old_lang)} T new_lang={type(new_lang)}") + f"\n T old_lang={type(old_lang)} T new_lang={type(new_lang)}, node_info={node_info}") if isinstance(old_lang, list): old_lang = old_lang[0] if isinstance(new_lang, list): @@ -146,15 +146,43 @@ def transform_doc_language(old_lang, new_lang, m_text): except ValueError as ex: print(ex) return m_text - old_lang_name = old_lang_class.name - old_lang_headers = old_lang_class.headers - new_lang_name = new_lang_class.name - new_lang_headers = new_lang_class.headers + old_lang_name = old_lang_class.name or 'English' + new_lang_name = new_lang_class.name or 'English' if old_lang_name == new_lang_name: return m_text - print(f"DEBUG: texteditor.py transform_doc_language old_lang_name={old_lang_name} " - f"headers={old_lang_headers}\n new_lang_name={new_lang_name}" - f" headers={new_lang_headers}") + old_lang_headers = old_lang_class.headers + old_lang_bdd_prefixes = old_lang_class.bdd_prefixes + new_lang_headers = new_lang_class.headers + new_lang_bdd_prefixes = new_lang_class.bdd_prefixes + print(f"DEBUG: texteditor.py transform_doc_language\n old_lang_name={old_lang_name} old_lang={old_lang} " + f"new_lang={new_lang}\n" + f"headers={old_lang_headers}\n old_lang_bdd_prefixes={old_lang_bdd_prefixes}\nnew_lang_name={new_lang_name}" + f"\nheaders={new_lang_headers}\nnew_lang_bdd_prefixes={new_lang_bdd_prefixes}") + if node_info != ('', ): + if node_info[0] == 'ERROR': + line = node_info[1] + print(f"DEBUG: textedit.py transform_doc_language ERROR: {line}") + if line.startswith('Language: '): + tail = line.replace('Language: ', '') + m_text = m_text.replace('Language: ' + tail, 'Language: English' + ' # ' + tail) + for old, en in zip(old_lang_headers.keys(), old_lang_headers.values()): + m_text = m_text.replace(old, en) + if node_info[0] == 'INVALID_HEADER': + print(f"DEBUG: textedit.py transform_doc_language INVALID_HEADER: {node_info[1]}") + old_header = node_info[1].split(',')[1] + old_header = old_header.replace('* ', '').replace(' *', '').replace('*', '').strip('\' ') + # en_label = get_english_label(old_lang, old_header) + headers = list(old_lang_headers.keys()) + print(f"DEBUG: language.py get_english_label headers list={headers}\n old_header=\"{old_header}\"") + try: + idx = headers.index(old_header) + except ValueError: + print(f"DEBUG: language.py get_english_label Exception at getting index {old_lang} returning= m_text") + return m_text + en_label = list(old_lang_headers.values())[idx] + new_header = list(new_lang_headers.keys())[idx] + print(f"DEBUG: textedit.py transform_doc_language OLD_HEADER: {old_header} en_label={en_label} {new_header=}") + m_text = m_text.replace(old_header, new_header) return m_text @@ -237,6 +265,7 @@ def _open(self): if hasattr(datafile_controller, 'language'): if datafile_controller.language is not None: self._doc_language = self._editor.language = datafile_controller.language + print(f"DEBUG: texteditor _open SET FROM CONTROLLER language={self._doc_language}") else: self._doc_language = self._editor.language = ['en'] # print(f"DEBUG: texteditor _open language={self._doc_language}") @@ -361,7 +390,8 @@ def on_tab_changed(self, event): def _apply_txt_changes_to_model(self): self._editor.is_saving = False - if not self._editor.content_save(): + print(f"DEBUG: textedit.py _apply_txt_changes_to_model CALLl content_save lang={self._doc_language}") + if not self._editor.content_save(lang=self._doc_language): return False self._editor.reset() self._editor.set_editor_caret_position() @@ -415,8 +445,9 @@ def set_editor(self, editor): self._editor = editor def validate_and_update(self, data, text, lang='en'): + from robotide.lib.robot.errors import DataError m_text = text.decode("utf-8") - initial_lang = self._doc_language or lang + initial_lang = lang # self._doc_language or if "Language: " in m_text: try: self._doc_language = obtain_language(lang, text) @@ -430,13 +461,18 @@ def validate_and_update(self, data, text, lang='en'): # f"set to={self._doc_language}") self._editor.language = self._doc_language - # if initial_lang[0].lower() != self._doc_language[0].lower(): - print(f"DEBUG: textedit.py validate_and_update Language in doc--> lang={self._doc_language}" - f" initial_lang={initial_lang}") - m_text = transform_doc_language(initial_lang, self._doc_language, m_text) + try: + result = self._sanity_check(data, m_text) # First check + print(f"DEBUG: textedit.py validate_and_update Language after sanity_check result={result}") + except DataError as err: + result = (err.message, err.details) - print(f"DEBUG: textedit.py validate_and_update AFTER TRANSFORM m_text={m_text}") - result = self._sanity_check(data, m_text) + if isinstance(result, tuple): + print(f"DEBUG: textedit.py validate_and_update Language in doc--> lang={self._doc_language}" + f" initial_lang={initial_lang}") + m_text = transform_doc_language(initial_lang, self._doc_language, m_text, node_info=result) + print(f"DEBUG: textedit.py validate_and_update AFTER TRANSFORM m_text=\n{m_text}") + result = self._sanity_check(data, m_text) # Check if language chamged and is valid content if isinstance(result, tuple): handled = self._handle_sanity_check_failure(result) if not handled: @@ -463,25 +499,38 @@ def _sanity_check(self, data, text): from robotide.lib.compat.parsing import ErrorReporter from robot.parsing.parser.parser import get_model from robotide.lib.robot.errors import DataError - + result = None rf_lang = get_rf_lang_code(self._doc_language) - # print(f"DEBUG: textedit.py _sanity_check data is type={type(data)} lang={self._doc_language}," - # f" transformed lang={rf_lang}") + print(f"DEBUG: textedit.py _sanity_check data is type={type(data)} lang={self._doc_language}," + f" transformed lang={rf_lang}") try: model = get_model(text, lang=rf_lang) except AttributeError: return "Failed validation by Robot Framework", "Please, check if Language setting is valid!" - # print(f"DEBUG: textedit.py _sanity_check model is {model} doc language={self._doc_language}") + print(f"DEBUG: textedit.py _sanity_check model is {repr(model)} doc language={self._doc_language}\n" + f"NEXT is the get_tokens output") + from robot.api.parsing import get_tokens + for token in get_tokens(text): + print(repr(token)) + if token.type == token.ERROR: + print("DEBUG: textedit.py _sanity_check TOKEN in ERROR") + result = 'ERROR', repr(token) + # raise DataError('ERROR', repr(token)) + if token.type == token.INVALID_HEADER: + print("DEBUG: textedit.py _sanity_check TOKEN in INVALID_HEADER") + result = 'INVALID_HEADER', repr(token) + raise DataError('INVALID_HEADER', repr(token)) + if result: + return result validator = ErrorReporter() - result = None try: validator.visit(model) except DataError as err: result = (err.message, err.details) model.save("/tmp/model_saved_from_RIDE.robot") - # print(f"DEBUG: textedit.py _sanity_check after calling validator {validator}\n" - # f"Save model in /tmp/model_saved_from_RIDE.robot" - # f" result={result}") + print(f"DEBUG: textedit.py _sanity_check after calling validator {validator}\n" + f"Save model in /tmp/model_saved_from_RIDE.robot" + f" result={result}") return True if not result else result """ DEBUG @@ -941,7 +990,7 @@ def open(self, data): self.language = self._data._doc_language else: self.language = ['en'] - # print(f"DEBUG: texteditor.py SourceEditor open ENTER language={self.language}") + print(f"DEBUG: texteditor.py SourceEditor open ENTER language={self.language}") try: if isinstance(self._data.wrapper_data, ResourceFileController): self._controller_for_context = DummyController(self._data.wrapper_data, self._data.wrapper_data) @@ -1101,15 +1150,15 @@ def reset(self): if self._data and not self._data.wrapper_data.is_dirty: self.mark_file_dirty(False) - def content_save(self, *args): - _ = args + def content_save(self, **args): + # _ = args self.store_position() if self.dirty and not self.is_saving: self.is_saving = True # print(f"DEBUG: TextEditor.py SourceEditor content_save content={self.source_editor.utf8_text}\n" # f"self.language={self.language} data={self._data}") if not self._data_validator.validate_and_update(self._data, self.source_editor.utf8_text, - lang=self.language): + lang=args['lang']): #self.language) self.is_saving = False return False return True @@ -1273,6 +1322,7 @@ def GetFocus(self, event): def revert(self): self.reset() + self.source_editor.Undo() self.source_editor.set_text(self._data.content) def on_editor_key(self, event): diff --git a/src/robotide/lib/compat/parsing/validator.py b/src/robotide/lib/compat/parsing/validator.py index 570e82d27..0cb9f77f4 100644 --- a/src/robotide/lib/compat/parsing/validator.py +++ b/src/robotide/lib/compat/parsing/validator.py @@ -6,8 +6,8 @@ class ErrorReporter(ModelVisitor): def generic_visit(self, node): if node.errors: - # print(f"DEBUG: validator.py ErrorReporter: Error on line {node.lineno}:") + print(f"DEBUG: validator.py ErrorReporter: Error on line {node.lineno}:") for error in node.errors: - # print(f"- {error}") + print(f"- {error}") raise DataError(message=error,details=node.lineno) ModelVisitor.generic_visit(self, node) From 9c853fce642d574f4ef3ee008f7b29dbca90d5be Mon Sep 17 00:00:00 2001 From: HelioGuilherme66 Date: Tue, 20 Aug 2024 03:12:43 +0100 Subject: [PATCH 03/11] Working changes to good language and unknown transform_doc_language function. WIP --- src/robotide/editor/texteditor.py | 65 ++++++++++++++++++------------- 1 file changed, 37 insertions(+), 28 deletions(-) diff --git a/src/robotide/editor/texteditor.py b/src/robotide/editor/texteditor.py index 4019b7be2..0d60c601e 100644 --- a/src/robotide/editor/texteditor.py +++ b/src/robotide/editor/texteditor.py @@ -140,14 +140,16 @@ def transform_doc_language(old_lang, new_lang, m_text, node_info: tuple =('', )) old_lang_class = Language.from_name(old_lang) except ValueError as ex: print(ex) - return m_text + # return m_text # DEBUG: + old_lang_class = Language.from_name('English') try: new_lang_class = Language.from_name(new_lang) except ValueError as ex: print(ex) - return m_text - old_lang_name = old_lang_class.name or 'English' - new_lang_name = new_lang_class.name or 'English' + # return m_text # DEBUG: + new_lang_class = Language.from_name('English') + old_lang_name = old_lang_class.name + new_lang_name = new_lang_class.name if old_lang_name == new_lang_name: return m_text old_lang_headers = old_lang_class.headers @@ -160,24 +162,25 @@ def transform_doc_language(old_lang, new_lang, m_text, node_info: tuple =('', )) f"\nheaders={new_lang_headers}\nnew_lang_bdd_prefixes={new_lang_bdd_prefixes}") if node_info != ('', ): if node_info[0] == 'ERROR': - line = node_info[1] - print(f"DEBUG: textedit.py transform_doc_language ERROR: {line}") + c_msg = node_info[1].replace('Token(', '').replace(')', '').split(',') + line = c_msg[1].replace('\'', '').strip() + # print(f"DEBUG: textedit.py transform_doc_language ERROR:{line}") if line.startswith('Language: '): tail = line.replace('Language: ', '') + # print(f"DEBUG: textedit.py transform_doc_language INSIDE BLOCK {tail=}") m_text = m_text.replace('Language: ' + tail, 'Language: English' + ' # ' + tail) for old, en in zip(old_lang_headers.keys(), old_lang_headers.values()): m_text = m_text.replace(old, en) + return m_text if node_info[0] == 'INVALID_HEADER': - print(f"DEBUG: textedit.py transform_doc_language INVALID_HEADER: {node_info[1]}") + # print(f"DEBUG: textedit.py transform_doc_language INVALID_HEADER: {node_info[1]}") old_header = node_info[1].split(',')[1] old_header = old_header.replace('* ', '').replace(' *', '').replace('*', '').strip('\' ') - # en_label = get_english_label(old_lang, old_header) headers = list(old_lang_headers.keys()) - print(f"DEBUG: language.py get_english_label headers list={headers}\n old_header=\"{old_header}\"") try: idx = headers.index(old_header) except ValueError: - print(f"DEBUG: language.py get_english_label Exception at getting index {old_lang} returning= m_text") + # print(f"DEBUG: language.py get_english_label Exception at getting index {old_lang} returning= m_text") return m_text en_label = list(old_lang_headers.values())[idx] new_header = list(new_lang_headers.keys())[idx] @@ -265,7 +268,7 @@ def _open(self): if hasattr(datafile_controller, 'language'): if datafile_controller.language is not None: self._doc_language = self._editor.language = datafile_controller.language - print(f"DEBUG: texteditor _open SET FROM CONTROLLER language={self._doc_language}") + # print(f"DEBUG: texteditor _open SET FROM CONTROLLER language={self._doc_language}") else: self._doc_language = self._editor.language = ['en'] # print(f"DEBUG: texteditor _open language={self._doc_language}") @@ -390,7 +393,7 @@ def on_tab_changed(self, event): def _apply_txt_changes_to_model(self): self._editor.is_saving = False - print(f"DEBUG: textedit.py _apply_txt_changes_to_model CALLl content_save lang={self._doc_language}") + print(f"DEBUG: textedit.py _apply_txt_changes_to_model CALL content_save lang={self._doc_language}") if not self._editor.content_save(lang=self._doc_language): return False self._editor.reset() @@ -447,7 +450,7 @@ def set_editor(self, editor): def validate_and_update(self, data, text, lang='en'): from robotide.lib.robot.errors import DataError m_text = text.decode("utf-8") - initial_lang = lang # self._doc_language or + initial_lang = lang if lang is not None else self._doc_language # self._doc_language or if "Language: " in m_text: try: self._doc_language = obtain_language(lang, text) @@ -463,7 +466,7 @@ def validate_and_update(self, data, text, lang='en'): try: result = self._sanity_check(data, m_text) # First check - print(f"DEBUG: textedit.py validate_and_update Language after sanity_check result={result}") + # print(f"DEBUG: textedit.py validate_and_update Language after sanity_check result={result}") except DataError as err: result = (err.message, err.details) @@ -472,7 +475,10 @@ def validate_and_update(self, data, text, lang='en'): f" initial_lang={initial_lang}") m_text = transform_doc_language(initial_lang, self._doc_language, m_text, node_info=result) print(f"DEBUG: textedit.py validate_and_update AFTER TRANSFORM m_text=\n{m_text}") - result = self._sanity_check(data, m_text) # Check if language chamged and is valid content + try: + result = self._sanity_check(data, m_text) # Check if language changed and is valid content + except DataError as err: + result = (err.message, err.details) if isinstance(result, tuple): handled = self._handle_sanity_check_failure(result) if not handled: @@ -503,34 +509,33 @@ def _sanity_check(self, data, text): rf_lang = get_rf_lang_code(self._doc_language) print(f"DEBUG: textedit.py _sanity_check data is type={type(data)} lang={self._doc_language}," f" transformed lang={rf_lang}") - try: - model = get_model(text, lang=rf_lang) - except AttributeError: - return "Failed validation by Robot Framework", "Please, check if Language setting is valid!" - print(f"DEBUG: textedit.py _sanity_check model is {repr(model)} doc language={self._doc_language}\n" - f"NEXT is the get_tokens output") from robot.api.parsing import get_tokens for token in get_tokens(text): print(repr(token)) if token.type == token.ERROR: print("DEBUG: textedit.py _sanity_check TOKEN in ERROR") result = 'ERROR', repr(token) + return result # raise DataError('ERROR', repr(token)) if token.type == token.INVALID_HEADER: print("DEBUG: textedit.py _sanity_check TOKEN in INVALID_HEADER") result = 'INVALID_HEADER', repr(token) - raise DataError('INVALID_HEADER', repr(token)) - if result: - return result + return result + # raise DataError('INVALID_HEADER', repr(token)) + + try: + model = get_model(text, lang=rf_lang) + except AttributeError: + return "Failed validation by Robot Framework", "Please, check if Language setting is valid!" validator = ErrorReporter() try: validator.visit(model) except DataError as err: result = (err.message, err.details) model.save("/tmp/model_saved_from_RIDE.robot") - print(f"DEBUG: textedit.py _sanity_check after calling validator {validator}\n" - f"Save model in /tmp/model_saved_from_RIDE.robot" - f" result={result}") + # print(f"DEBUG: textedit.py _sanity_check after calling validator {validator}\n" + # f"Save model in /tmp/model_saved_from_RIDE.robot" + # f" result={result}") return True if not result else result """ DEBUG @@ -550,6 +555,10 @@ def _normalize(text): """ def _handle_sanity_check_failure(self, message): + if message[1].startswith('Token('): + c_msg = message[1].replace('Token(', '').replace(')', '').split(',') + message = [" ".join(c_msg[4:]), c_msg[2].strip()] + if self._last_answer == wx.ID_NO and time() - self._last_answer_time <= 0.2: # self.source_editor._mark_file_dirty(True) return False @@ -1323,7 +1332,7 @@ def GetFocus(self, event): def revert(self): self.reset() self.source_editor.Undo() - self.source_editor.set_text(self._data.content) + # self.source_editor.set_text(self._data.content) def on_editor_key(self, event): if not self.is_focused(): From fe8935c0b226edbcbb85f96bc04c81dec0d8dfcd Mon Sep 17 00:00:00 2001 From: HelioGuilherme66 Date: Wed, 21 Aug 2024 01:49:10 +0100 Subject: [PATCH 04/11] Full doc tanslated, but needs individual settings transform_doc_language function. WIP --- src/robotide/editor/texteditor.py | 57 +++++++++++++++++++++++++------ 1 file changed, 47 insertions(+), 10 deletions(-) diff --git a/src/robotide/editor/texteditor.py b/src/robotide/editor/texteditor.py index 0d60c601e..bd0c2cb37 100644 --- a/src/robotide/editor/texteditor.py +++ b/src/robotide/editor/texteditor.py @@ -14,7 +14,7 @@ # limitations under the License. import builtins import os -import string +import re from io import StringIO, BytesIO from time import time @@ -156,10 +156,29 @@ def transform_doc_language(old_lang, new_lang, m_text, node_info: tuple =('', )) old_lang_bdd_prefixes = old_lang_class.bdd_prefixes new_lang_headers = new_lang_class.headers new_lang_bdd_prefixes = new_lang_class.bdd_prefixes + old_lang_settings = old_lang_class.settings + new_lang_settings = new_lang_class.settings + old_lang_given_prefixes = old_lang_class.given_prefixes + old_lang_when_prefixes = old_lang_class.when_prefixes + old_lang_then_prefixes = old_lang_class.then_prefixes + old_lang_and_prefixes = old_lang_class.and_prefixes + old_lang_but_prefixes = old_lang_class.but_prefixes + new_lang_given_prefixes = new_lang_class.given_prefixes + new_lang_when_prefixes = new_lang_class.when_prefixes + new_lang_then_prefixes = new_lang_class.then_prefixes + new_lang_and_prefixes = new_lang_class.and_prefixes + new_lang_but_prefixes = new_lang_class.but_prefixes + old_true_strings = old_lang_class.true_strings + old_false_strings = old_lang_class.false_strings + new_true_strings = new_lang_class.true_strings + new_false_strings = new_lang_class.false_strings print(f"DEBUG: texteditor.py transform_doc_language\n old_lang_name={old_lang_name} old_lang={old_lang} " f"new_lang={new_lang}\n" f"headers={old_lang_headers}\n old_lang_bdd_prefixes={old_lang_bdd_prefixes}\nnew_lang_name={new_lang_name}" - f"\nheaders={new_lang_headers}\nnew_lang_bdd_prefixes={new_lang_bdd_prefixes}") + f"\nheaders={new_lang_headers}\nnew_lang_bdd_prefixes={new_lang_bdd_prefixes}\n") + print(f"DEBUG: texteditor.py transform_doc_language\n{old_lang_settings=}\n{new_lang_settings=}\n") + print(f"DEBUG: texteditor.py transform_doc_language\n{old_true_strings=} {old_false_strings=}\n" + f"{new_true_strings=} {new_false_strings=}") if node_info != ('', ): if node_info[0] == 'ERROR': c_msg = node_info[1].replace('Token(', '').replace(')', '').split(',') @@ -169,9 +188,7 @@ def transform_doc_language(old_lang, new_lang, m_text, node_info: tuple =('', )) tail = line.replace('Language: ', '') # print(f"DEBUG: textedit.py transform_doc_language INSIDE BLOCK {tail=}") m_text = m_text.replace('Language: ' + tail, 'Language: English' + ' # ' + tail) - for old, en in zip(old_lang_headers.keys(), old_lang_headers.values()): - m_text = m_text.replace(old, en) - return m_text + """ if node_info[0] == 'INVALID_HEADER': # print(f"DEBUG: textedit.py transform_doc_language INVALID_HEADER: {node_info[1]}") old_header = node_info[1].split(',')[1] @@ -186,6 +203,26 @@ def transform_doc_language(old_lang, new_lang, m_text, node_info: tuple =('', )) new_header = list(new_lang_headers.keys())[idx] print(f"DEBUG: textedit.py transform_doc_language OLD_HEADER: {old_header} en_label={en_label} {new_header=}") m_text = m_text.replace(old_header, new_header) + """ + + for old, new in zip(old_lang_headers.keys(), new_lang_headers.keys()): + m_text = re.sub(fr'\b{old}\b', new, m_text) + for old, new in zip(old_lang_settings.keys(), new_lang_settings.keys()): + m_text = re.sub(fr'\b{old}\b', new, m_text) + for old, new in zip(old_lang_given_prefixes, new_lang_given_prefixes): + m_text = re.sub(fr'\b{old}\b', new, m_text) + for old, new in zip(old_lang_when_prefixes, new_lang_when_prefixes): + m_text = re.sub(fr'\b{old}\b', new, m_text) + for old, new in zip(old_lang_then_prefixes, new_lang_then_prefixes): + m_text = re.sub(fr'\b{old}\b', new, m_text) + for old, new in zip(old_lang_and_prefixes, new_lang_and_prefixes): + m_text = re.sub(fr'\b{old}\b', new, m_text) + for old, new in zip(old_lang_but_prefixes, new_lang_but_prefixes): + m_text = re.sub(fr'\b{old}\b', new, m_text) + for old, new in zip(old_true_strings, new_true_strings): + m_text = re.sub(fr'\b{old}\b', new, m_text) + for old, new in zip(old_false_strings, new_false_strings): + m_text = re.sub(fr'\b{old}\b', new, m_text) return m_text @@ -507,18 +544,18 @@ def _sanity_check(self, data, text): from robotide.lib.robot.errors import DataError result = None rf_lang = get_rf_lang_code(self._doc_language) - print(f"DEBUG: textedit.py _sanity_check data is type={type(data)} lang={self._doc_language}," - f" transformed lang={rf_lang}") + # print(f"DEBUG: textedit.py _sanity_check data is type={type(data)} lang={self._doc_language}," + # f" transformed lang={rf_lang}") from robot.api.parsing import get_tokens for token in get_tokens(text): - print(repr(token)) + # print(repr(token)) if token.type == token.ERROR: - print("DEBUG: textedit.py _sanity_check TOKEN in ERROR") + # print("DEBUG: textedit.py _sanity_check TOKEN in ERROR") result = 'ERROR', repr(token) return result # raise DataError('ERROR', repr(token)) if token.type == token.INVALID_HEADER: - print("DEBUG: textedit.py _sanity_check TOKEN in INVALID_HEADER") + # print("DEBUG: textedit.py _sanity_check TOKEN in INVALID_HEADER") result = 'INVALID_HEADER', repr(token) return result # raise DataError('INVALID_HEADER', repr(token)) From 47bc66bea1d1a6622be5b5cc0cb6f8885e95173b Mon Sep 17 00:00:00 2001 From: HelioGuilherme66 Date: Thu, 22 Aug 2024 00:04:28 +0100 Subject: [PATCH 05/11] Problem with translation from English doc with continuation, must translate Gherkin from En transform_doc_language function. WIP --- src/robotide/editor/texteditor.py | 83 ++++++++++++++++++++++++++++++- 1 file changed, 82 insertions(+), 1 deletion(-) diff --git a/src/robotide/editor/texteditor.py b/src/robotide/editor/texteditor.py index bd0c2cb37..fa4ff82d9 100644 --- a/src/robotide/editor/texteditor.py +++ b/src/robotide/editor/texteditor.py @@ -156,8 +156,60 @@ def transform_doc_language(old_lang, new_lang, m_text, node_info: tuple =('', )) old_lang_bdd_prefixes = old_lang_class.bdd_prefixes new_lang_headers = new_lang_class.headers new_lang_bdd_prefixes = new_lang_class.bdd_prefixes + """ old_lang_settings = old_lang_class.settings new_lang_settings = new_lang_class.settings + """ + old_library_setting = old_lang_class.library_setting + old_resource_setting = old_lang_class.resource_setting + old_variables_setting = old_lang_class.variables_setting + old_name_setting = old_lang_class.name_setting + old_documentation_setting = old_lang_class.documentation_setting + old_metadata_setting = old_lang_class.metadata_setting + old_suite_setup_setting = old_lang_class.suite_setup_setting + old_suite_teardown_setting = old_lang_class.suite_teardown_setting + old_test_setup_setting = old_lang_class.test_setup_setting + old_task_setup_setting = old_lang_class.task_setup_setting + old_test_teardown_setting = old_lang_class.test_teardown_setting + old_task_teardown_setting = old_lang_class.task_teardown_setting + old_test_template_setting = old_lang_class.test_template_setting + old_task_template_setting = old_lang_class.task_template_setting + old_test_timeout_setting = old_lang_class.test_timeout_setting + old_task_timeout_setting = old_lang_class.task_timeout_setting + old_test_tags_setting = old_lang_class.test_tags_setting + old_task_tags_setting = old_lang_class.task_tags_setting + old_keyword_tags_setting = old_lang_class.keyword_tags_setting + old_tags_setting = old_lang_class.tags_setting + old_setup_setting = old_lang_class.setup_setting + old_teardown_setting = old_lang_class.teardown_setting + old_template_setting = old_lang_class.template_setting + old_timeout_setting = old_lang_class.timeout_setting + old_arguments_setting = old_lang_class.arguments_setting + new_library_setting = new_lang_class.library_setting + new_resource_setting = new_lang_class.resource_setting + new_variables_setting = new_lang_class.variables_setting + new_name_setting = new_lang_class.name_setting + new_documentation_setting = new_lang_class.documentation_setting + new_metadata_setting = new_lang_class.metadata_setting + new_suite_setup_setting = new_lang_class.suite_setup_setting + new_suite_teardown_setting = new_lang_class.suite_teardown_setting + new_test_setup_setting = new_lang_class.test_setup_setting + new_task_setup_setting = new_lang_class.task_setup_setting + new_test_teardown_setting = new_lang_class.test_teardown_setting + new_task_teardown_setting = new_lang_class.task_teardown_setting + new_test_template_setting = new_lang_class.test_template_setting + new_task_template_setting = new_lang_class.task_template_setting + new_test_timeout_setting = new_lang_class.test_timeout_setting + new_task_timeout_setting = new_lang_class.task_timeout_setting + new_test_tags_setting = new_lang_class.test_tags_setting + new_task_tags_setting = new_lang_class.task_tags_setting + new_keyword_tags_setting = new_lang_class.keyword_tags_setting + new_tags_setting = new_lang_class.tags_setting + new_setup_setting = new_lang_class.setup_setting + new_teardown_setting = new_lang_class.teardown_setting + new_template_setting = new_lang_class.template_setting + new_timeout_setting = new_lang_class.timeout_setting + new_arguments_setting = new_lang_class.arguments_setting old_lang_given_prefixes = old_lang_class.given_prefixes old_lang_when_prefixes = old_lang_class.when_prefixes old_lang_then_prefixes = old_lang_class.then_prefixes @@ -176,7 +228,6 @@ def transform_doc_language(old_lang, new_lang, m_text, node_info: tuple =('', )) f"new_lang={new_lang}\n" f"headers={old_lang_headers}\n old_lang_bdd_prefixes={old_lang_bdd_prefixes}\nnew_lang_name={new_lang_name}" f"\nheaders={new_lang_headers}\nnew_lang_bdd_prefixes={new_lang_bdd_prefixes}\n") - print(f"DEBUG: texteditor.py transform_doc_language\n{old_lang_settings=}\n{new_lang_settings=}\n") print(f"DEBUG: texteditor.py transform_doc_language\n{old_true_strings=} {old_false_strings=}\n" f"{new_true_strings=} {new_false_strings=}") if node_info != ('', ): @@ -207,8 +258,38 @@ def transform_doc_language(old_lang, new_lang, m_text, node_info: tuple =('', )) for old, new in zip(old_lang_headers.keys(), new_lang_headers.keys()): m_text = re.sub(fr'\b{old}\b', new, m_text) + """ for old, new in zip(old_lang_settings.keys(), new_lang_settings.keys()): m_text = re.sub(fr'\b{old}\b', new, m_text) + """ + # Settings must be replaced individually + # Order of replacements seems to be important + m_text = re.sub(fr'\b{old_documentation_setting}\b', new_documentation_setting, m_text) + m_text = re.sub(fr'\b{old_arguments_setting}\b', new_arguments_setting, m_text) + m_text = re.sub(fr'\b{old_tags_setting}\b', new_tags_setting, m_text) + m_text = re.sub(fr'\b{old_setup_setting}\b', new_setup_setting, m_text) + m_text = re.sub(fr'\b{old_suite_setup_setting}\b', new_suite_setup_setting, m_text) + m_text = re.sub(fr'\b{old_test_setup_setting}\b', new_test_setup_setting, m_text) + m_text = re.sub(fr'\b{old_task_setup_setting}\b', new_task_setup_setting, m_text) + m_text = re.sub(fr'\b{old_template_setting}\b', new_template_setting, m_text) + m_text = re.sub(fr'\b{old_suite_teardown_setting}\b', new_suite_teardown_setting, m_text) + m_text = re.sub(fr'\b{old_test_teardown_setting}\b', new_test_teardown_setting, m_text) + m_text = re.sub(fr'\b{old_task_teardown_setting}\b', new_task_teardown_setting, m_text) + m_text = re.sub(fr'\b{old_teardown_setting}\b', new_teardown_setting, m_text) + m_text = re.sub(fr'\b{old_library_setting}\b', new_library_setting, m_text) + m_text = re.sub(fr'\b{old_resource_setting}\b', new_resource_setting, m_text) + m_text = re.sub(fr'\b{old_variables_setting}\b', new_variables_setting, m_text) + m_text = re.sub(fr'\b{old_name_setting}\b', new_name_setting, m_text) + m_text = re.sub(fr'\b{old_metadata_setting}\b', new_metadata_setting, m_text) + m_text = re.sub(fr'\b{old_test_template_setting}\b', new_test_template_setting, m_text) + m_text = re.sub(fr'\b{old_task_template_setting}\b', new_task_template_setting, m_text) + m_text = re.sub(fr'\b{old_test_tags_setting}\b', new_test_tags_setting, m_text) + m_text = re.sub(fr'\b{old_task_tags_setting}\b', new_task_tags_setting, m_text) + m_text = re.sub(fr'\b{old_keyword_tags_setting}\b', new_keyword_tags_setting, m_text) + m_text = re.sub(fr'\b{old_test_timeout_setting}\b', new_test_timeout_setting, m_text) + m_text = re.sub(fr'\b{old_task_timeout_setting}\b', new_task_timeout_setting, m_text) + m_text = re.sub(fr'\b{old_timeout_setting}\b', new_timeout_setting, m_text) + for old, new in zip(old_lang_given_prefixes, new_lang_given_prefixes): m_text = re.sub(fr'\b{old}\b', new, m_text) for old, new in zip(old_lang_when_prefixes, new_lang_when_prefixes): From 75e7606b95216a7f27b0b0e5e86b17947c2039f4 Mon Sep 17 00:00:00 2001 From: HelioGuilherme66 Date: Sat, 24 Aug 2024 00:52:16 +0100 Subject: [PATCH 06/11] Del key not OK, Documentation OK for EN, FR transform_doc_language function. WIP --- src/robotide/editor/texteditor.py | 84 +++++++++++++++++++------------ 1 file changed, 51 insertions(+), 33 deletions(-) diff --git a/src/robotide/editor/texteditor.py b/src/robotide/editor/texteditor.py index fa4ff82d9..c7ba2dd9f 100644 --- a/src/robotide/editor/texteditor.py +++ b/src/robotide/editor/texteditor.py @@ -224,6 +224,13 @@ def transform_doc_language(old_lang, new_lang, m_text, node_info: tuple =('', )) old_false_strings = old_lang_class.false_strings new_true_strings = new_lang_class.true_strings new_false_strings = new_lang_class.false_strings + en_lang_class = Language.from_name('English') + en_lang_given_prefixes = en_lang_class.given_prefixes + en_lang_when_prefixes = en_lang_class.when_prefixes + en_lang_then_prefixes = en_lang_class.then_prefixes + en_lang_and_prefixes = en_lang_class.and_prefixes + en_lang_but_prefixes = en_lang_class.but_prefixes + print(f"DEBUG: texteditor.py transform_doc_language\n old_lang_name={old_lang_name} old_lang={old_lang} " f"new_lang={new_lang}\n" f"headers={old_lang_headers}\n old_lang_bdd_prefixes={old_lang_bdd_prefixes}\nnew_lang_name={new_lang_name}" @@ -257,53 +264,64 @@ def transform_doc_language(old_lang, new_lang, m_text, node_info: tuple =('', )) """ for old, new in zip(old_lang_headers.keys(), new_lang_headers.keys()): - m_text = re.sub(fr'\b{old}\b', new, m_text) + m_text = re.sub(fr"\**\s{old}\s\**", fr"*** {new} ***", m_text) """ for old, new in zip(old_lang_settings.keys(), new_lang_settings.keys()): m_text = re.sub(fr'\b{old}\b', new, m_text) """ # Settings must be replaced individually # Order of replacements seems to be important - m_text = re.sub(fr'\b{old_documentation_setting}\b', new_documentation_setting, m_text) - m_text = re.sub(fr'\b{old_arguments_setting}\b', new_arguments_setting, m_text) - m_text = re.sub(fr'\b{old_tags_setting}\b', new_tags_setting, m_text) - m_text = re.sub(fr'\b{old_setup_setting}\b', new_setup_setting, m_text) - m_text = re.sub(fr'\b{old_suite_setup_setting}\b', new_suite_setup_setting, m_text) - m_text = re.sub(fr'\b{old_test_setup_setting}\b', new_test_setup_setting, m_text) - m_text = re.sub(fr'\b{old_task_setup_setting}\b', new_task_setup_setting, m_text) - m_text = re.sub(fr'\b{old_template_setting}\b', new_template_setting, m_text) - m_text = re.sub(fr'\b{old_suite_teardown_setting}\b', new_suite_teardown_setting, m_text) - m_text = re.sub(fr'\b{old_test_teardown_setting}\b', new_test_teardown_setting, m_text) - m_text = re.sub(fr'\b{old_task_teardown_setting}\b', new_task_teardown_setting, m_text) - m_text = re.sub(fr'\b{old_teardown_setting}\b', new_teardown_setting, m_text) - m_text = re.sub(fr'\b{old_library_setting}\b', new_library_setting, m_text) - m_text = re.sub(fr'\b{old_resource_setting}\b', new_resource_setting, m_text) - m_text = re.sub(fr'\b{old_variables_setting}\b', new_variables_setting, m_text) - m_text = re.sub(fr'\b{old_name_setting}\b', new_name_setting, m_text) - m_text = re.sub(fr'\b{old_metadata_setting}\b', new_metadata_setting, m_text) - m_text = re.sub(fr'\b{old_test_template_setting}\b', new_test_template_setting, m_text) - m_text = re.sub(fr'\b{old_task_template_setting}\b', new_task_template_setting, m_text) - m_text = re.sub(fr'\b{old_test_tags_setting}\b', new_test_tags_setting, m_text) - m_text = re.sub(fr'\b{old_task_tags_setting}\b', new_task_tags_setting, m_text) - m_text = re.sub(fr'\b{old_keyword_tags_setting}\b', new_keyword_tags_setting, m_text) - m_text = re.sub(fr'\b{old_test_timeout_setting}\b', new_test_timeout_setting, m_text) - m_text = re.sub(fr'\b{old_task_timeout_setting}\b', new_task_timeout_setting, m_text) - m_text = re.sub(fr'\b{old_timeout_setting}\b', new_timeout_setting, m_text) + m_text = re.sub(fr'\b{old_documentation_setting}\b', fr'{new_documentation_setting}', m_text) + m_text = re.sub(fr'\b{old_arguments_setting}\b', fr'{new_arguments_setting}', m_text) + m_text = re.sub(fr'\b{old_tags_setting}\b', fr'{new_tags_setting}', m_text) + m_text = re.sub(fr'\b{old_setup_setting}\b', fr'{new_setup_setting}', m_text) + m_text = re.sub(fr'\b{old_suite_setup_setting}\b', fr'{new_suite_setup_setting}', m_text) + m_text = re.sub(fr'\b{old_test_setup_setting}\b', fr'{new_test_setup_setting}', m_text) + m_text = re.sub(fr'\b{old_task_setup_setting}\b', fr'{new_task_setup_setting}', m_text) + m_text = re.sub(fr'\b{old_template_setting}\b', fr'{new_template_setting}', m_text) + m_text = re.sub(fr'\b{old_suite_teardown_setting}\b', fr'{new_suite_teardown_setting}', m_text) + m_text = re.sub(fr'\b{old_test_teardown_setting}\b', fr'{new_test_teardown_setting}', m_text) + m_text = re.sub(fr'\b{old_task_teardown_setting}\b', fr'{new_task_teardown_setting}', m_text) + m_text = re.sub(fr'\b{old_teardown_setting}\b', fr'{new_teardown_setting}', m_text) + m_text = re.sub(fr'{old_library_setting}', fr'{new_library_setting}', m_text) + m_text = re.sub(fr'\b{old_resource_setting}\b', fr'{new_resource_setting}', m_text) + m_text = re.sub(fr'\b{old_variables_setting}\b', fr'{new_variables_setting}', m_text) + m_text = re.sub(fr'\b{old_name_setting}\b', fr'{new_name_setting}', m_text) + m_text = re.sub(fr'\b{old_metadata_setting}\b', fr'{new_metadata_setting}', m_text) + m_text = re.sub(fr'\b{old_test_template_setting}\b', fr'{new_test_template_setting}', m_text) + m_text = re.sub(fr'\b{old_task_template_setting}\b', fr'{new_task_template_setting}', m_text) + m_text = re.sub(fr'\b{old_test_tags_setting}\b', fr'{new_test_tags_setting}', m_text) + m_text = re.sub(fr'\b{old_task_tags_setting}\b', fr'{new_task_tags_setting}', m_text) + m_text = re.sub(fr'\b{old_keyword_tags_setting}\b', fr'{new_keyword_tags_setting}', m_text) + m_text = re.sub(fr'\b{old_test_timeout_setting}\b', fr'{new_test_timeout_setting}', m_text) + m_text = re.sub(fr'\b{old_task_timeout_setting}\b', fr'{new_task_timeout_setting}', m_text) + m_text = re.sub(fr'\b{old_timeout_setting}\b', fr'{new_timeout_setting}', m_text) for old, new in zip(old_lang_given_prefixes, new_lang_given_prefixes): - m_text = re.sub(fr'\b{old}\b', new, m_text) + m_text = re.sub(fr'\b{old}\b', fr'{new}', m_text) for old, new in zip(old_lang_when_prefixes, new_lang_when_prefixes): - m_text = re.sub(fr'\b{old}\b', new, m_text) + m_text = re.sub(fr'\b{old}\b', fr'{new}', m_text) for old, new in zip(old_lang_then_prefixes, new_lang_then_prefixes): - m_text = re.sub(fr'\b{old}\b', new, m_text) + m_text = re.sub(fr'\b{old}\b', fr'{new}', m_text) for old, new in zip(old_lang_and_prefixes, new_lang_and_prefixes): - m_text = re.sub(fr'\b{old}\b', new, m_text) + m_text = re.sub(fr'\b{old}\b', fr'{new}', m_text) for old, new in zip(old_lang_but_prefixes, new_lang_but_prefixes): - m_text = re.sub(fr'\b{old}\b', new, m_text) + m_text = re.sub(fr'\b{old}\b', fr'{new}', m_text) for old, new in zip(old_true_strings, new_true_strings): - m_text = re.sub(fr'\b{old}\b', new, m_text) + m_text = re.sub(fr'\b{old}\b', fr'{new}', m_text) for old, new in zip(old_false_strings, new_false_strings): - m_text = re.sub(fr'\b{old}\b', new, m_text) + m_text = re.sub(fr'\b{old}\b', fr'{new}', m_text) + # Final translation from English + for en, new in zip(en_lang_given_prefixes, new_lang_given_prefixes): + m_text = re.sub(fr'\b{en}\b', fr'{new}', m_text) + for en, new in zip(en_lang_when_prefixes, new_lang_when_prefixes): + m_text = re.sub(fr'\b{en}\b', fr'{new}', m_text) + for en, new in zip(en_lang_then_prefixes, new_lang_then_prefixes): + m_text = re.sub(fr'\b{en}\b', fr'{new}', m_text) + for en, new in zip(en_lang_and_prefixes, new_lang_and_prefixes): + m_text = re.sub(fr'\b{en}\b', fr'{new}', m_text) + for en, new in zip(en_lang_but_prefixes, new_lang_but_prefixes): + m_text = re.sub(fr'\b{en}\b', fr'{new}', m_text) return m_text From 6f8ff1aede24dffeb8c3f141556f3ee6e7a0ebd5 Mon Sep 17 00:00:00 2001 From: HelioGuilherme66 Date: Sun, 25 Aug 2024 02:58:54 +0100 Subject: [PATCH 07/11] Unit test for read_language, Text Editor --- src/robotide/editor/texteditor.py | 2 +- utest/editor/test_texteditor.py | 88 +++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+), 1 deletion(-) diff --git a/src/robotide/editor/texteditor.py b/src/robotide/editor/texteditor.py index c7ba2dd9f..a86edeede 100644 --- a/src/robotide/editor/texteditor.py +++ b/src/robotide/editor/texteditor.py @@ -125,7 +125,7 @@ def get_rf_lang_code(lang: (str, list)) -> str: return clean_lang[0].title() -def transform_doc_language(old_lang, new_lang, m_text, node_info: tuple =('', )): +def transform_doc_language(old_lang, new_lang, m_text, node_info: tuple = ('', )): print(f"DEBUG: texteditor.py transform_doc_language ENTER old_lang={old_lang} new_lang={new_lang}" f"\n T old_lang={type(old_lang)} T new_lang={type(new_lang)}, node_info={node_info}") if isinstance(old_lang, list): diff --git a/utest/editor/test_texteditor.py b/utest/editor/test_texteditor.py index ea0abd6a7..efa96275c 100644 --- a/utest/editor/test_texteditor.py +++ b/utest/editor/test_texteditor.py @@ -13,6 +13,8 @@ # limitations under the License. import os +import re + import pytest import unittest import wx @@ -576,5 +578,91 @@ def test_get_selected_or_near_text(self): self.app.MainLoop() +class TestLanguageFunctions(unittest.TestCase): + + def setUp(self): + self.app = MyApp() + settings = self.app.settings + try: + self.shared_mem = shared_memory.ShareableList(['en'], name="language") + except FileExistsError: # Other instance created file + self.shared_mem = shared_memory.ShareableList(name="language") + self.frame = self.app.frame + self.frame.actions = ActionRegisterer(AuiManager(self.frame), MenuBar(self.frame), ToolBar(self.frame), + ShortcutRegistry(self.frame)) + self.frame.tree = Tree(self.frame, self.frame.actions, settings) + self.app.project = Project(self.app.namespace, self.app.settings) + self.plugin = texteditor.TextEditorPlugin(self.app) + self.plugin._editor_component = texteditor.SourceEditor(self.plugin, self.app.book, self.plugin.title, + texteditor.DataValidationHandler(self.plugin, lang='en')) + self.plugin.enable() + self.app.project.load_datafile(datafilereader.TESTCASEFILE_WITH_EVERYTHING, MessageRecordingLoadObserver()) + self.notebook = self.app.book + self.app.tree.set_editor(self.plugin._editor_component) + self.app.tree.populate(self.app.project) + self.source = self.app.tree.controller + self.plugin._open_tree_selection_in_editor() + self.app.frame.SetStatusText("File:" + self.app.project.data.source) + # Uncomment next line (and MainLoop in tests) if you want to see the app + self.frame.Show() + + def tearDown(self): + self.plugin.unsubscribe_all() + PUBLISHER.unsubscribe_all() + self.app.project.close() + wx.CallAfter(self.app.ExitMainLoop) + self.app.MainLoop() # With this here, there is no Segmentation fault + # wx.CallAfter(wx.Exit) + self.shared_mem.shm.close() + self.shared_mem.shm.unlink() + self.app.Destroy() + self.app = None + + def set_language(self, lang: str): + assert lang is not None + fulltext = self.plugin._editor_component.source_editor.GetText() + if "Language:" in fulltext: + new_text = re.sub(r"Language: .*", f"Language: {lang}", fulltext) + else: + new_text = f"Language: {lang}\n\n{fulltext}" + self.plugin._editor_component.source_editor.set_text(new_text) + + def test_read_language_not_set(self): + self.plugin._open() + with open(datafilereader.TESTCASEFILE_WITH_EVERYTHING, "r") as fp: + content = fp.readlines() + content = "".join(content) + self.plugin._editor_component.source_editor.set_text(content) + # print(f"DEBUG: content:\n{content}") + + language = texteditor.read_language(content.encode()) + assert language is None + + self.set_language('Klingon') + fulltext = self.plugin._editor_component.source_editor.GetText() + language = texteditor.read_language(fulltext.encode()) + assert language == "Klingon" + + self.set_language('Chinese Simplified') + fulltext = self.plugin._editor_component.source_editor.GetText() + language = texteditor.read_language(fulltext.encode()) + assert language == "Chinese Simplified" + + self.set_language('English') + fulltext = self.plugin._editor_component.source_editor.GetText() + language = texteditor.read_language(fulltext.encode()) + assert language == "English" + + # print(f"DEBUG: FINAL fulltext:\n{fulltext}\n" + # f"Language is: {language}") + self.plugin._editor_component.source_editor.set_text(fulltext) + self.plugin._editor_component.source_editor.Refresh() + # print(f"DEBUG: fulltext:\n{fulltext}") + # assert fulltext == spaces + '1 - Line one' + spaces + 'with cells' + spaces + spaces + 'last text\n' + # Uncomment next lines if you want to see the app + wx.CallLater(5000, self.app.ExitMainLoop) + self.app.MainLoop() + + if __name__ == '__main__': unittest.main() From af0439cd61ecbc605cba10a620db553c4063c0e1 Mon Sep 17 00:00:00 2001 From: HelioGuilherme66 Date: Mon, 26 Aug 2024 01:48:07 +0100 Subject: [PATCH 08/11] Unit tests for get_rf_lang_code and obtain_language, Text Editor --- src/robotide/editor/texteditor.py | 8 ++--- utest/editor/test_texteditor.py | 60 ++++++++++++++++++++++++++++++- 2 files changed, 63 insertions(+), 5 deletions(-) diff --git a/src/robotide/editor/texteditor.py b/src/robotide/editor/texteditor.py index a86edeede..1eb879092 100644 --- a/src/robotide/editor/texteditor.py +++ b/src/robotide/editor/texteditor.py @@ -112,14 +112,14 @@ def get_rf_lang_code(lang: (str, list)) -> str: clean_lang = lang else: clean_lang = lang.split(' ') # The cases we have two words - lc = len(clean_lang) - if lc > 1 or len(clean_lang[0]) > 2 and clean_lang[0].replace('_', '') == lang: - return lang + # lc = len(clean_lang) + # if lc > 1 or len(clean_lang[0]) > 2 and clean_lang[0].replace('_', '') == lang: + # return lang clean_lang = clean_lang[0].replace('-', '_').split('_') # The cases we have variant code lc = len(clean_lang) if lc == 1: return clean_lang[0].title() - with_variant_code = f"{clean_lang[0].title()}{clean_lang[1].title()}" + with_variant_code = f"{clean_lang[0].lower().title()}{clean_lang[1].lower().title()}" if with_variant_code in ("PtBr", "ZhCn", "ZhTw"): return with_variant_code return clean_lang[0].title() diff --git a/utest/editor/test_texteditor.py b/utest/editor/test_texteditor.py index efa96275c..1fc39ee5f 100644 --- a/utest/editor/test_texteditor.py +++ b/utest/editor/test_texteditor.py @@ -47,6 +47,23 @@ | aui.AUI_NB_SUB_NOTEBOOK | aui.AUI_NB_SMART_TABS MYTESTOVERRIDE = 'My Overriding Test Teardown' +LANGUAGES = [('Bulgarian', 'bg'), ('Bosnian', 'bs'), + ('Czech', 'cs'), ('German', 'de'), + ('English', 'en'), ('Spanish', 'es'), + ('Finnish', 'fi'), ('French', 'fr'), + ('Hindi', 'hi'), ('Italian', 'it'), + ('Japanese', 'ja'), # Since RF 7.0.1 + # Not available yet: ('Korean', 'ko'), # Future RF after 7.0.1 + ('Dutch', 'nl'), ('Polish', 'pl'), + ('Portuguese', 'pt'), + ('Brazilian Portuguese', 'pt-BR'), + ('Romanian', 'ro'), ('Russian', 'ru'), + ('Swedish', 'sv'), ('Thai', 'th'), + ('Turkish', 'tr'), ('Ukrainian', 'uk'), + ('Vietnamese', 'vi'), + ('Chinese Simplified', 'zh-CN'), + ('Chinese Traditional', 'zh-TW')] + class MainFrame(wx.Frame): book = None @@ -627,7 +644,7 @@ def set_language(self, lang: str): new_text = f"Language: {lang}\n\n{fulltext}" self.plugin._editor_component.source_editor.set_text(new_text) - def test_read_language_not_set(self): + def test_read_language(self): self.plugin._open() with open(datafilereader.TESTCASEFILE_WITH_EVERYTHING, "r") as fp: content = fp.readlines() @@ -663,6 +680,47 @@ def test_read_language_not_set(self): wx.CallLater(5000, self.app.ExitMainLoop) self.app.MainLoop() + def test_get_rf_lang_code(self): + lang = ['en'] + result = texteditor.get_rf_lang_code(lang) + assert result == 'En' + + lang = 'pt' + result = texteditor.get_rf_lang_code(lang) + assert result == 'Pt' + + lang = 'pt-BR' + result = texteditor.get_rf_lang_code(lang) + assert result == 'PtBr' + + lang = ['Zh-cn'] + result = texteditor.get_rf_lang_code(lang) + assert result == 'ZhCn' + + lang = 'zh-tw' + result = texteditor.get_rf_lang_code(lang) + assert result == 'ZhTw' + + def test_obtain_language(self): + self.plugin._open() + with open(datafilereader.TESTCASEFILE_WITH_EVERYTHING, "r") as fp: + content = fp.readlines() + content = "".join(content) + self.plugin._editor_component.source_editor.set_text(content) + # print(f"DEBUG: content:\n{content}") + + for lang in LANGUAGES: + self.set_language(lang[0]) + fulltext = self.plugin._editor_component.source_editor.GetText() + result = texteditor.obtain_language('', fulltext.encode()) + code = texteditor.get_rf_lang_code(lang[1]) + assert result == [code] + + with pytest.raises(ValueError, match="No language with name 'Klingon' found."): + self.set_language('Klingon') + fulltext = self.plugin._editor_component.source_editor.GetText() + result = texteditor.obtain_language('', fulltext.encode()) + if __name__ == '__main__': unittest.main() From d3240f80cc5e232d5087291526e03a8ee21ac6dc Mon Sep 17 00:00:00 2001 From: HelioGuilherme66 Date: Tue, 27 Aug 2024 03:00:02 +0100 Subject: [PATCH 09/11] More unit tests, must fix Documentation ... for other languages --- src/robotide/editor/texteditor.py | 94 +++++++------ src/robotide/ui/mainframe.py | 7 +- utest/editor/test_texteditor.py | 83 ++++++++++++ utest/language/test_language.py | 4 + utest/resources/datafilereader.py | 3 +- .../language/en/full_test_single_en.robot | 79 +++++++++++ .../robotdata/language/lang_bg.robot | 115 +++++++++++++++- .../robotdata/language/lang_bs.robot | 120 ++++++++++++++++- .../robotdata/language/lang_cs.robot | 115 +++++++++++++++- .../robotdata/language/lang_de.robot | 115 +++++++++++++++- .../robotdata/language/lang_en.robot | 123 ++++++++++++++++- .../robotdata/language/lang_es.robot | 114 +++++++++++++++- .../robotdata/language/lang_fi.robot | 115 +++++++++++++++- .../robotdata/language/lang_fr.robot | 126 +++++++++++++++++- .../robotdata/language/lang_hi.robot | 115 +++++++++++++++- .../robotdata/language/lang_it.robot | 120 ++++++++++++++++- .../robotdata/language/lang_ja.robot | 121 +++++++++++++++++ .../robotdata/language/lang_nl.robot | 115 +++++++++++++++- .../robotdata/language/lang_pl.robot | 125 ++++++++++++++--- .../robotdata/language/lang_pt.robot | 126 ++++++++++++++++-- .../robotdata/language/lang_pt_br.robot | 120 +++++++++++++++-- .../robotdata/language/lang_ro.robot | 117 +++++++++++++++- .../robotdata/language/lang_ru.robot | 121 ++++++++++++++++- .../robotdata/language/lang_sv.robot | 115 +++++++++++++++- .../robotdata/language/lang_th.robot | 120 ++++++++++++++++- .../robotdata/language/lang_tr.robot | 115 +++++++++++++++- .../robotdata/language/lang_uk.robot | 120 ++++++++++++++++- .../robotdata/language/lang_vi.robot | 115 +++++++++++++++- .../robotdata/language/lang_zh_cn.robot | 115 +++++++++++++++- .../robotdata/language/lang_zh_tw.robot | 115 +++++++++++++++- .../robotdata/resources/resource2.robot | 17 ++- 31 files changed, 2955 insertions(+), 170 deletions(-) create mode 100644 utest/resources/robotdata/language/en/full_test_single_en.robot create mode 100644 utest/resources/robotdata/language/lang_ja.robot diff --git a/src/robotide/editor/texteditor.py b/src/robotide/editor/texteditor.py index 1eb879092..4fb6c1af3 100644 --- a/src/robotide/editor/texteditor.py +++ b/src/robotide/editor/texteditor.py @@ -126,8 +126,8 @@ def get_rf_lang_code(lang: (str, list)) -> str: def transform_doc_language(old_lang, new_lang, m_text, node_info: tuple = ('', )): - print(f"DEBUG: texteditor.py transform_doc_language ENTER old_lang={old_lang} new_lang={new_lang}" - f"\n T old_lang={type(old_lang)} T new_lang={type(new_lang)}, node_info={node_info}") + # print(f"DEBUG: texteditor.py transform_doc_language ENTER old_lang={old_lang} new_lang={new_lang}" + # f"\n T old_lang={type(old_lang)} T new_lang={type(new_lang)}, node_info={node_info}") if isinstance(old_lang, list): old_lang = old_lang[0] if isinstance(new_lang, list): @@ -230,13 +230,15 @@ def transform_doc_language(old_lang, new_lang, m_text, node_info: tuple = ('', ) en_lang_then_prefixes = en_lang_class.then_prefixes en_lang_and_prefixes = en_lang_class.and_prefixes en_lang_but_prefixes = en_lang_class.but_prefixes - - print(f"DEBUG: texteditor.py transform_doc_language\n old_lang_name={old_lang_name} old_lang={old_lang} " - f"new_lang={new_lang}\n" - f"headers={old_lang_headers}\n old_lang_bdd_prefixes={old_lang_bdd_prefixes}\nnew_lang_name={new_lang_name}" - f"\nheaders={new_lang_headers}\nnew_lang_bdd_prefixes={new_lang_bdd_prefixes}\n") - print(f"DEBUG: texteditor.py transform_doc_language\n{old_true_strings=} {old_false_strings=}\n" - f"{new_true_strings=} {new_false_strings=}") + + sinal_correct_language = False # If error in Language, do final replacement + + # print(f"DEBUG: texteditor.py transform_doc_language\n old_lang_name={old_lang_name} old_lang={old_lang} " + # f"new_lang={new_lang}\n" + # f"headers={old_lang_headers}\n old_lang_bdd_prefixes={old_lang_bdd_prefixes}\nnew_lang_name={new_lang_name}" + # f"\nheaders={new_lang_headers}\nnew_lang_bdd_prefixes={new_lang_bdd_prefixes}\n") + # print(f"DEBUG: texteditor.py transform_doc_language\n{old_true_strings=} {old_false_strings=}\n" + # f"{new_true_strings=} {new_false_strings=}") if node_info != ('', ): if node_info[0] == 'ERROR': c_msg = node_info[1].replace('Token(', '').replace(')', '').split(',') @@ -246,6 +248,7 @@ def transform_doc_language(old_lang, new_lang, m_text, node_info: tuple = ('', ) tail = line.replace('Language: ', '') # print(f"DEBUG: textedit.py transform_doc_language INSIDE BLOCK {tail=}") m_text = m_text.replace('Language: ' + tail, 'Language: English' + ' # ' + tail) + sinal_correct_language = True """ if node_info[0] == 'INVALID_HEADER': # print(f"DEBUG: textedit.py transform_doc_language INVALID_HEADER: {node_info[1]}") @@ -264,7 +267,7 @@ def transform_doc_language(old_lang, new_lang, m_text, node_info: tuple = ('', ) """ for old, new in zip(old_lang_headers.keys(), new_lang_headers.keys()): - m_text = re.sub(fr"\**\s{old}\s\**", fr"*** {new} ***", m_text) + m_text = re.sub(r"[*]+\s"+fr"{old}"+r"\s[*]+", fr"*** {new} ***", m_text) """ for old, new in zip(old_lang_settings.keys(), new_lang_settings.keys()): m_text = re.sub(fr'\b{old}\b', new, m_text) @@ -272,56 +275,62 @@ def transform_doc_language(old_lang, new_lang, m_text, node_info: tuple = ('', ) # Settings must be replaced individually # Order of replacements seems to be important m_text = re.sub(fr'\b{old_documentation_setting}\b', fr'{new_documentation_setting}', m_text) - m_text = re.sub(fr'\b{old_arguments_setting}\b', fr'{new_arguments_setting}', m_text) - m_text = re.sub(fr'\b{old_tags_setting}\b', fr'{new_tags_setting}', m_text) - m_text = re.sub(fr'\b{old_setup_setting}\b', fr'{new_setup_setting}', m_text) - m_text = re.sub(fr'\b{old_suite_setup_setting}\b', fr'{new_suite_setup_setting}', m_text) - m_text = re.sub(fr'\b{old_test_setup_setting}\b', fr'{new_test_setup_setting}', m_text) - m_text = re.sub(fr'\b{old_task_setup_setting}\b', fr'{new_task_setup_setting}', m_text) - m_text = re.sub(fr'\b{old_template_setting}\b', fr'{new_template_setting}', m_text) - m_text = re.sub(fr'\b{old_suite_teardown_setting}\b', fr'{new_suite_teardown_setting}', m_text) - m_text = re.sub(fr'\b{old_test_teardown_setting}\b', fr'{new_test_teardown_setting}', m_text) - m_text = re.sub(fr'\b{old_task_teardown_setting}\b', fr'{new_task_teardown_setting}', m_text) - m_text = re.sub(fr'\b{old_teardown_setting}\b', fr'{new_teardown_setting}', m_text) - m_text = re.sub(fr'{old_library_setting}', fr'{new_library_setting}', m_text) - m_text = re.sub(fr'\b{old_resource_setting}\b', fr'{new_resource_setting}', m_text) - m_text = re.sub(fr'\b{old_variables_setting}\b', fr'{new_variables_setting}', m_text) + m_text = re.sub(fr'[[]{old_arguments_setting}]', fr'[{new_arguments_setting}]', m_text) + m_text = re.sub(fr'{old_suite_setup_setting}\s{2}', fr'{new_suite_setup_setting} ', m_text) + m_text = re.sub(fr'{old_suite_teardown_setting}\s{2}', fr'{new_suite_teardown_setting} ', m_text) + m_text = re.sub(fr'{old_test_setup_setting}\s{2}', fr'{new_test_setup_setting} ', m_text) + m_text = re.sub(fr'{old_task_setup_setting}\s{2}', fr'{new_task_setup_setting} ', m_text) + m_text = re.sub(fr'{old_template_setting}\s{2}', fr'{new_template_setting} ', m_text) + m_text = re.sub(fr'{old_test_teardown_setting}\s{2}', fr'{new_test_teardown_setting} ', m_text) + m_text = re.sub(fr'{old_task_teardown_setting}\s{2}', fr'{new_task_teardown_setting} ', m_text) + m_text = re.sub(fr'{old_library_setting}\s{2}', fr'{new_library_setting} ', m_text) + m_text = re.sub(fr'{old_resource_setting}\s{2}', fr'{new_resource_setting} ', m_text) + m_text = re.sub(fr'{old_variables_setting}\s{2}', fr'{new_variables_setting} ', m_text) + m_text = re.sub(fr'{old_tags_setting}\s{2}', fr'{new_tags_setting} ', m_text) + m_text = re.sub(fr'[[]{old_setup_setting}]', fr'[{new_setup_setting}]', m_text) + m_text = re.sub(fr'[[]{old_teardown_setting}]', fr'[{new_teardown_setting}]', m_text) m_text = re.sub(fr'\b{old_name_setting}\b', fr'{new_name_setting}', m_text) m_text = re.sub(fr'\b{old_metadata_setting}\b', fr'{new_metadata_setting}', m_text) m_text = re.sub(fr'\b{old_test_template_setting}\b', fr'{new_test_template_setting}', m_text) m_text = re.sub(fr'\b{old_task_template_setting}\b', fr'{new_task_template_setting}', m_text) - m_text = re.sub(fr'\b{old_test_tags_setting}\b', fr'{new_test_tags_setting}', m_text) - m_text = re.sub(fr'\b{old_task_tags_setting}\b', fr'{new_task_tags_setting}', m_text) - m_text = re.sub(fr'\b{old_keyword_tags_setting}\b', fr'{new_keyword_tags_setting}', m_text) + m_text = re.sub(fr'[[]{old_test_tags_setting}]', fr'[{new_test_tags_setting}]', m_text) + m_text = re.sub(fr'[[]{old_task_tags_setting}]', fr'[{new_task_tags_setting}]', m_text) + m_text = re.sub(fr'[[]{old_keyword_tags_setting}]', fr'[{new_keyword_tags_setting}]', m_text) m_text = re.sub(fr'\b{old_test_timeout_setting}\b', fr'{new_test_timeout_setting}', m_text) m_text = re.sub(fr'\b{old_task_timeout_setting}\b', fr'{new_task_timeout_setting}', m_text) m_text = re.sub(fr'\b{old_timeout_setting}\b', fr'{new_timeout_setting}', m_text) for old, new in zip(old_lang_given_prefixes, new_lang_given_prefixes): - m_text = re.sub(fr'\b{old}\b', fr'{new}', m_text) + m_text = re.sub(r"\s{2}"+fr"{old}"+r"\s", fr" {new} ", m_text) for old, new in zip(old_lang_when_prefixes, new_lang_when_prefixes): - m_text = re.sub(fr'\b{old}\b', fr'{new}', m_text) + m_text = re.sub(r"\s{2}"+fr"{old}"+r"\s", fr" {new} ", m_text) for old, new in zip(old_lang_then_prefixes, new_lang_then_prefixes): - m_text = re.sub(fr'\b{old}\b', fr'{new}', m_text) + m_text = re.sub(r"\s{2}"+fr"{old}"+r"\s", fr" {new} ", m_text) for old, new in zip(old_lang_and_prefixes, new_lang_and_prefixes): - m_text = re.sub(fr'\b{old}\b', fr'{new}', m_text) + m_text = re.sub(r"\s{2}"+fr"{old}"+r"\s", fr" {new} ", m_text) for old, new in zip(old_lang_but_prefixes, new_lang_but_prefixes): - m_text = re.sub(fr'\b{old}\b', fr'{new}', m_text) + m_text = re.sub(r"\s{2}"+fr"{old}"+r"\s", fr" {new} ", m_text) for old, new in zip(old_true_strings, new_true_strings): - m_text = re.sub(fr'\b{old}\b', fr'{new}', m_text) + m_text = re.sub(r"\s{2}"+fr"{old}"+r"\s", fr" {new} ", m_text) for old, new in zip(old_false_strings, new_false_strings): - m_text = re.sub(fr'\b{old}\b', fr'{new}', m_text) + m_text = re.sub(r"\s{2}"+fr"{old}"+r"\s", fr" {new} ", m_text) # Final translation from English for en, new in zip(en_lang_given_prefixes, new_lang_given_prefixes): - m_text = re.sub(fr'\b{en}\b', fr'{new}', m_text) + m_text = re.sub(r"\s{2}"+fr"{en}"+r"\s", fr" {new} ", m_text) for en, new in zip(en_lang_when_prefixes, new_lang_when_prefixes): - m_text = re.sub(fr'\b{en}\b', fr'{new}', m_text) + m_text = re.sub(r"\s{2}"+fr"{en}"+r"\s", fr" {new} ", m_text) for en, new in zip(en_lang_then_prefixes, new_lang_then_prefixes): - m_text = re.sub(fr'\b{en}\b', fr'{new}', m_text) + m_text = re.sub(r"\s{2}"+fr"{en}"+r"\s", fr" {new} ", m_text) for en, new in zip(en_lang_and_prefixes, new_lang_and_prefixes): - m_text = re.sub(fr'\b{en}\b', fr'{new}', m_text) + m_text = re.sub(r"\s{2}"+fr"{en}"+r"\s", fr" {new} ", m_text) for en, new in zip(en_lang_but_prefixes, new_lang_but_prefixes): - m_text = re.sub(fr'\b{en}\b', fr'{new}', m_text) + m_text = re.sub(r"\s{2}"+fr"{en}"+r"\s", fr" {new} ", m_text) + + if sinal_correct_language: + m_text = m_text.replace('Language: English', fr'Language: {new_lang_name}') + else: + m_text = m_text.replace(fr'Language: {old_lang_name}', fr'Language: {new_lang_name}') + return m_text @@ -529,7 +538,7 @@ def on_tab_changed(self, event): def _apply_txt_changes_to_model(self): self._editor.is_saving = False - print(f"DEBUG: textedit.py _apply_txt_changes_to_model CALL content_save lang={self._doc_language}") + # print(f"DEBUG: textedit.py _apply_txt_changes_to_model CALL content_save lang={self._doc_language}") if not self._editor.content_save(lang=self._doc_language): return False self._editor.reset() @@ -607,10 +616,7 @@ def validate_and_update(self, data, text, lang='en'): result = (err.message, err.details) if isinstance(result, tuple): - print(f"DEBUG: textedit.py validate_and_update Language in doc--> lang={self._doc_language}" - f" initial_lang={initial_lang}") m_text = transform_doc_language(initial_lang, self._doc_language, m_text, node_info=result) - print(f"DEBUG: textedit.py validate_and_update AFTER TRANSFORM m_text=\n{m_text}") try: result = self._sanity_check(data, m_text) # Check if language changed and is valid content except DataError as err: @@ -1135,7 +1141,7 @@ def open(self, data): self.language = self._data._doc_language else: self.language = ['en'] - print(f"DEBUG: texteditor.py SourceEditor open ENTER language={self.language}") + # print(f"DEBUG: texteditor.py SourceEditor open ENTER language={self.language}") try: if isinstance(self._data.wrapper_data, ResourceFileController): self._controller_for_context = DummyController(self._data.wrapper_data, self._data.wrapper_data) diff --git a/src/robotide/ui/mainframe.py b/src/robotide/ui/mainframe.py index df8ed3ed8..cdc95c709 100644 --- a/src/robotide/ui/mainframe.py +++ b/src/robotide/ui/mainframe.py @@ -497,7 +497,12 @@ def open_suite(self, path): self._application.workspace_path = path from ..lib.compat.parsing.language import check_file_language self.controller.file_language = check_file_language(path) - set_lang = shared_memory.ShareableList(name="language") + set_lang = [] + set_lang.append('en') + try: + set_lang = shared_memory.ShareableList(name="language") + except FileNotFoundError: + set_lang[0] = 'en' if self.controller.file_language: set_lang[0] = self.controller.file_language[0] # print(f"DEBUG: project.py Project load_data file_language = {self.controller.file_language}\n" diff --git a/utest/editor/test_texteditor.py b/utest/editor/test_texteditor.py index 1fc39ee5f..9a158e947 100644 --- a/utest/editor/test_texteditor.py +++ b/utest/editor/test_texteditor.py @@ -720,6 +720,89 @@ def test_obtain_language(self): self.set_language('Klingon') fulltext = self.plugin._editor_component.source_editor.GetText() result = texteditor.obtain_language('', fulltext.encode()) + print(f"This {result=} is not reached.") + + def test_transform_doc_language_no_transform(self): + self.plugin._open() + with open(datafilereader.TESTCASEFILE_WITH_EVERYTHING, "r") as fp: + content = fp.readlines() + content = "".join(content) + self.plugin._editor_component.source_editor.set_text(content) + # print(f"DEBUG: content:\n{content}") + + self.set_language('English') + fulltext = self.plugin._editor_component.source_editor.GetText() + result = texteditor.transform_doc_language(['klingon'], ['klingon'], fulltext.encode()) + # print(f"DEBUG: {result=} == {fulltext=}.") + assert result == fulltext.encode() + + # self.set_language('English') + fulltext = self.plugin._editor_component.source_editor.GetText() + result = texteditor.transform_doc_language(['klingon'], ['english'], fulltext.encode()) + assert result == fulltext.encode() + + # self.set_language('English') + fulltext = self.plugin._editor_component.source_editor.GetText() + result = texteditor.transform_doc_language(['english'], ['klingon'], fulltext.encode()) + assert result == fulltext.encode() + + def test_transform_doc_language_in_error(self): + self.plugin._open() + with open(datafilereader.VALID_LANG_IT, "r") as fp: + content = fp.readlines() + content = "".join(content) + self.plugin._editor_component.source_editor.set_text(content) + # print(f"DEBUG: content:\n{content}") + + self.set_language('Klingon') + fulltext = self.plugin._editor_component.source_editor.GetText() + result = texteditor.transform_doc_language('Klingon', 'Italian', fulltext, + ("ERROR", + "Token(ERROR, 'Language: Klingon', 1, 0, " + "\"Invalid language configuration: Language 'Klingon' not found" + " nor importable as a language module.\")")) + finaltext = re.sub('Language: .*', fr'Language: Italian # Klingon', fulltext, count=1) + + # print(f"DEBUG: {result=} \n {finaltext=}.") + assert result == finaltext + + def test_transform_doc_language_spanish(self): + self.plugin._open() + with open(datafilereader.VALID_LANG_EN, "r") as fp: + content = fp.readlines() + content = "".join(content) + self.plugin._editor_component.source_editor.set_text(content) + # print(f"DEBUG: content:\n{content}") + + # We try Spanish, because No Operation remains unchanged ;) + fulltext = self.plugin._editor_component.source_editor.GetText() + result = texteditor.transform_doc_language(['English'], ['Spanish'], fulltext) + + with open(datafilereader.VALID_LANG_ES, "r") as fp: + content = fp.readlines() + content = "".join(content) + print(f"DEBUG: They should be equal:\n" + f" {result=}\n" + f"{content=}") + assert result == content + + """ + def test_transform_doc_language_generate(self): + self.plugin._open() + with open(datafilereader.VALID_LANG_EN, "r") as fp: + content = fp.readlines() + content = "".join(content) + self.plugin._editor_component.source_editor.set_text(content) + # print(f"DEBUG: content:\n{content}") + + # self.set_language('English') + fulltext = self.plugin._editor_component.source_editor.GetText() + result = texteditor.transform_doc_language(['English'], ['Japanese'], fulltext) + print(f"DEBUG: This should be Japanese:\n" + f"{result=}") + with open(datafilereader.VALID_LANG_JA, "w") as fp: + fp.writelines(result) + """ if __name__ == '__main__': diff --git a/utest/language/test_language.py b/utest/language/test_language.py index 932bfc907..2d33e0cc0 100644 --- a/utest/language/test_language.py +++ b/utest/language/test_language.py @@ -72,6 +72,10 @@ def test_check_file_lang_it(self): lang = language.check_file_language(datafilereader.VALID_LANG_IT) assert lang == ['it'] + def test_check_file_lang_ja(self): + lang = language.check_file_language(datafilereader.VALID_LANG_JA) + assert lang == ['ja'] + def test_check_file_lang_nl(self): lang = language.check_file_language(datafilereader.VALID_LANG_NL) assert lang == ['nl'] diff --git a/utest/resources/datafilereader.py b/utest/resources/datafilereader.py index 6e1e65cd9..5e9d9b24a 100644 --- a/utest/resources/datafilereader.py +++ b/utest/resources/datafilereader.py @@ -73,12 +73,13 @@ def _makepath(*elements): VALID_LANG_BS = _makepath('language', 'lang_bs.robot') VALID_LANG_CS = _makepath('language', 'lang_cs.robot') VALID_LANG_DE = _makepath('language', 'lang_de.robot') -VALID_LANG_ES = _makepath('language', 'lang_es.robot') VALID_LANG_EN = _makepath('language', 'lang_en.robot') +VALID_LANG_ES = _makepath('language', 'lang_es.robot') VALID_LANG_FR = _makepath('language', 'lang_fr.robot') VALID_LANG_FI = _makepath('language', 'lang_fi.robot') VALID_LANG_HI = _makepath('language', 'lang_hi.robot') VALID_LANG_IT = _makepath('language', 'lang_it.robot') +VALID_LANG_JA = _makepath('language', 'lang_ja.robot') VALID_LANG_NL = _makepath('language', 'lang_nl.robot') VALID_LANG_PL = _makepath('language', 'lang_pl.robot') VALID_LANG_PT_BR = _makepath('language', 'lang_pt_br.robot') diff --git a/utest/resources/robotdata/language/en/full_test_single_en.robot b/utest/resources/robotdata/language/en/full_test_single_en.robot new file mode 100644 index 000000000..d0c746b07 --- /dev/null +++ b/utest/resources/robotdata/language/en/full_test_single_en.robot @@ -0,0 +1,79 @@ +# This is the preamble +Language: English + +# A blank line + +*** Settings *** +Documentation 1-This is the documentation +... 2-A continued line of documentation +Suite Setup Run Keywords Log To Console Suite Setup +... AND Log Test +... AND Log to Console Test +Suite Teardown Log To Console Suite Teardown +Metadata Name Value # This is a comment +Library Process # This is a comment +Variables full_en.yaml # This is a comment +Variables full_en.json # This is a comment +Variables full_en.py # This is a comment +Resource full_en.resource + +*** Variables *** +${myvar} 123 # This is a comment + +*** Comments *** +This is a comments block +Second line of comments +*** Test Cases *** +first test + [Documentation] 3-This is the documentation + ... 4-A continued line of documentation + [Tags] first second + [Setup] Log To Console Test Setup + [Timeout] 60 + First Keyword nonsense + ${first}= Check Logic 'Yes' + ${second}= Check Logic 'Off' + Log Variables + Log Test executed with success, first=${first}, second=${second} + [Teardown] Log To Console Test Teardown + +second test + [Tags] first second # This is a comment + [Setup] Log To Console Test Setup # This is a comment + [Template] First Keyword # This is a comment + [Timeout] 60 # This is a comment + No Operation + Log this is ddt + Log To Console Test executed with success + [Teardown] Log To Console Test Teardown # This is a comment + +third test + Given "Mr. Smith" is registered + And "cart" has objects + When "Mr. Smith" clicks in checkout + Then the total is presented and awaits confirmation + But it is shown the unavailable payment method + +*** Keywords *** +First Keyword + [Arguments] ${arg}=None @{no_list} # This is a comment + [Documentation] 5-This is the documentation + ... + ... 7-A continued line of documentation + [Tags] first second # This is a comment + Log To Console This is the first keyword + +${user} is registered + No Operation + +${cart} has objects + No Operation + +${user} clicks in checkout + No Operation + +the total is presented and awaits confirmation + No Operation + +it is shown the unavailable payment method + No Operation diff --git a/utest/resources/robotdata/language/lang_bg.robot b/utest/resources/robotdata/language/lang_bg.robot index e97b119c2..a57d5234a 100644 --- a/utest/resources/robotdata/language/lang_bg.robot +++ b/utest/resources/robotdata/language/lang_bg.robot @@ -3,12 +3,119 @@ Language: Bulgarian # A blank line +*** Настройки *** +Документация This test data file is used in *RobotIDE* _integration_ tests.\n1-This is another line of the documentation\n2-A continued line of documentation +Първоначални настройки на комплекта Run Keywords Log To Console Suite Setup +... AND Log Test +... AND Log to Console Test +... AND My Suite Setup +Приключване на комплекта My Suite Teardown ${scalar} @{LIST} +Първоначални настройки на тестове My Test Setup +Приключване на тестове My Overriding Test Teardown +Етикети за тестове new_tag ride regeression # Comment on Tags +Метаданни My Meta data +Библиотека seleniumlibrary # Purposefully wrong case | | +Библиотека Process # This is a comment +Ресурс en/full_en.resource +Библиотека LibSpecБиблиотека +Библиотека ${LIB NAME} +Библиотека ArgLib ${ARG} +Ресурс ../resources/resource.resource +Ресурс ../resources/resource2.robot +Ресурс PathResource.robot +Ресурс ../resources/resource.robot +Ресурс ${RES_PATH}/another_resource.robot +Ресурс ${RES_PATH}/more_resources/${RES NAME} +Ресурс ${RES_PATH}/more_resources${/}${EMPTY}even_more_resources.robot +Променлива ../resources/varz.py +Променлива ../resources/dynamic_varz.py ${ARG} +Променлива en/full_en.yaml # This is a comment +Променлива en/full_en.json # This is a comment +Променлива en/full_en.py # This is a comment +Променлива ${RES_PATH}/more_varz.py +Библиотека ${technology lib} # defined in varz.py | | +Библиотека ${operating system} # defined in another_resource.robot | | + +*** Променливи *** +${SCALAR} value +@{LIST} 1 2 3 4 a b c d +${LIB NAME} Collections +${RES_PATH} ../resources +${ARG} value +${myvar} 123 # This is a comment + +*** Коментари *** +This is a comments block +Second line of comments *** Тестови случаи *** -First Test +My Test + [Документация] This is _test_ *case* documentation + [Етикети] test 1 + [Първоначални настройки] My Overriding Test Setup + Log Nothing to see + [Приключване] My Overriding Test Teardown + +first test + [Документация] 3-This is the documentation\n4-A continued line of documentation + [Етикети] first second + [Първоначални настройки] Log To Console Test Първоначални настройки + [Таймаут] 60 + First Keyword nonsense + ${first}= Check Logic 'Да' + ${second}= Check Logic 'Изключен' + Log Variables + Log Test executed with success, first=${first}, second=${second} + [Приключване] Log To Console Приключване на тестове + +second test + [Етикети] first second # This is a comment + [Първоначални настройки] Log To Console Test Първоначални настройки # This is a comment + [Шаблон] First Keyword # This is a comment + [Таймаут] 60 # This is a comment No Operation - First Keyword - Log To Console Test execution with success + Log this is ddt + Log To Console Test executed with success + [Приключване] Log To Console Приключване на тестове # This is a comment + +third test + В случай че "Mr. Smith" is registered + И "cart" has objects + Когато "Mr. Smith" clicks in checkout + Тогава the total is presented and awaits confirmation + Но it is shown the unavailable payment method *** Ключови думи *** +My Приключване на комплекта + [Аргументи] ${scalar arg} ${default arg}=default @{list arg} + [Документация] This is *user* _keyword_ documentation + Log ${scalar arg} + Log Many @{list arg} + [Return] Success + +Duplicate UK + No Operation + +My Test Setup + [Таймаут] + No Operation + First Keyword - Log To Console This is First Keyword + [Аргументи] ${arg}=None @{no_list} # This is a comment + [Документация] 5-This is the documentation\n\n7-A continued line of documentation + [Етикети] first second # This is a comment + Log To Console This is the first keyword + +${user} is registered + No Operation + +${cart} has objects + No Operation + +${user} clicks in checkout + No Operation + +the total is presented and awaits confirmation + No Operation + +it is shown the unavailable payment method + No Operation diff --git a/utest/resources/robotdata/language/lang_bs.robot b/utest/resources/robotdata/language/lang_bs.robot index b8e0b0d6a..58957f1fe 100644 --- a/utest/resources/robotdata/language/lang_bs.robot +++ b/utest/resources/robotdata/language/lang_bs.robot @@ -3,12 +3,124 @@ Language: Bosnian # A blank line +*** Postavke *** +Dokumentacija This test data file is used in *RobotIDE* _integration_ tests. +... 1-This is another line of the documentation +... 2-A continued line of documentation +Suite Setup Run Keywords Log To Console Suite Setup +... AND Log Test +... AND Log to Console Test +... AND My Suite Setup +Suite Teardown My Suite Teardown ${scalar} @{LIST} +Test Setup My Test Setup +Test Teardown My Overriding Test Teardown +Test Tagovi new_tag ride regeression # Comment on Tags +Metadata My Meta data +Library seleniumlibrary # Purposefully wrong case | | +Library Process # This is a comment +Resource en/full_en.resource +Library LibSpecLibrary +Library ${LIB NAME} +Library ArgLib ${ARG} +Resource ../resources/resource.resource +Resource ../resources/resource2.robot +Resource PathResource.robot +Resource ../resources/resource.robot +Resource ${RES_PATH}/another_resource.robot +Resource ${RES_PATH}/more_resources/${RES NAME} +Resource ${RES_PATH}/more_resources${/}${EMPTY}even_more_resources.robot +Variables ../resources/varz.py +Variables ../resources/dynamic_varz.py ${ARG} +Variables en/full_en.yaml # This is a comment +Variables en/full_en.json # This is a comment +Variables en/full_en.py # This is a comment +Variables ${RES_PATH}/more_varz.py +Library ${technology lib} # defined in varz.py | | +Library ${operating system} # defined in another_resource.robot | | + +*** Varijable *** +${SCALAR} value +@{LIST} 1 2 3 4 a b c d +${LIB NAME} Collections +${RES_PATH} ../resources +${ARG} value +${myvar} 123 # This is a comment + +*** Komentari *** +This is a comments block +Second line of comments *** Test Cases *** -First Test +My Test + [Dokumentacija] This is _test_ *case* documentation + [Tags] test 1 + [Postavke] My Overriding Test Setup + Log Nothing to see + [Teardown] My Overriding Test Teardown + +first test + [Dokumentacija] 3-This is the documentation + ... 4-A continued line of documentation + [Tags] first second + [Postavke] Log To Console Test Setup + [Timeout] 60 + First Keyword nonsense + ${first}= Check Logic 'Yes' + ${second}= Check Logic 'Off' + Log Variables + Log Test executed with success, first=${first}, second=${second} + [Teardown] Log To Console Test Teardown + +second test + [Tags] first second # This is a comment + [Postavke] Log To Console Test Setup # This is a comment + [Template] First Keyword # This is a comment + [Timeout] 60 # This is a comment No Operation - First Keyword - Log To Console Test execution with success + Log this is ddt + Log To Console Test executed with success + [Teardown] Log To Console Test Teardown # This is a comment + +third test + Uslovno "Mr. Smith" is registered + I "cart" has objects + Kada "Mr. Smith" clicks in checkout + Tada the total is presented and awaits confirmation + Ali it is shown the unavailable payment method *** Keywords *** +My Suite Teardown + [Argumenti] ${scalar arg} ${default arg}=default @{list arg} + [Dokumentacija] This is *user* _keyword_ documentation + Log ${scalar arg} + Log Many @{list arg} + [Return] Success + +Duplicate UK + No Operation + +My Test Setup + [Timeout] + No Operation + First Keyword - Log To Console This is First Keyword + [Argumenti] ${arg}=None @{no_list} # This is a comment + [Dokumentacija] 5-This is the documentation + ... + ... 7-A continued line of documentation + [Tags] first second # This is a comment + Log To Console This is the first keyword + +${user} is registered + No Operation + +${cart} has objects + No Operation + +${user} clicks in checkout + No Operation + +the total is presented and awaits confirmation + No Operation + +it is shown the unavailable payment method + No Operation diff --git a/utest/resources/robotdata/language/lang_cs.robot b/utest/resources/robotdata/language/lang_cs.robot index a42ee35ff..708f1a852 100644 --- a/utest/resources/robotdata/language/lang_cs.robot +++ b/utest/resources/robotdata/language/lang_cs.robot @@ -3,12 +3,119 @@ Language: Czech # A blank line +*** Nastavení *** +Dokumentace This test data file is used in *RobotIDE* _integration_ tests.\n1-This is another line of the documentation\n2-A continued line of documentation +Příprava sady Run Keywords Log To Console Suite Setup +... AND Log Test +... AND Log to Console Test +... AND My Suite Setup +Ukončení sady My Suite Teardown ${scalar} @{LIST} +Příprava testu My Test Setup +Ukončení testu My Overriding Test Teardown +Štítky testů new_tag ride regeression # Comment on Tags +Metadata My Meta data +Knihovna seleniumlibrary # Purposefully wrong case | | +Knihovna Process # This is a comment +Zdroj en/full_en.resource +Knihovna LibSpecLibrary +Knihovna ${LIB NAME} +Knihovna ArgLib ${ARG} +Zdroj ../resources/resource.resource +Zdroj ../resources/resource2.robot +Zdroj PathResource.robot +Zdroj ../resources/resource.robot +Zdroj ${RES_PATH}/another_resource.robot +Zdroj ${RES_PATH}/more_resources/${RES NAME} +Zdroj ${RES_PATH}/more_resources${/}${EMPTY}even_more_resources.robot +Proměnná ../resources/varz.py +Proměnná ../resources/dynamic_varz.py ${ARG} +Proměnná en/full_en.yaml # This is a comment +Proměnná en/full_en.json # This is a comment +Proměnná en/full_en.py # This is a comment +Proměnná ${RES_PATH}/more_varz.py +Knihovna ${technology lib} # defined in varz.py | | +Knihovna ${operating system} # defined in another_resource.robot | | + +*** Proměnné *** +${SCALAR} value +@{LIST} 1 2 3 4 a b c d +${LIB NAME} Collections +${RES_PATH} ../resources +${ARG} value +${myvar} 123 # This is a comment + +*** Komentáře *** +This is a comments block +Second line of comments *** Testovací případy *** -First Test +My Test + [Dokumentace] This is _test_ *case* documentation + [Štítky] test 1 + [Příprava] My Overriding Test Setup + Log Nothing to see + [Ukončení] My Overriding Test Teardown + +first test + [Dokumentace] 3-This is the documentation\n4-A continued line of documentation + [Štítky] first second + [Příprava] Log To Console Test Setup + [Časový limit] 60 + First Keyword nonsense + ${first}= Check Logic 'Ano' + ${second}= Check Logic 'Vypnuto' + Log Variables + Log Test executed with success, first=${first}, second=${second} + [Ukončení] Log To Console Test Teardown + +second test + [Štítky] first second # This is a comment + [Příprava] Log To Console Test Setup # This is a comment + [Šablona] First Keyword # This is a comment + [Časový limit] 60 # This is a comment No Operation - First Keyword - Log To Console Test execution with success + Log this is ddt + Log To Console Test executed with success + [Ukončení] Log To Console Test Teardown # This is a comment + +third test + Pokud "Mr. Smith" is registered + A "cart" has objects + Když "Mr. Smith" clicks in checkout + Pak the total is presented and awaits confirmation + Ale it is shown the unavailable payment method *** Klíčová slova *** +My Suite Teardown + [Argumenty] ${scalar arg} ${default arg}=default @{list arg} + [Dokumentace] This is *user* _keyword_ documentation + Log ${scalar arg} + Log Many @{list arg} + [Return] Success + +Duplicate UK + No Operation + +My Test Setup + [Časový limit] + No Operation + First Keyword - Log To Console This is First Keyword + [Argumenty] ${arg}=None @{no_list} # This is a comment + [Dokumentace] 5-This is the documentation\n\n7-A continued line of documentation + [Štítky] first second # This is a comment + Log To Console This is the first keyword + +${user} is registered + No Operation + +${cart} has objects + No Operation + +${user} clicks in checkout + No Operation + +the total is presented and awaits confirmation + No Operation + +it is shown the unavailable payment method + No Operation diff --git a/utest/resources/robotdata/language/lang_de.robot b/utest/resources/robotdata/language/lang_de.robot index d58bb7053..19afed8a8 100644 --- a/utest/resources/robotdata/language/lang_de.robot +++ b/utest/resources/robotdata/language/lang_de.robot @@ -3,12 +3,119 @@ Language: German # A blank line +*** Einstellungen *** +Dokumentation This test data file is used in *RobotIDE* _integration_ tests.\n1-This is another line of the documentation\n2-A continued line of documentation +Suitevorbereitung Run Keywords Log To Console Suite Setup +... AND Log Test +... AND Log to Console Test +... AND My Suite Setup +Suitenachbereitung My Suite Teardown ${scalar} @{LIST} +Testvorbereitung My Test Setup +Testnachbereitung My Overriding Test Teardown +Testmarker new_tag ride regeression # Comment on Tags +Metadaten My Meta data +Bibliothek seleniumlibrary # Purposefully wrong case | | +Bibliothek Process # This is a comment +Ressource en/full_en.resource +Bibliothek LibSpecLibrary +Bibliothek ${LIB NAME} +Bibliothek ArgLib ${ARG} +Ressource ../resources/resource.resource +Ressource ../resources/resource2.robot +Ressource PathResource.robot +Ressource ../resources/resource.robot +Ressource ${RES_PATH}/another_resource.robot +Ressource ${RES_PATH}/more_resources/${RES NAME} +Ressource ${RES_PATH}/more_resources${/}${EMPTY}even_more_resources.robot +Variablen ../resources/varz.py +Variablen ../resources/dynamic_varz.py ${ARG} +Variablen en/full_en.yaml # This is a comment +Variablen en/full_en.json # This is a comment +Variablen en/full_en.py # This is a comment +Variablen ${RES_PATH}/more_varz.py +Bibliothek ${technology lib} # defined in varz.py | | +Bibliothek ${operating system} # defined in another_resource.robot | | + +*** Variablen *** +${SCALAR} value +@{LIST} 1 2 3 4 a b c d +${LIB NAME} Collections +${RES_PATH} ../resources +${ARG} value +${myvar} 123 # This is a comment + +*** Kommentare *** +This is a comments block +Second line of comments *** Testfälle *** -First Test +My Test + [Dokumentation] This is _test_ *case* documentation + [Marker] test 1 + [Vorbereitung] My Overriding Test Setup + Log Nothing to see + [Nachbereitung] My Overriding Test Teardown + +first test + [Dokumentation] 3-This is the documentation\n4-A continued line of documentation + [Marker] first second + [Vorbereitung] Log To Console Test Setup + [Zeitlimit] 60 + First Keyword nonsense + ${first}= Check Logic 'Ja' + ${second}= Check Logic 'Aus' + Log Variables + Log Test executed with success, first=${first}, second=${second} + [Nachbereitung] Log To Console Test Teardown + +second test + [Marker] first second # This is a comment + [Vorbereitung] Log To Console Test Setup # This is a comment + [Vorlage] First Keyword # This is a comment + [Zeitlimit] 60 # This is a comment No Operation - First Keyword - Log To Console Test execution with success + Log this is ddt + Log To Console Test executed with success + [Nachbereitung] Log To Console Test Teardown # This is a comment + +third test + Angenommen "Mr. Smith" is registered + Und "cart" has objects + Wenn "Mr. Smith" clicks in checkout + Dann the total is presented and awaits confirmation + Aber it is shown the unavailable payment method *** Schlüsselwörter *** +My Suite Teardown + [Argumente] ${scalar arg} ${default arg}=default @{list arg} + [Dokumentation] This is *user* _keyword_ documentation + Log ${scalar arg} + Log Many @{list arg} + [Return] Success + +Duplicate UK + No Operation + +My Test Setup + [Zeitlimit] + No Operation + First Keyword - Log To Console This is First Keyword + [Argumente] ${arg}=None @{no_list} # This is a comment + [Dokumentation] 5-This is the documentation\n\n7-A continued line of documentation + [Marker] first second # This is a comment + Log To Console This is the first keyword + +${user} is registered + No Operation + +${cart} has objects + No Operation + +${user} clicks in checkout + No Operation + +the total is presented and awaits confirmation + No Operation + +it is shown the unavailable payment method + No Operation diff --git a/utest/resources/robotdata/language/lang_en.robot b/utest/resources/robotdata/language/lang_en.robot index ce3f9bfff..2bb413f84 100644 --- a/utest/resources/robotdata/language/lang_en.robot +++ b/utest/resources/robotdata/language/lang_en.robot @@ -3,13 +3,126 @@ Language: English # A blank line +*** Settings *** +Documentation This test data file is used in *RobotIDE* _integration_ tests. +... 1-This is another line of the documentation +... 2-A continued line of documentation +Suite Setup Run Keywords Log To Console Suite Setup +... AND Log Test +... AND Log to Console Test +... AND My Suite Setup +Suite Teardown My Suite Teardown ${scalar} @{LIST} +Test Setup My Test Setup +Test Tags new_tag ride regeression # Comment on Tags +Metadata My Meta data +Library seleniumlibrary # Purposefully wrong case | | +Library Process # This is a comment +Resource en/full_en.resource +Library LibSpecLibrary +Library ${LIB NAME} +Library ArgLib ${ARG} +Resource ../resources/resource.resource +Resource ../resources/resource2.robot +Resource PathResource.robot +Resource ../resources/resource.robot +Resource ${RES_PATH}/another_resource.robot +Resource ${RES_PATH}/more_resources/${RES NAME} +Resource ${RES_PATH}/more_resources${/}${EMPTY}even_more_resources.robot +Variables ../resources/varz.py +Variables ../resources/dynamic_varz.py ${ARG} +Variables en/full_en.yaml # This is a comment +Variables en/full_en.json # This is a comment +Variables en/full_en.py # This is a comment +Variables ${RES_PATH}/more_varz.py +Library ${technology lib} # defined in varz.py | | +Library ${operating system} # defined in another_resource.robot | | + +*** Variables *** +${SCALAR} value +@{LIST} 1 +... 2 +... 3 +... 4 +... a +... b +... c +... d +${LIB NAME} Collections +${RES_PATH} ../resources +${ARG} value +${myvar} 123 +... # This is a comment + +*** Comments *** +This is a comments block +Second line of comments *** Test Cases *** -First Test +My Test + [Documentation] This is _test_ *case* documentation + [Setup] My Overriding Test Setup + Log Nothing to see + [Teardown] My Overriding Test Teardown + +first test + [Documentation] 3-This is the documentation + ... 4-A continued line of documentation + [Setup] Log To Console Test Setup + [Timeout] 60 + First Keyword nonsense + ${first}= Check Logic 'Si' + ${second}= Check Logic 'Off' + Log Variables + Log Test executed with success, first=${first}, second=${second} + [Teardown] Log To Console Test Teardown + +second test + [Setup] Log To Console Test Setup # This is a comment + [Timeout] 60 # This is a comment No Operation - First Keyword - Log To Console Test execution with success + Log this is ddt + Log To Console Test executed with success + [Teardown] Log To Console Test Teardown # This is a comment + +third test + Given "Mr. Smith" is registered + And "cart" has objects + When "Mr. Smith" clicks in checkout + Then the total is presented and awaits confirmation + But it is shown the unavailable payment method *** Keywords *** +My Suite Teardown + [Arguments] ${scalar arg} ${default arg}=default @{list arg} + [Documentation] This is *user* _keyword_ documentation + Log ${scalar arg} + Log Many @{list arg} + [Return] Success + +Duplicate UK + No Operation + +My Test Setup + [Timeout] + No Operation + First Keyword - [Arguments] ${arg}=None # This is a comment - Log To Console This is First Keyword + [Arguments] ${arg}=None @{no_list} # This is a comment + [Documentation] 5-This is the documentation + ... + ... 7-A continued line of documentation + Log To Console This is the first keyword + +${user} is registered + No Operation + +${cart} has objects + No Operation + +${user} clicks in checkout + No Operation + +the total is presented and awaits confirmation + No Operation + +it is shown the unavailable payment method + No Operation diff --git a/utest/resources/robotdata/language/lang_es.robot b/utest/resources/robotdata/language/lang_es.robot index df72a57dd..760fbf1e1 100644 --- a/utest/resources/robotdata/language/lang_es.robot +++ b/utest/resources/robotdata/language/lang_es.robot @@ -3,12 +3,118 @@ Language: Spanish # A blank line +*** Configuraciones *** +Documentación This test data file is used in *RobotIDE* _integration_ tests.\n1-This is another line of the documentation\n2-A continued line of documentation +Configuración de la Suite Run Keywords Log To Console Suite Setup +... AND Log Test +... AND Log to Console Test +... AND My Suite Setup +Desmontaje de la Suite My Suite Teardown ${scalar} @{LIST} +Configuración de prueba My Test Setup +Etiquetas de la prueba new_tag ride regeression # Comment on Tags +Metadatos My Meta data +Biblioteca seleniumlibrary # Purposefully wrong case | | +Biblioteca Process # This is a comment +Recursos en/full_en.resource +Biblioteca LibSpecLibrary +Biblioteca ${LIB NAME} +Biblioteca ArgLib ${ARG} +Recursos ../resources/resource.resource +Recursos ../resources/resource2.robot +Recursos PathResource.robot +Recursos ../resources/resource.robot +Recursos ${RES_PATH}/another_resource.robot +Recursos ${RES_PATH}/more_resources/${RES NAME} +Recursos ${RES_PATH}/more_resources${/}${EMPTY}even_more_resources.robot +Variable ../resources/varz.py +Variable ../resources/dynamic_varz.py ${ARG} +Variable en/full_en.yaml # This is a comment +Variable en/full_en.json # This is a comment +Variable en/full_en.py # This is a comment +Variable ${RES_PATH}/more_varz.py +Biblioteca ${technology lib} # defined in varz.py | | +Biblioteca ${operating system} # defined in another_resource.robot | | + +*** Variables *** +${SCALAR} value +@{LIST} 1 2 3 4 a b c d +${LIB NAME} Collections +${RES_PATH} ../resources +${ARG} value +${myvar} 123 # This is a comment + +*** Comentarios *** +This is a comments block +Second line of comments *** Casos de prueba *** -First Test +My Test + [Documentación] This is _test_ *case* documentation + [Etiquetas] test 1 + [Configuración] My Overriding Test Setup + Log Nothing to see + [Desmontaje] My Overriding Test Teardown + +first test + [Documentación] 3-This is the documentation\n4-A continued line of documentation + [Etiquetas] first second + [Configuración] Log To Console Test Setup + [Tiempo agotado] 60 + First Keyword nonsense + ${first}= Check Logic 'Si' + ${second}= Check Logic 'Off' + Log Variables + Log Test executed with success, first=${first}, second=${second} + [Desmontaje] Log To Console Test Teardown + +second test + [Etiquetas] first second # This is a comment + [Configuración] Log To Console Test Setup # This is a comment + [Plantilla] First Keyword # This is a comment + [Tiempo agotado] 60 # This is a comment No Operation - First Keyword - Log To Console Test execution with success + Log this is ddt + Log To Console Test executed with success + [Desmontaje] Log To Console Test Teardown # This is a comment + +third test + Dado "Mr. Smith" is registered + Y "cart" has objects + Cuando "Mr. Smith" clicks in checkout + Entonces the total is presented and awaits confirmation + Pero it is shown the unavailable payment method *** Palabras clave *** +My Suite Teardown + [Argumentos] ${scalar arg} ${default arg}=default @{list arg} + [Documentación] This is *user* _keyword_ documentation + Log ${scalar arg} + Log Many @{list arg} + [Return] Success + +Duplicate UK + No Operation + +My Test Setup + [Tiempo agotado] + No Operation + First Keyword - Log To Console This is First Keyword + [Argumentos] ${arg}=None @{no_list} # This is a comment + [Documentación] 5-This is the documentation\n\n7-A continued line of documentation + [Etiquetas] first second # This is a comment + Log To Console This is the first keyword + +${user} is registered + No Operation + +${cart} has objects + No Operation + +${user} clicks in checkout + No Operation + +the total is presented and awaits confirmation + No Operation + +it is shown the unavailable payment method + No Operation diff --git a/utest/resources/robotdata/language/lang_fi.robot b/utest/resources/robotdata/language/lang_fi.robot index 7a164ec87..2a43be269 100644 --- a/utest/resources/robotdata/language/lang_fi.robot +++ b/utest/resources/robotdata/language/lang_fi.robot @@ -3,12 +3,119 @@ Language: Finnish # A blank line +*** Asetukset *** +Dokumentaatio This test data file is used in *RobotIDE* _integration_ tests.\n1-This is another line of the documentation\n2-A continued line of documentation +Setin Alustus Run Keywords Log To Console Suite Setup +... AND Log Test +... AND Log to Console Test +... AND My Suite Setup +Setin Alasajo My Suite Teardown ${scalar} @{LIST} +Testin Alustus My Test Setup +Testin Alasajo My Overriding Test Teardown +Testin Tagit new_tag ride regeression # Comment on Tags +Metatiedot My Meta data +Kirjasto seleniumlibrary # Purposefully wrong case | | +Kirjasto Process # This is a comment +Resurssi en/full_en.resource +Kirjasto LibSpecLibrary +Kirjasto ${LIB NAME} +Kirjasto ArgLib ${ARG} +Resurssi ../resources/resource.resource +Resurssi ../resources/resource2.robot +Resurssi PathResource.robot +Resurssi ../resources/resource.robot +Resurssi ${RES_PATH}/another_resource.robot +Resurssi ${RES_PATH}/more_resources/${RES NAME} +Resurssi ${RES_PATH}/more_resources${/}${EMPTY}even_more_resources.robot +Muuttujat ../resources/varz.py +Muuttujat ../resources/dynamic_varz.py ${ARG} +Muuttujat en/full_en.yaml # This is a comment +Muuttujat en/full_en.json # This is a comment +Muuttujat en/full_en.py # This is a comment +Muuttujat ${RES_PATH}/more_varz.py +Kirjasto ${technology lib} # defined in varz.py | | +Kirjasto ${operating system} # defined in another_resource.robot | | + +*** Muuttujat *** +${SCALAR} value +@{LIST} 1 2 3 4 a b c d +${LIB NAME} Collections +${RES_PATH} ../resources +${ARG} value +${myvar} 123 # This is a comment + +*** Kommentit *** +This is a comments block +Second line of comments *** Testit *** -First Test +My Test + [Dokumentaatio] This is _test_ *case* documentation + [Tagit] test 1 + [Alustus] My Overriding Test Setup + Log Nothing to see + [Alasajo] My Overriding Test Teardown + +first test + [Dokumentaatio] 3-This is the documentation\n4-A continued line of documentation + [Tagit] first second + [Alustus] Log To Console Test Setup + [Aikaraja] 60 + First Keyword nonsense + ${first}= Check Logic 'Kyllä' + ${second}= Check Logic 'Pois' + Log Variables + Log Test executed with success, first=${first}, second=${second} + [Alasajo] Log To Console Test Teardown + +second test + [Tagit] first second # This is a comment + [Alustus] Log To Console Test Setup # This is a comment + [Malli] First Keyword # This is a comment + [Aikaraja] 60 # This is a comment No Operation - First Keyword - Log To Console Test execution with success + Log this is ddt + Log To Console Test executed with success + [Alasajo] Log To Console Test Teardown # This is a comment + +third test + Oletetaan "Mr. Smith" is registered + Ja "cart" has objects + Kun "Mr. Smith" clicks in checkout + Niin the total is presented and awaits confirmation + Mutta it is shown the unavailable payment method *** Avainsanat *** +My Suite Teardown + [Argumentit] ${scalar arg} ${default arg}=default @{list arg} + [Dokumentaatio] This is *user* _keyword_ documentation + Log ${scalar arg} + Log Many @{list arg} + [Return] Success + +Duplicate UK + No Operation + +My Test Setup + [Aikaraja] + No Operation + First Keyword - Log To Console This is First Keyword + [Argumentit] ${arg}=None @{no_list} # This is a comment + [Dokumentaatio] 5-This is the documentation\n\n7-A continued line of documentation + [Tagit] first second # This is a comment + Log To Console This is the first keyword + +${user} is registered + No Operation + +${cart} has objects + No Operation + +${user} clicks in checkout + No Operation + +the total is presented and awaits confirmation + No Operation + +it is shown the unavailable payment method + No Operation diff --git a/utest/resources/robotdata/language/lang_fr.robot b/utest/resources/robotdata/language/lang_fr.robot index c176f3920..c683c8f5f 100644 --- a/utest/resources/robotdata/language/lang_fr.robot +++ b/utest/resources/robotdata/language/lang_fr.robot @@ -1,14 +1,126 @@ -# This is the french example +# This is the preamble Language: French -Vide ligne +# A blank line -*** Unités de Test *** -Premiére Test +*** Paramètres *** +Documentation This test data file is used in *RobotIDE* _integration_ tests. +... 1-This is another line of the documentation +... 2-A continued line of documentation +Mise en place de suite Run Keywords Log To Console Suite Setup +... AND Log Test +... AND Log to Console Test +... AND My Suite Setup +Démontage de suite My Suite Teardown ${scalar} @{LIST} +Mise en place de test My Test Setup +Test Teardown My Overriding Test Teardown +Étiquette de test new_tag ride regeression # Comment on Tags +Méta-donnée My Meta data +Bibliothèque seleniumlibrary # Purposefully wrong case | | +Bibliothèque Process # This is a comment +Ressource en/full_en.resource +Bibliothèque LibSpecLibrary +Bibliothèque ${LIB NAME} +Bibliothèque ArgLib ${ARG} +Ressource ../resources/resource.resource +Ressource ../resources/resource2.robot +Ressource PathResource.robot +Ressource ../resources/resource.robot +Ressource ${RES_PATH}/another_resource.robot +Ressource ${RES_PATH}/more_resources/${RES NAME} +Ressource ${RES_PATH}/more_resources${/}${EMPTY}even_more_resources.robot +Variable ../resources/varz.py +Variable ../resources/dynamic_varz.py ${ARG} +Variable en/full_en.yaml # This is a comment +Variable en/full_en.json # This is a comment +Variable en/full_en.py # This is a comment +Variable ${RES_PATH}/more_varz.py +Bibliothèque ${technology lib} # defined in varz.py | | +Bibliothèque ${operating system} # defined in another_resource.robot | | + +*** Variables *** +${SCALAR} value +@{LIST} 1 2 3 4 a b c d +${LIB NAME} Collections +${RES_PATH} ../resources +${ARG} value +${myvar} 123 # This is a comment + +*** Commentaires *** +This is a comments block +Second line of comments +*** Unités de test *** +My Test + [Documentation] This is _test_ *case* documentation + [Étiquette] test 1 + [Mise en place] My Overriding Test Setup + Log Nothing to see + [Démontage] My Overriding Test Teardown + +first test + [Documentation] 3-This is the documentation + ... 4-A continued line of documentation + [Étiquette] first second + [Mise en place] Log To Console Test Setup + [Délai d'attente] 60 + First Keyword nonsense + ${first}= Check Logic 'Oui' + ${second}= Check Logic 'Désactivé' + Log Variables + Log Test executed with success, first=${first}, second=${second} + [Démontage] Log To Console Test Teardown + +second test + [Étiquette] first second # This is a comment + [Mise en place] Log To Console Test Setup # This is a comment + [Modèle] First Keyword # This is a comment + [Délai d'attente] 60 # This is a comment No Operation - First Keyword - Log To Console Test execution with success + Log this is ddt + Log To Console Test executed with success + [Démontage] Log To Console Test Teardown # This is a comment + +third test + Étant donné "Mr. Smith" is registered + Et "cart" has objects + Lorsque "Mr. Smith" clicks in checkout + Alors the total is presented and awaits confirmation + Mais it is shown the unavailable payment method *** Mots-clés *** +My Suite Teardown + [Arguments] ${scalar arg} ${default arg}=default @{list arg} + [Documentation] This is *user* _keyword_ documentation + Log ${scalar arg} + Log Many @{list arg} + [Return] Success + +Duplicate UK + No Operation + +My Test Setup + [Délai d'attente] + No Operation + First Keyword - Log To Console This is First Keyword + [Arguments] ${arg}=None @{no_list} # This is a comment + [Documentation] 5-This is the documentation + ... + ... 7-A continued line of documentation + [Étiquette] first second # This is a comment + Log To Console This is the first keyword + +${user} is registered + No Operation + +${cart} has objects + No Operation + +${user} clicks in checkout + No Operation + +the total is presented and awaits confirmation + No Operation + +it is shown the unavailable payment method + No Operation diff --git a/utest/resources/robotdata/language/lang_hi.robot b/utest/resources/robotdata/language/lang_hi.robot index 1701a516e..52e91886c 100644 --- a/utest/resources/robotdata/language/lang_hi.robot +++ b/utest/resources/robotdata/language/lang_hi.robot @@ -3,12 +3,119 @@ Language: Hindi # A blank line +*** स्थापना *** +प्रलेखन This test data file is used in *RobotIDE* _integration_ tests.\n1-This is another line of the documentation\n2-A continued line of documentation +जांच की शुरुवात Run Keywords Log To Console Suite Setup +... AND Log Test +... AND Log to Console Test +... AND My Suite Setup +Suite Teardown My Suite Teardown ${scalar} @{LIST} +Test Setup My Test Setup +Test Teardown My Overriding Test Teardown +जाँचका उपनाम new_tag ride regeression # Comment on Tags +अधि-आंकड़ा My Meta data +कोड़ प्रतिबिंब संग्रह seleniumlibrary # Purposefully wrong case | | +कोड़ प्रतिबिंब संग्रह Process # This is a comment +संसाधन en/full_en.resource +कोड़ प्रतिबिंब संग्रह LibSpecLibrary +कोड़ प्रतिबिंब संग्रह ${LIB NAME} +कोड़ प्रतिबिंब संग्रह ArgLib ${ARG} +संसाधन ../resources/resource.resource +संसाधन ../resources/resource2.robot +संसाधन PathResource.robot +संसाधन ../resources/resource.robot +संसाधन ${RES_PATH}/another_resource.robot +संसाधन ${RES_PATH}/more_resources/${RES NAME} +संसाधन ${RES_PATH}/more_resources${/}${EMPTY}even_more_resources.robot +चर ../resources/varz.py +चर ../resources/dynamic_varz.py ${ARG} +चर en/full_en.yaml # This is a comment +चर en/full_en.json # This is a comment +चर en/full_en.py # This is a comment +चर ${RES_PATH}/more_varz.py +कोड़ प्रतिबिंब संग्रह ${technology lib} # defined in varz.py | | +कोड़ प्रतिबिंब संग्रह ${operating system} # defined in another_resource.robot | | + +*** चर *** +${SCALAR} value +@{LIST} 1 2 3 4 a b c d +${LIB NAME} Collections +${RES_PATH} ../resources +${ARG} value +${myvar} 123 # This is a comment + +*** टिप्पणी *** +This is a comments block +Second line of comments *** नियत कार्य प्रवेशिका *** -First Test +My Test + [प्रलेखन] This is _test_ *case* documentation + [निशान] test 1 + [व्यवस्थापना] My Overriding Test Setup + Log Nothing to see + [विमोचन] My Overriding Test Teardown + +first test + [प्रलेखन] 3-This is the documentation\n4-A continued line of documentation + [निशान] first second + [व्यवस्थापना] Log To Console Test Setup + [समय समाप्त] 60 + First Keyword nonsense + ${first}= Check Logic 'निश्चित' + ${second}= Check Logic 'हालाँकि' + Log Variables + Log Test executed with success, first=${first}, second=${second} + [विमोचन] Log To Console Test Teardown + +second test + [निशान] first second # This is a comment + [व्यवस्थापना] Log To Console Test Setup # This is a comment + [साँचा] First Keyword # This is a comment + [समय समाप्त] 60 # This is a comment No Operation - First Keyword - Log To Console Test execution with success + Log this is ddt + Log To Console Test executed with success + [विमोचन] Log To Console Test Teardown # This is a comment + +third test + दिया हुआ "Mr. Smith" is registered + और "cart" has objects + जब "Mr. Smith" clicks in checkout + तब the total is presented and awaits confirmation + परंतु it is shown the unavailable payment method *** कुंजीशब्द *** +My Suite Teardown + [प्राचल] ${scalar arg} ${default arg}=default @{list arg} + [प्रलेखन] This is *user* _keyword_ documentation + Log ${scalar arg} + Log Many @{list arg} + [Return] Success + +Duplicate UK + No Operation + +My Test Setup + [समय समाप्त] + No Operation + First Keyword - Log To Console This is First Keyword + [प्राचल] ${arg}=None @{no_list} # This is a comment + [प्रलेखन] 5-This is the documentation\n\n7-A continued line of documentation + [निशान] first second # This is a comment + Log To Console This is the first keyword + +${user} is registered + No Operation + +${cart} has objects + No Operation + +${user} clicks in checkout + No Operation + +the total is presented and awaits confirmation + No Operation + +it is shown the unavailable payment method + No Operation diff --git a/utest/resources/robotdata/language/lang_it.robot b/utest/resources/robotdata/language/lang_it.robot index b8cae37eb..72f35115f 100644 --- a/utest/resources/robotdata/language/lang_it.robot +++ b/utest/resources/robotdata/language/lang_it.robot @@ -3,12 +3,124 @@ Language: Italian # A blank line +*** Impostazioni *** +Documentazione This test data file is used in *RobotIDE* _integration_ tests. +... 1-This is another line of the documentation +... 2-A continued line of documentation +Suite Setup Run Keywords Log To Console Suite Setup +... AND Log Test +... AND Log to Console Test +... AND My Suite Setup +Suite Teardown My Suite Teardown ${scalar} @{LIST} +Test Setup My Test Setup +Test Teardown My Overriding Test Teardown +Tag Del Test new_tag ride regeression # Comment on Tags +Metadati My Meta data +Library seleniumlibrary # Purposefully wrong case | | +Library Process # This is a comment +Resource en/full_en.resource +Library LibSpecLibrary +Library ${LIB NAME} +Library ArgLib ${ARG} +Resource ../resources/resource.resource +Resource ../resources/resource2.robot +Resource PathResource.robot +Resource ../resources/resource.robot +Resource ${RES_PATH}/another_resource.robot +Resource ${RES_PATH}/more_resources/${RES NAME} +Resource ${RES_PATH}/more_resources${/}${EMPTY}even_more_resources.robot +Variables ../resources/varz.py +Variables ../resources/dynamic_varz.py ${ARG} +Variables en/full_en.yaml # This is a comment +Variables en/full_en.json # This is a comment +Variables en/full_en.py # This is a comment +Variables ${RES_PATH}/more_varz.py +Library ${technology lib} # defined in varz.py | | +Library ${operating system} # defined in another_resource.robot | | + +*** Variabili *** +${SCALAR} value +@{LIST} 1 2 3 4 a b c d +${LIB NAME} Collections +${RES_PATH} ../resources +${ARG} value +${myvar} 123 # This is a comment + +*** Commenti *** +This is a comments block +Second line of comments *** Casi Di Test *** -First Test +My Test + [Documentazione] This is _test_ *case* documentation + [Tags] test 1 + [Configurazione] My Overriding Test Setup + Log Nothing to see + [Distruzione] My Overriding Test Teardown + +first test + [Documentazione] 3-This is the documentation + ... 4-A continued line of documentation + [Tags] first second + [Configurazione] Log To Console Test Setup + [Timeout] 60 + First Keyword nonsense + ${first}= Check Logic 'Sì' + ${second}= Check Logic 'Off' + Log Variables + Log Test executed with success, first=${first}, second=${second} + [Distruzione] Log To Console Test Teardown + +second test + [Tags] first second # This is a comment + [Configurazione] Log To Console Test Setup # This is a comment + [Template] First Keyword # This is a comment + [Timeout] 60 # This is a comment No Operation - First Keyword - Log To Console Test execution with success + Log this is ddt + Log To Console Test executed with success + [Distruzione] Log To Console Test Teardown # This is a comment + +third test + Dato "Mr. Smith" is registered + E "cart" has objects + Quando "Mr. Smith" clicks in checkout + Allora the total is presented and awaits confirmation + Ma it is shown the unavailable payment method *** Parole Chiave *** +My Suite Teardown + [Parametri] ${scalar arg} ${default arg}=default @{list arg} + [Documentazione] This is *user* _keyword_ documentation + Log ${scalar arg} + Log Many @{list arg} + [Return] Success + +Duplicate UK + No Operation + +My Test Setup + [Timeout] + No Operation + First Keyword - Log To Console This is First Keyword + [Parametri] ${arg}=None @{no_list} # This is a comment + [Documentazione] 5-This is the documentation + ... + ... 7-A continued line of documentation + [Tags] first second # This is a comment + Log To Console This is the first keyword + +${user} is registered + No Operation + +${cart} has objects + No Operation + +${user} clicks in checkout + No Operation + +the total is presented and awaits confirmation + No Operation + +it is shown the unavailable payment method + No Operation diff --git a/utest/resources/robotdata/language/lang_ja.robot b/utest/resources/robotdata/language/lang_ja.robot new file mode 100644 index 000000000..9fd54911b --- /dev/null +++ b/utest/resources/robotdata/language/lang_ja.robot @@ -0,0 +1,121 @@ +# This is the preamble +Language: Japanese + +# A blank line + +*** 設定 *** +ドキュメント This test data file is used in *RobotIDE* _integration_ tests.\n1-This is another line of the documentation\n2-A continued line of documentation +スイート セットアップ Run Keywords Log To Console Suite Setup +... AND Log Test +... AND Log to Console Test +... AND My Suite Setup +スイート ティアダウン My Suite Teardown ${scalar} @{LIST} +テスト セットアップ My Test Setup +テスト ティアダウン My Overriding Test Teardown +テスト タグ new_tag ride regeression # Comment on Tags +メタデータ My Meta data +ライブラリ seleniumlibrary # Purposefully wrong case | | +ライブラリ Process # This is a comment +リソース en/full_en.resource +ライブラリ LibSpecLibrary +ライブラリ ${LIB NAME} +ライブラリ ArgLib ${ARG} +リソース ../resources/resource.resource +リソース ../resources/resource2.robot +リソース PathResource.robot +リソース ../resources/resource.robot +リソース ${RES_PATH}/another_resource.robot +リソース ${RES_PATH}/more_resources/${RES NAME} +リソース ${RES_PATH}/more_resources${/}${EMPTY}even_more_resources.robot +変数 ../resources/varz.py +変数 ../resources/dynamic_varz.py ${ARG} +変数 en/full_en.yaml # This is a comment +変数 en/full_en.json # This is a comment +変数 en/full_en.py # This is a comment +変数 ${RES_PATH}/more_varz.py +ライブラリ ${technology lib} # defined in varz.py | | +ライブラリ ${operating system} # defined in another_resource.robot | | + +*** 変数 *** +${SCALAR} value +@{LIST} 1 2 3 4 a b c d +${LIB NAME} Collections +${RES_PATH} ../resources +${ARG} value +${myvar} 123 # This is a comment + +*** コメント *** +This is a comments block +Second line of comments +*** テスト ケース *** +My Test + [ドキュメント] This is _test_ *case* documentation + [タグ] test 1 + [セットアップ] My Overriding Test Setup + Log Nothing to see + [ティアダウン] My Overriding Test Teardown + +first test + [ドキュメント] 3-This is the documentation\n4-A continued line of documentation + [タグ] first second + [セットアップ] Log To Console Test Setup + [タイムアウト] 60 + First Keyword nonsense + ${first}= Check Logic '有効' + ${second}= Check Logic 'いいえ' + Log Variables + Log Test executed with success, first=${first}, second=${second} + [ティアダウン] Log To Console Test Teardown + +second test + [タグ] first second # This is a comment + [セットアップ] Log To Console Test Setup # This is a comment + [テンプレート] First Keyword # This is a comment + [タイムアウト] 60 # This is a comment + No Operation + Log this is ddt + Log To Console Test executed with success + [ティアダウン] Log To Console Test Teardown # This is a comment + +third test + 仮定 "Mr. Smith" is registered + および "cart" has objects + 条件 "Mr. Smith" clicks in checkout + アクション the total is presented and awaits confirmation + ただし it is shown the unavailable payment method + +*** キーワード *** +My Suite Teardown + [引数] ${scalar arg} ${default arg}=default @{list arg} + [ドキュメント] This is *user* _keyword_ documentation + Log ${scalar arg} + Log Many @{list arg} + [Return] Success + +Duplicate UK + No Operation + +My Test Setup + [タイムアウト] + No Operation + +First Keyword + [引数] ${arg}=None @{no_list} # This is a comment + [ドキュメント] 5-This is the documentation\n\n7-A continued line of documentation + [タグ] first second # This is a comment + Log To Console This is the first keyword + +${user} is registered + No Operation + +${cart} has objects + No Operation + +${user} clicks in checkout + No Operation + +the total is presented and awaits confirmation + No Operation + +it is shown the unavailable payment method + No Operation diff --git a/utest/resources/robotdata/language/lang_nl.robot b/utest/resources/robotdata/language/lang_nl.robot index b5155c512..a6d3f113a 100644 --- a/utest/resources/robotdata/language/lang_nl.robot +++ b/utest/resources/robotdata/language/lang_nl.robot @@ -3,12 +3,119 @@ Language: Dutch # A blank line +*** Instellingen *** +Documentatie This test data file is used in *RobotIDE* _integration_ tests.\n1-This is another line of the documentation\n2-A continued line of documentation +Suite Preconditie Run Keywords Log To Console Suite Setup +... AND Log Test +... AND Log to Console Test +... AND My Suite Setup +Suite Postconditie My Suite Teardown ${scalar} @{LIST} +Test Preconditie My Test Setup +Test Postconditie My Overriding Test Teardown +Test Labels new_tag ride regeression # Comment on Tags +Metadata My Meta data +Bibliotheek seleniumlibrary # Purposefully wrong case | | +Bibliotheek Process # This is a comment +Resource en/full_en.resource +Bibliotheek LibSpecLibrary +Bibliotheek ${LIB NAME} +Bibliotheek ArgLib ${ARG} +Resource ../resources/resource.resource +Resource ../resources/resource2.robot +Resource PathResource.robot +Resource ../resources/resource.robot +Resource ${RES_PATH}/another_resource.robot +Resource ${RES_PATH}/more_resources/${RES NAME} +Resource ${RES_PATH}/more_resources${/}${EMPTY}even_more_resources.robot +Variabele ../resources/varz.py +Variabele ../resources/dynamic_varz.py ${ARG} +Variabele en/full_en.yaml # This is a comment +Variabele en/full_en.json # This is a comment +Variabele en/full_en.py # This is a comment +Variabele ${RES_PATH}/more_varz.py +Bibliotheek ${technology lib} # defined in varz.py | | +Bibliotheek ${operating system} # defined in another_resource.robot | | + +*** Variabelen *** +${SCALAR} value +@{LIST} 1 2 3 4 a b c d +${LIB NAME} Collections +${RES_PATH} ../resources +${ARG} value +${myvar} 123 # This is a comment + +*** Opmerkingen *** +This is a comments block +Second line of comments *** Testgevallen *** -First Test +My Test + [Documentatie] This is _test_ *case* documentation + [Labels] test 1 + [Preconditie] My Overriding Test Setup + Log Nothing to see + [Postconditie] My Overriding Test Teardown + +first test + [Documentatie] 3-This is the documentation\n4-A continued line of documentation + [Labels] first second + [Preconditie] Log To Console Test Setup + [Time-out] 60 + First Keyword nonsense + ${first}= Check Logic 'Ja' + ${second}= Check Logic 'Uit' + Log Variables + Log Test executed with success, first=${first}, second=${second} + [Postconditie] Log To Console Test Teardown + +second test + [Labels] first second # This is a comment + [Preconditie] Log To Console Test Setup # This is a comment + [Sjabloon] First Keyword # This is a comment + [Time-out] 60 # This is a comment No Operation - First Keyword - Log To Console Test execution with success + Log this is ddt + Log To Console Test executed with success + [Postconditie] Log To Console Test Teardown # This is a comment + +third test + Stel "Mr. Smith" is registered + En "cart" has objects + Als "Mr. Smith" clicks in checkout + Dan the total is presented and awaits confirmation + Maar it is shown the unavailable payment method *** Sleutelwoorden *** +My Suite Teardown + [Parameters] ${scalar arg} ${default arg}=default @{list arg} + [Documentatie] This is *user* _keyword_ documentation + Log ${scalar arg} + Log Many @{list arg} + [Return] Success + +Duplicate UK + No Operation + +My Test Setup + [Time-out] + No Operation + First Keyword - Log To Console This is First Keyword + [Parameters] ${arg}=None @{no_list} # This is a comment + [Documentatie] 5-This is the documentation\n\n7-A continued line of documentation + [Labels] first second # This is a comment + Log To Console This is the first keyword + +${user} is registered + No Operation + +${cart} has objects + No Operation + +${user} clicks in checkout + No Operation + +the total is presented and awaits confirmation + No Operation + +it is shown the unavailable payment method + No Operation diff --git a/utest/resources/robotdata/language/lang_pl.robot b/utest/resources/robotdata/language/lang_pl.robot index dc34b7e1e..747b3d6f1 100644 --- a/utest/resources/robotdata/language/lang_pl.robot +++ b/utest/resources/robotdata/language/lang_pl.robot @@ -3,24 +3,119 @@ Language: Polish # A blank line -*** Variables *** -&{error} name=err - -*** Comments *** -This is a comments block -Second line of comments -Maybe this block is still in preamble -One more line - +*** Ustawienia *** +Dokumentacja This test data file is used in *RobotIDE* _integration_ tests.\n1-This is another line of the documentation\n2-A continued line of documentation +Inicjalizacja Zestawu Run Keywords Log To Console Suite Setup +... AND Log Test +... AND Log to Console Test +... AND My Suite Setup +Ukończenie Zestawu My Suite Teardown ${scalar} @{LIST} +Inicjalizacja Testu My Test Setup +Ukończenie Testu My Overriding Test Teardown +Znaczniki Testu new_tag ride regeression # Comment on Tags +Metadane My Meta data +Biblioteka seleniumlibrary # Purposefully wrong case | | +Biblioteka Process # This is a comment +Zasób en/full_en.resource +Biblioteka LibSpecLibrary +Biblioteka ${LIB NAME} +Biblioteka ArgLib ${ARG} +Zasób ../resources/resource.resource +Zasób ../resources/resource2.robot +Zasób PathResource.robot +Zasób ../resources/resource.robot +Zasób ${RES_PATH}/another_resource.robot +Zasób ${RES_PATH}/more_resources/${RES NAME} +Zasób ${RES_PATH}/more_resources${/}${EMPTY}even_more_resources.robot +Zmienne ../resources/varz.py +Zmienne ../resources/dynamic_varz.py ${ARG} +Zmienne en/full_en.yaml # This is a comment +Zmienne en/full_en.json # This is a comment +Zmienne en/full_en.py # This is a comment +Zmienne ${RES_PATH}/more_varz.py +Biblioteka ${technology lib} # defined in varz.py | | +Biblioteka ${operating system} # defined in another_resource.robot | | + +*** Zmienne *** +${SCALAR} value +@{LIST} 1 2 3 4 a b c d +${LIB NAME} Collections +${RES_PATH} ../resources +${ARG} value +${myvar} 123 # This is a comment + +*** Komentarze *** +This is a comments block +Second line of comments *** Przypadki Testowe *** -First Test +My Test + [Dokumentacja] This is _test_ *case* documentation + [Znaczniki] test 1 + [Inicjalizacja] My Overriding Test Setup + Log Nothing to see + [Ukończenie] My Overriding Test Teardown + +first test + [Dokumentacja] 3-This is the documentation\n4-A continued line of documentation + [Znaczniki] first second + [Inicjalizacja] Log To Console Test Setup + [Limit Czasowy] 60 + First Keyword nonsense + ${first}= Check Logic 'Tak' + ${second}= Check Logic 'Wyłączone' + Log Variables + Log Test executed with success, first=${first}, second=${second} + [Ukończenie] Log To Console Test Teardown + +second test + [Znaczniki] first second # This is a comment + [Inicjalizacja] Log To Console Test Setup # This is a comment + [Szablon] First Keyword # This is a comment + [Limit Czasowy] 60 # This is a comment No Operation - First Keyword - Log To Console Test execution with success + Log this is ddt + Log To Console Test executed with success + [Ukończenie] Log To Console Test Teardown # This is a comment + +third test + Zakładając "Mr. Smith" is registered + Oraz "cart" has objects + Jeżeli "Mr. Smith" clicks in checkout + Wtedy the total is presented and awaits confirmation + Ale it is shown the unavailable payment method *** Słowa Kluczowe *** +My Suite Teardown + [Argumenty] ${scalar arg} ${default arg}=default @{list arg} + [Dokumentacja] This is *user* _keyword_ documentation + Log ${scalar arg} + Log Many @{list arg} + [Return] Success + +Duplicate UK + No Operation + +My Test Setup + [Limit Czasowy] + No Operation + First Keyword - [Argumenty] ${arg}=None # This is a comment - Log To Console This is First Keyword + [Argumenty] ${arg}=None @{no_list} # This is a comment + [Dokumentacja] 5-This is the documentation\n\n7-A continued line of documentation + [Znaczniki] first second # This is a comment + Log To Console This is the first keyword + +${user} is registered + No Operation + +${cart} has objects + No Operation + +${user} clicks in checkout + No Operation + +the total is presented and awaits confirmation + No Operation + +it is shown the unavailable payment method No Operation - Log To Console One more line diff --git a/utest/resources/robotdata/language/lang_pt.robot b/utest/resources/robotdata/language/lang_pt.robot index 30ebf0fb0..c8783bf05 100644 --- a/utest/resources/robotdata/language/lang_pt.robot +++ b/utest/resources/robotdata/language/lang_pt.robot @@ -1,21 +1,121 @@ -# Este é o preâmbulo +# This is the preamble Language: Portuguese -# Mais uma linha em branco +# A blank line -*** Comentários *** -This is a comments block -Second line of comments a -Maybe this block is still in preamble -One more line +*** Definições *** +Documentação This test data file is used in *RobotIDE* _integration_ tests.\n1-This is another line of the documentation\n2-A continued line of documentation +Inicialização de Suíte Run Keywords Log To Console Suite Setup +... AND Log Test +... AND Log to Console Test +... AND My Suite Setup +Finalização de Suíte My Suite Teardown ${scalar} @{LIST} +Inicialização de Teste My Test Setup +Finalização de Teste My Overriding Test Teardown +Etiquetas de Testes new_tag ride regeression # Comment on Tags +Metadados My Meta data +Biblioteca seleniumlibrary # Purposefully wrong case | | +Biblioteca Process # This is a comment +Recurso en/full_en.resource +Biblioteca LibSpecLibrary +Biblioteca ${LIB NAME} +Biblioteca ArgLib ${ARG} +Recurso ../resources/resource.resource +Recurso ../resources/resource2.robot +Recurso PathResource.robot +Recurso ../resources/resource.robot +Recurso ${RES_PATH}/another_resource.robot +Recurso ${RES_PATH}/more_resources/${RES NAME} +Recurso ${RES_PATH}/more_resources${/}${EMPTY}even_more_resources.robot +Variável ../resources/varz.py +Variável ../resources/dynamic_varz.py ${ARG} +Variável en/full_en.yaml # This is a comment +Variável en/full_en.json # This is a comment +Variável en/full_en.py # This is a comment +Variável ${RES_PATH}/more_varz.py +Biblioteca ${technology lib} # defined in varz.py | | +Biblioteca ${operating system} # defined in another_resource.robot | | + +*** Variáveis *** +${SCALAR} value +@{LIST} 1 2 3 4 a b c d +${LIB NAME} Collections +${RES_PATH} ../resources +${ARG} value +${myvar} 123 # This is a comment +*** Comentários *** +This is a comments block +Second line of comments *** Casos de Teste *** -teste primeiro +My Test + [Documentação] This is _test_ *case* documentation + [Etiquetas] test 1 + [Inicialização] My Overriding Test Setup + Log Nothing to see + [Finalização] My Overriding Test Teardown + +first test + [Documentação] 3-This is the documentation\n4-A continued line of documentation + [Etiquetas] first second + [Inicialização] Log To Console Test Setup + [Tempo Limite] 60 + First Keyword nonsense + ${first}= Check Logic 'Verdade' + ${second}= Check Logic 'Desligado' + Log Variables + Log Test executed with success, first=${first}, second=${second} + [Finalização] Log To Console Test Teardown + +second test + [Etiquetas] first second # This is a comment + [Inicialização] Log To Console Test Setup # This is a comment + [Modelo] First Keyword # This is a comment + [Tempo Limite] 60 # This is a comment No Operation - Primeira palavra-chave - Log To Console Teste executado com sucesso + Log this is ddt + Log To Console Test executed with success + [Finalização] Log To Console Test Teardown # This is a comment + +third test + Dado "Mr. Smith" is registered + E "cart" has objects + Quando "Mr. Smith" clicks in checkout + Então the total is presented and awaits confirmation + Mas it is shown the unavailable payment method *** Palavras-Chave *** -Primeira palavra-chave - [Argumentos] ${arg}=None # This is a comment - Log To Console Esta é a primeira palavra-chave +My Suite Teardown + [Argumentos] ${scalar arg} ${default arg}=default @{list arg} + [Documentação] This is *user* _keyword_ documentation + Log ${scalar arg} + Log Many @{list arg} + [Return] Success + +Duplicate UK + No Operation + +My Test Setup + [Tempo Limite] + No Operation + +First Keyword + [Argumentos] ${arg}=None @{no_list} # This is a comment + [Documentação] 5-This is the documentation\n\n7-A continued line of documentation + [Etiquetas] first second # This is a comment + Log To Console This is the first keyword + +${user} is registered + No Operation + +${cart} has objects + No Operation + +${user} clicks in checkout + No Operation + +the total is presented and awaits confirmation + No Operation + +it is shown the unavailable payment method + No Operation diff --git a/utest/resources/robotdata/language/lang_pt_br.robot b/utest/resources/robotdata/language/lang_pt_br.robot index 735f97ce7..7d09298d5 100644 --- a/utest/resources/robotdata/language/lang_pt_br.robot +++ b/utest/resources/robotdata/language/lang_pt_br.robot @@ -1,17 +1,121 @@ -# Este é o preâmbulo +# This is the preamble Language: Brazilian Portuguese -# Mais uma linha em branco +# A blank line *** Configurações *** -Library Process +Documentação This test data file is used in *RobotIDE* _integration_ tests.\n1-This is another line of the documentation\n2-A continued line of documentation +Configuração da Suíte Run Keywords Log To Console Suite Setup +... AND Log Test +... AND Log to Console Test +... AND My Suite Setup +Finalização de Suíte My Suite Teardown ${scalar} @{LIST} +Inicialização de Teste My Test Setup +Finalização de Teste My Overriding Test Teardown +Test Tags new_tag ride regeression # Comment on Tags +Metadados My Meta data +Biblioteca seleniumlibrary # Purposefully wrong case | | +Biblioteca Process # This is a comment +Recurso en/full_en.resource +Biblioteca LibSpecLibrary +Biblioteca ${LIB NAME} +Biblioteca ArgLib ${ARG} +Recurso ../resources/resource.resource +Recurso ../resources/resource2.robot +Recurso PathResource.robot +Recurso ../resources/resource.robot +Recurso ${RES_PATH}/another_resource.robot +Recurso ${RES_PATH}/more_resources/${RES NAME} +Recurso ${RES_PATH}/more_resources${/}${EMPTY}even_more_resources.robot +Variável ../resources/varz.py +Variável ../resources/dynamic_varz.py ${ARG} +Variável en/full_en.yaml # This is a comment +Variável en/full_en.json # This is a comment +Variável en/full_en.py # This is a comment +Variável ${RES_PATH}/more_varz.py +Biblioteca ${technology lib} # defined in varz.py | | +Biblioteca ${operating system} # defined in another_resource.robot | | +*** Variáveis *** +${SCALAR} value +@{LIST} 1 2 3 4 a b c d +${LIB NAME} Collections +${RES_PATH} ../resources +${ARG} value +${myvar} 123 # This is a comment + +*** Comentários *** +This is a comments block +Second line of comments *** Casos de Teste *** -teste primeiro +My Test + [Documentação] This is _test_ *case* documentation + [Etiquetas] test 1 + [Inicialização] My Overriding Test Setup + Log Nothing to see + [Finalização] My Overriding Test Teardown + +first test + [Documentação] 3-This is the documentation\n4-A continued line of documentation + [Etiquetas] first second + [Inicialização] Log To Console Test Setup + [Tempo Limite] 60 + First Keyword nonsense + ${first}= Check Logic 'Verdade' + ${second}= Check Logic 'Desligado' + Log Variables + Log Test executed with success, first=${first}, second=${second} + [Finalização] Log To Console Test Teardown + +second test + [Etiquetas] first second # This is a comment + [Inicialização] Log To Console Test Setup # This is a comment + [Modelo] First Keyword # This is a comment + [Tempo Limite] 60 # This is a comment No Operation - Primeira palavra-chave - Log To Console Teste executado com sucesso + Log this is ddt + Log To Console Test executed with success + [Finalização] Log To Console Test Teardown # This is a comment + +third test + Dado "Mr. Smith" is registered + E "cart" has objects + Quando "Mr. Smith" clicks in checkout + Então the total is presented and awaits confirmation + Mas it is shown the unavailable payment method *** Palavras-Chave *** -Primeira palavra-chave - Log To Console Esta é a primeira palavra-chave +My Suite Teardown + [Argumentos] ${scalar arg} ${default arg}=default @{list arg} + [Documentação] This is *user* _keyword_ documentation + Log ${scalar arg} + Log Many @{list arg} + [Return] Success + +Duplicate UK + No Operation + +My Test Setup + [Tempo Limite] + No Operation + +First Keyword + [Argumentos] ${arg}=None @{no_list} # This is a comment + [Documentação] 5-This is the documentation\n\n7-A continued line of documentation + [Etiquetas] first second # This is a comment + Log To Console This is the first keyword + +${user} is registered + No Operation + +${cart} has objects + No Operation + +${user} clicks in checkout + No Operation + +the total is presented and awaits confirmation + No Operation + +it is shown the unavailable payment method + No Operation diff --git a/utest/resources/robotdata/language/lang_ro.robot b/utest/resources/robotdata/language/lang_ro.robot index 016ef46e5..2ff42ab4c 100644 --- a/utest/resources/robotdata/language/lang_ro.robot +++ b/utest/resources/robotdata/language/lang_ro.robot @@ -3,12 +3,119 @@ Language: Romanian # A blank line +*** Setari *** +Documentatie This test data file is used in *RobotIDE* _integration_ tests.\n1-This is another line of the documentation\n2-A continued line of documentation +Configurare De Suita Run Keywords Log To Console Suite Setup +... AND Log Test +... AND Log to Console Test +... AND My Suite Setup +Configurare De Intrerupere My Suite Teardown ${scalar} @{LIST} +Setare De Test My Test Setup +Inrerupere De Test My Overriding Test Teardown +Taguri De Test new_tag ride regeression # Comment on Tags +Metadate My Meta data +Librarie seleniumlibrary # Purposefully wrong case | | +Librarie Process # This is a comment +Resursa en/full_en.resource +Librarie LibSpecLibrary +Librarie ${LIB NAME} +Librarie ArgLib ${ARG} +Resursa ../resources/resource.resource +Resursa ../resources/resource2.robot +Resursa PathResource.robot +Resursa ../resources/resource.robot +Resursa ${RES_PATH}/another_resource.robot +Resursa ${RES_PATH}/more_resources/${RES NAME} +Resursa ${RES_PATH}/more_resources${/}${EMPTY}even_more_resources.robot +Variabila ../resources/varz.py +Variabila ../resources/dynamic_varz.py ${ARG} +Variabila en/full_en.yaml # This is a comment +Variabila en/full_en.json # This is a comment +Variabila en/full_en.py # This is a comment +Variabila ${RES_PATH}/more_varz.py +Librarie ${technology lib} # defined in varz.py | | +Librarie ${operating system} # defined in another_resource.robot | | + +*** Variabile *** +${SCALAR} value +@{LIST} 1 2 3 4 a b c d +${LIB NAME} Collections +${RES_PATH} ../resources +${ARG} value +${myvar} 123 # This is a comment + +*** Comentarii *** +This is a comments block +Second line of comments *** Cazuri De Test *** -First Test - No Operation - First Keyword - Log To Console Test execution with success +My Test + [Documentatie] This is _test_ *case* documentation + [Etichete] test 1 + [Setare] My Overriding Test Setup + Log Nothing to see + [Intrerupere] My Overriding Test Teardown + +first test + [Documentatie] 3-This is the documentation\n4-A continued line of documentation + [Etichete] first second + [Setare] Log To Console Test Setup + [Expirare] 60 + First Keyword nonsense + ${first}= Check Logic 'Da' + ${second}= Check Logic 'Oprit' + Log Variables + Log Test executed with success, first=${first}, second=${second} + [Intrerupere] Log To Console Test Teardown + +second test + [Etichete] first second # This is a comment + [Setare] Log To Console Test Setup # This is a comment + [Sablon] First Keyword # This is a comment + [Expirare] 60 # This is a comment + No OperationNo Operation + Log this is ddt + Log To Console Test executed with success + [Intrerupere] Log To Console Test Teardown # This is a comment + +third test + Fie ca "Mr. Smith" is registered + Si "cart" has objects + Cand "Mr. Smith" clicks in checkout + Atunci the total is presented and awaits confirmation + Dar it is shown the unavailable payment method *** Cuvinte Cheie *** +My Suite Teardown + [Argumente] ${scalar arg} ${default arg}=default @{list arg} + [Documentatie] This is *user* _keyword_ documentation + Log ${scalar arg} + Log Many @{list arg} + [Return] Success + +Duplicate UK + No Operation + +My Test Setup + [Expirare] + No Operation + First Keyword - Log To Console This is First Keyword + [Argumente] ${arg}=None @{no_list} # This is a comment + [Documentatie] 5-This is the documentation\n\n7-A continued line of documentation + [Etichete] first second # This is a comment + Log To Console This is the first keyword + +${user} is registered + No Operation + +${cart} has objects + No Operation + +${user} clicks in checkout + No Operation + +the total is presented and awaits confirmation + No Operation + +it is shown the unavailable payment method + No Operation diff --git a/utest/resources/robotdata/language/lang_ru.robot b/utest/resources/robotdata/language/lang_ru.robot index ee37843a7..60dc2d3fb 100644 --- a/utest/resources/robotdata/language/lang_ru.robot +++ b/utest/resources/robotdata/language/lang_ru.robot @@ -3,15 +3,124 @@ Language: Russian # A blank line +*** Настройки *** +Документация This test data file is used in *RobotIDE* _integration_ tests. +... 1-This is another line of the documentation +... 2-A continued line of documentation +Suite Setup Run Keywords Log To Console Suite Setup +... AND Log Test +... AND Log to Console Test +... AND My Suite Setup +Suite Teardown My Suite Teardown ${scalar} @{LIST} +Test Setup My Test Setup +Test Teardown My Overriding Test Teardown +Теги тестов new_tag ride regeression # Comment on Tags +Метаданные My Meta data +Library seleniumlibrary # Purposefully wrong case | | +Library Process # This is a comment +Resource en/full_en.resource +Library LibSpecLibrary +Library ${LIB NAME} +Library ArgLib ${ARG} +Resource ../resources/resource.resource +Resource ../resources/resource2.robot +Resource PathResource.robot +Resource ../resources/resource.robot +Resource ${RES_PATH}/another_resource.robot +Resource ${RES_PATH}/more_resources/${RES NAME} +Resource ${RES_PATH}/more_resources${/}${EMPTY}even_more_resources.robot +Variables ../resources/varz.py +Variables ../resources/dynamic_varz.py ${ARG} +Variables en/full_en.yaml # This is a comment +Variables en/full_en.json # This is a comment +Variables en/full_en.py # This is a comment +Variables ${RES_PATH}/more_varz.py +Library ${technology lib} # defined in varz.py | | +Library ${operating system} # defined in another_resource.robot | | + +*** Переменные *** +${SCALAR} value +@{LIST} 1 2 3 4 a b c d +${LIB NAME} Collections +${RES_PATH} ../resources +${ARG} value +${myvar} 123 # This is a comment + +*** Комментарии *** +This is a comments block +Second line of comments *** Заголовки тестов *** -First Test +My Test + [Документация] This is _test_ *case* documentation + [Tags] test 1 + [Инициализация] My Overriding Test Setup + Log Nothing to see + [Завершение] My Overriding Test Teardown + +first test + [Документация] 3-This is the documentation + ... 4-A continued line of documentation + [Tags] first second + [Инициализация] Log To Console Test Setup + [Лимит] 60 + First Keyword nonsense + ${first}= Check Logic 'Yes' + ${second}= Check Logic 'Off' + Log Variables + Log Test executed with success, first=${first}, second=${second} + [Завершение] Log To Console Test Teardown + +second test + [Tags] first second # This is a comment + [Инициализация] Log To Console Test Setup # This is a comment + [Template] First Keyword # This is a comment + [Лимит] 60 # This is a comment No Operation - First Keyword - Log To Console Test execution with success + Log this is ddt + Log To Console Test executed with success + [Завершение] Log To Console Test Teardown # This is a comment -# comment here +third test + Дано "Mr. Smith" is registered + И "cart" has objects + Когда "Mr. Smith" clicks in checkout + Тогда the total is presented and awaits confirmation + Но it is shown the unavailable payment method *** Ключевые слова *** +My Suite Teardown + [Аргументы] ${scalar arg} ${default arg}=default @{list arg} + [Документация] This is *user* _keyword_ documentation + Log ${scalar arg} + Log Many @{list arg} + [Return] Success + +Duplicate UK + No Operation + +My Test Setup + [Лимит] + No Operation + First Keyword - Log To Console This is First Keyword - Log To Console Another line + [Аргументы] ${arg}=None @{no_list} # This is a comment + [Документация] 5-This is the documentation + ... + ... 7-A continued line of documentation + [Tags] first second # This is a comment + Log To Console This is the first keyword + +${user} is registered + No Operation + +${cart} has objects + No Operation + +${user} clicks in checkout + No Operation + +the total is presented and awaits confirmation + No Operation + +it is shown the unavailable payment method + No Operation diff --git a/utest/resources/robotdata/language/lang_sv.robot b/utest/resources/robotdata/language/lang_sv.robot index 9fed771b6..4dfdc340d 100644 --- a/utest/resources/robotdata/language/lang_sv.robot +++ b/utest/resources/robotdata/language/lang_sv.robot @@ -3,12 +3,119 @@ Language: Swedish # A blank line +*** Inställningar *** +Dokumentation This test data file is used in *RobotIDE* _integration_ tests.\n1-This is another line of the documentation\n2-A continued line of documentation +Svit konfigurering Run Keywords Log To Console Suite Setup +... AND Log Test +... AND Log to Console Test +... AND My Suite Setup +Svit nedrivning My Suite Teardown ${scalar} @{LIST} +Test konfigurering My Test Setup +Test nedrivning My Overriding Test Teardown +Test taggar new_tag ride regeression # Comment on Tags +Metadata My Meta data +Bibliotek seleniumlibrary # Purposefully wrong case | | +Bibliotek Process # This is a comment +Resurs en/full_en.resource +Bibliotek LibSpecLibrary +Bibliotek ${LIB NAME} +Bibliotek ArgLib ${ARG} +Resurs ../resources/resource.resource +Resurs ../resources/resource2.robot +Resurs PathResource.robot +Resurs ../resources/resource.robot +Resurs ${RES_PATH}/another_resource.robot +Resurs ${RES_PATH}/more_resources/${RES NAME} +Resurs ${RES_PATH}/more_resources${/}${EMPTY}even_more_resources.robot +Variabel ../resources/varz.py +Variabel ../resources/dynamic_varz.py ${ARG} +Variabel en/full_en.yaml # This is a comment +Variabel en/full_en.json # This is a comment +Variabel en/full_en.py # This is a comment +Variabel ${RES_PATH}/more_varz.py +Bibliotek ${technology lib} # defined in varz.py | | +Bibliotek ${operating system} # defined in another_resource.robot | | + +*** Variabler *** +${SCALAR} value +@{LIST} 1 2 3 4 a b c d +${LIB NAME} Collections +${RES_PATH} ../resources +${ARG} value +${myvar} 123 # This is a comment + +*** Kommentarer *** +This is a comments block +Second line of comments *** Testfall *** -First Test +My Test + [Dokumentation] This is _test_ *case* documentation + [Taggar] test 1 + [Konfigurering] My Overriding Test Setup + Log Nothing to see + [Nedrivning] My Overriding Test Teardown + +first test + [Dokumentation] 3-This is the documentation\n4-A continued line of documentation + [Taggar] first second + [Konfigurering] Log To Console Test Setup + [Timeout] 60 + First Keyword nonsense + ${first}= Check Logic 'Ja' + ${second}= Check Logic 'Av' + Log Variables + Log Test executed with success, first=${first}, second=${second} + [Nedrivning] Log To Console Test Teardown + +second test + [Taggar] first second # This is a comment + [Konfigurering] Log To Console Test Setup # This is a comment + [Mall] First Keyword # This is a comment + [Timeout] 60 # This is a comment No Operation - First Keyword - Log To Console Test execution with success + Log this is ddt + Log To Console Test executed with success + [Nedrivning] Log To Console Test Teardown # This is a comment + +third test + Givet "Mr. Smith" is registered + Och "cart" has objects + När "Mr. Smith" clicks in checkout + Då the total is presented and awaits confirmation + Men it is shown the unavailable payment method *** Nyckelord *** +My Suite Teardown + [Argument] ${scalar arg} ${default arg}=default @{list arg} + [Dokumentation] This is *user* _keyword_ documentation + Log ${scalar arg} + Log Many @{list arg} + [Return] Success + +Duplicate UK + No Operation + +My Test Setup + [Timeout] + No Operation + First Keyword - Log To Console This is First Keyword + [Argument] ${arg}=None @{no_list} # This is a comment + [Dokumentation] 5-This is the documentation\n\n7-A continued line of documentation + [Taggar] first second # This is a comment + Log To Console This is the first keyword + +${user} is registered + No Operation + +${cart} has objects + No Operation + +${user} clicks in checkout + No Operation + +the total is presented and awaits confirmation + No Operation + +it is shown the unavailable payment method + No Operation diff --git a/utest/resources/robotdata/language/lang_th.robot b/utest/resources/robotdata/language/lang_th.robot index e0b6e7a7e..3f9b26909 100644 --- a/utest/resources/robotdata/language/lang_th.robot +++ b/utest/resources/robotdata/language/lang_th.robot @@ -3,12 +3,124 @@ Language: Thai # A blank line +*** การตั้งค่า *** +เอกสาร This test data file is used in *RobotIDE* _integration_ tests. +... 1-This is another line of the documentation +... 2-A continued line of documentation +Suite Setup Run Keywords Log To Console Suite Setup +... AND Log Test +... AND Log to Console Test +... AND My Suite Setup +Suite Teardown My Suite Teardown ${scalar} @{LIST} +Test Setup My Test Setup +Test Teardown My Overriding Test Teardown +กลุ่มของการทดสอบ new_tag ride regeression # Comment on Tags +รายละเอียดเพิ่มเติม My Meta data +Library seleniumlibrary # Purposefully wrong case | | +Library Process # This is a comment +Resource en/full_en.resource +Library LibSpecLibrary +Library ${LIB NAME} +Library ArgLib ${ARG} +Resource ../resources/resource.resource +Resource ../resources/resource2.robot +Resource PathResource.robot +Resource ../resources/resource.robot +Resource ${RES_PATH}/another_resource.robot +Resource ${RES_PATH}/more_resources/${RES NAME} +Resource ${RES_PATH}/more_resources${/}${EMPTY}even_more_resources.robot +Variables ../resources/varz.py +Variables ../resources/dynamic_varz.py ${ARG} +Variables en/full_en.yaml # This is a comment +Variables en/full_en.json # This is a comment +Variables en/full_en.py # This is a comment +Variables ${RES_PATH}/more_varz.py +Library ${technology lib} # defined in varz.py | | +Library ${operating system} # defined in another_resource.robot | | + +*** กำหนดตัวแปร *** +${SCALAR} value +@{LIST} 1 2 3 4 a b c d +${LIB NAME} Collections +${RES_PATH} ../resources +${ARG} value +${myvar} 123 # This is a comment + +*** คำอธิบาย *** +This is a comments block +Second line of comments *** การทดสอบ *** -First Test +My Test + [เอกสาร] This is _test_ *case* documentation + [Tags] test 1 + [กำหนดค่าเริ่มต้น] My Overriding Test Setup + Log Nothing to see + [คืนค่า] My Overriding Test Teardown + +first test + [เอกสาร] 3-This is the documentation + ... 4-A continued line of documentation + [Tags] first second + [กำหนดค่าเริ่มต้น] Log To Console Test Setup + [หมดเวลา] 60 + First Keyword nonsense + ${first}= Check Logic 'Yes' + ${second}= Check Logic 'Off' + Log Variables + Log Test executed with success, first=${first}, second=${second} + [คืนค่า] Log To Console Test Teardown + +second test + [Tags] first second # This is a comment + [กำหนดค่าเริ่มต้น] Log To Console Test Setup # This is a comment + [Template] First Keyword # This is a comment + [หมดเวลา] 60 # This is a comment No Operation - First Keyword - Log To Console Test execution with success + Log this is ddt + Log To Console Test executed with success + [คืนค่า] Log To Console Test Teardown # This is a comment + +third test + กำหนดให้ "Mr. Smith" is registered + และ "cart" has objects + เมื่อ "Mr. Smith" clicks in checkout + ดังนั้น the total is presented and awaits confirmation + แต่ it is shown the unavailable payment method *** คำสั่งเพิ่มเติม *** +My Suite Teardown + [ค่าที่ส่งเข้ามา] ${scalar arg} ${default arg}=default @{list arg} + [เอกสาร] This is *user* _keyword_ documentation + Log ${scalar arg} + Log Many @{list arg} + [Return] Success + +Duplicate UK + No Operation + +My Test Setup + [หมดเวลา] + No Operation + First Keyword - Log To Console This is First Keyword + [ค่าที่ส่งเข้ามา] ${arg}=None @{no_list} # This is a comment + [เอกสาร] 5-This is the documentation + ... + ... 7-A continued line of documentation + [Tags] first second # This is a comment + Log To Console This is the first keyword + +${user} is registered + No Operation + +${cart} has objects + No Operation + +${user} clicks in checkout + No Operation + +the total is presented and awaits confirmation + No Operation + +it is shown the unavailable payment method + No Operation diff --git a/utest/resources/robotdata/language/lang_tr.robot b/utest/resources/robotdata/language/lang_tr.robot index 2da56dc3b..3b551da65 100644 --- a/utest/resources/robotdata/language/lang_tr.robot +++ b/utest/resources/robotdata/language/lang_tr.robot @@ -3,12 +3,119 @@ Language: Turkish # A blank line +*** Ayarlar *** +Dokümantasyon This test data file is used in *RobotIDE* _integration_ tests.\n1-This is another line of the documentation\n2-A continued line of documentation +Takım Kurulumu Run Keywords Log To Console Suite Setup +... AND Log Test +... AND Log to Console Test +... AND My Suite Setup +Takım Bitişi My Suite Teardown ${scalar} @{LIST} +Test Kurulumu My Test Setup +Test Bitişi My Overriding Test Teardown +Test Etiketleri new_tag ride regeression # Comment on Tags +Üstveri My Meta data +Kütüphane seleniumlibrary # Purposefully wrong case | | +Kütüphane Process # This is a comment +Kaynak en/full_en.resource +Kütüphane LibSpecLibrary +Kütüphane ${LIB NAME} +Kütüphane ArgLib ${ARG} +Kaynak ../resources/resource.resource +Kaynak ../resources/resource2.robot +Kaynak PathResource.robot +Kaynak ../resources/resource.robot +Kaynak ${RES_PATH}/another_resource.robot +Kaynak ${RES_PATH}/more_resources/${RES NAME} +Kaynak ${RES_PATH}/more_resources${/}${EMPTY}even_more_resources.robot +Değişkenler ../resources/varz.py +Değişkenler ../resources/dynamic_varz.py ${ARG} +Değişkenler en/full_en.yaml # This is a comment +Değişkenler en/full_en.json # This is a comment +Değişkenler en/full_en.py # This is a comment +Değişkenler ${RES_PATH}/more_varz.py +Kütüphane ${technology lib} # defined in varz.py | | +Kütüphane ${operating system} # defined in another_resource.robot | | + +*** Değişkenler *** +${SCALAR} value +@{LIST} 1 2 3 4 a b c d +${LIB NAME} Collections +${RES_PATH} ../resources +${ARG} value +${myvar} 123 # This is a comment + +*** Yorumlar *** +This is a comments block +Second line of comments *** Test Durumları *** -First Test +My Test + [Dokümantasyon] This is _test_ *case* documentation + [Etiketler] test 1 + [Kurulum] My Overriding Test Setup + Log Nothing to see + [Bitiş] My Overriding Test Teardown + +first test + [Dokümantasyon] 3-This is the documentation\n4-A continued line of documentation + [Etiketler] first second + [Kurulum] Log To Console Test Setup + [Zaman Aşımı] 60 + First Keyword nonsense + ${first}= Check Logic 'Evet' + ${second}= Check Logic 'Kapali' + Log Variables + Log Test executed with success, first=${first}, second=${second} + [Bitiş] Log To Console Test Teardown + +second test + [Etiketler] first second # This is a comment + [Kurulum] Log To Console Test Setup # This is a comment + [Taslak] First Keyword # This is a comment + [Zaman Aşımı] 60 # This is a comment No Operation - First Keyword - Log To Console Test execution with success + Log this is ddt + Log To Console Test executed with success + [Bitiş] Log To Console Test Teardown # This is a comment + +third test + Diyelim ki "Mr. Smith" is registered + Ve "cart" has objects + Eğer ki "Mr. Smith" clicks in checkout + O zaman the total is presented and awaits confirmation + Ancak it is shown the unavailable payment method *** Anahtar Kelimeler *** +My Suite Teardown + [Argümanlar] ${scalar arg} ${default arg}=default @{list arg} + [Dokümantasyon] This is *user* _keyword_ documentation + Log ${scalar arg} + Log Many @{list arg} + [Return] Success + +Duplicate UK + No Operation + +My Test Setup + [Zaman Aşımı] + No Operation + First Keyword - Log To Console This is First Keyword + [Argümanlar] ${arg}=None @{no_list} # This is a comment + [Dokümantasyon] 5-This is the documentation\n\n7-A continued line of documentation + [Etiketler] first second # This is a comment + Log To Console This is the first keyword + +${user} is registered + No Operation + +${cart} has objects + No Operation + +${user} clicks in checkout + No Operation + +the total is presented and awaits confirmation + No Operation + +it is shown the unavailable payment method + No Operation diff --git a/utest/resources/robotdata/language/lang_uk.robot b/utest/resources/robotdata/language/lang_uk.robot index 23e2a1101..fbfbb1c14 100644 --- a/utest/resources/robotdata/language/lang_uk.robot +++ b/utest/resources/robotdata/language/lang_uk.robot @@ -3,12 +3,124 @@ Language: Ukrainian # A blank line +*** Налаштування *** +Документація This test data file is used in *RobotIDE* _integration_ tests. +... 1-This is another line of the documentation +... 2-A continued line of documentation +Suite Setup Run Keywords Log To Console Suite Setup +... AND Log Test +... AND Log to Console Test +... AND My Suite Setup +Suite Teardown My Suite Teardown ${scalar} @{LIST} +Test Setup My Test Setup +Test Teardown My Overriding Test Teardown +Тестові теги new_tag ride regeression # Comment on Tags +Метадані My Meta data +Library seleniumlibrary # Purposefully wrong case | | +Library Process # This is a comment +Resource en/full_en.resource +Library LibSpecLibrary +Library ${LIB NAME} +Library ArgLib ${ARG} +Resource ../resources/resource.resource +Resource ../resources/resource2.robot +Resource PathResource.robot +Resource ../resources/resource.robot +Resource ${RES_PATH}/another_resource.robot +Resource ${RES_PATH}/more_resources/${RES NAME} +Resource ${RES_PATH}/more_resources${/}${EMPTY}even_more_resources.robot +Variables ../resources/varz.py +Variables ../resources/dynamic_varz.py ${ARG} +Variables en/full_en.yaml # This is a comment +Variables en/full_en.json # This is a comment +Variables en/full_en.py # This is a comment +Variables ${RES_PATH}/more_varz.py +Library ${technology lib} # defined in varz.py | | +Library ${operating system} # defined in another_resource.robot | | + +*** Змінні *** +${SCALAR} value +@{LIST} 1 2 3 4 a b c d +${LIB NAME} Collections +${RES_PATH} ../resources +${ARG} value +${myvar} 123 # This is a comment + +*** Коментарів *** +This is a comments block +Second line of comments *** Тест-кейси *** -First Test +My Test + [Документація] This is _test_ *case* documentation + [Tags] test 1 + [Встановлення] My Overriding Test Setup + Log Nothing to see + [Cпростовувати пункт за пунктом] My Overriding Test Teardown + +first test + [Документація] 3-This is the documentation + ... 4-A continued line of documentation + [Tags] first second + [Встановлення] Log To Console Test Setup + [Час вийшов] 60 + First Keyword nonsense + ${first}= Check Logic 'Yes' + ${second}= Check Logic 'Off' + Log Variables + Log Test executed with success, first=${first}, second=${second} + [Cпростовувати пункт за пунктом] Log To Console Test Teardown + +second test + [Tags] first second # This is a comment + [Встановлення] Log To Console Test Setup # This is a comment + [Template] First Keyword # This is a comment + [Час вийшов] 60 # This is a comment No Operation - First Keyword - Log To Console Test execution with success + Log this is ddt + Log To Console Test executed with success + [Cпростовувати пункт за пунктом] Log To Console Test Teardown # This is a comment + +third test + Дано "Mr. Smith" is registered + Та "cart" has objects + Коли "Mr. Smith" clicks in checkout + Тоді the total is presented and awaits confirmation + Але it is shown the unavailable payment method *** Ключових слова *** +My Suite Teardown + [Аргументи] ${scalar arg} ${default arg}=default @{list arg} + [Документація] This is *user* _keyword_ documentation + Log ${scalar arg} + Log Many @{list arg} + [Return] Success + +Duplicate UK + No Operation + +My Test Setup + [Час вийшов] + No Operation + First Keyword - Log To Console This is First Keyword + [Аргументи] ${arg}=None @{no_list} # This is a comment + [Документація] 5-This is the documentation + ... + ... 7-A continued line of documentation + [Tags] first second # This is a comment + Log To Console This is the first keyword + +${user} is registered + No Operation + +${cart} has objects + No Operation + +${user} clicks in checkout + No Operation + +the total is presented and awaits confirmation + No Operation + +it is shown the unavailable payment method + No Operation diff --git a/utest/resources/robotdata/language/lang_vi.robot b/utest/resources/robotdata/language/lang_vi.robot index 71954c27f..6c7742584 100644 --- a/utest/resources/robotdata/language/lang_vi.robot +++ b/utest/resources/robotdata/language/lang_vi.robot @@ -3,12 +3,119 @@ Language: Vietnamese # A blank line +*** Cài Đặt *** +Tài liệu hướng dẫn This test data file is used in *RobotIDE* _integration_ tests.\n1-This is another line of the documentation\n2-A continued line of documentation +Tiền thiết lập bộ kịch bản kiểm thử Run Keywords Log To Console Suite Setup +... AND Log Test +... AND Log to Console Test +... AND My Suite Setup +Hậu thiết lập bộ kịch bản kiểm thử My Suite Teardown ${scalar} @{LIST} +Tiền thiết lập kịch bản kiểm thử My Test Setup +Hậu thiết lập kịch bản kiểm thử My Overriding Test Teardown +Các nhãn kịch bản kiểm thử new_tag ride regeression # Comment on Tags +Dữ liệu tham chiếu My Meta data +Thư viện seleniumlibrary # Purposefully wrong case | | +Thư viện Process # This is a comment +Tài nguyên en/full_en.resource +Thư viện LibSpecLibrary +Thư viện ${LIB NAME} +Thư viện ArgLib ${ARG} +Tài nguyên ../resources/resource.resource +Tài nguyên ../resources/resource2.robot +Tài nguyên PathResource.robot +Tài nguyên ../resources/resource.robot +Tài nguyên ${RES_PATH}/another_resource.robot +Tài nguyên ${RES_PATH}/more_resources/${RES NAME} +Tài nguyên ${RES_PATH}/more_resources${/}${EMPTY}even_more_resources.robot +Biến số ../resources/varz.py +Biến số ../resources/dynamic_varz.py ${ARG} +Biến số en/full_en.yaml # This is a comment +Biến số en/full_en.json # This is a comment +Biến số en/full_en.py # This is a comment +Biến số ${RES_PATH}/more_varz.py +Thư viện ${technology lib} # defined in varz.py | | +Thư viện ${operating system} # defined in another_resource.robot | | + +*** Các biến số *** +${SCALAR} value +@{LIST} 1 2 3 4 a b c d +${LIB NAME} Collections +${RES_PATH} ../resources +${ARG} value +${myvar} 123 # This is a comment + +*** Các chú thích *** +This is a comments block +Second line of comments *** Các kịch bản kiểm thử *** -First Test +My Test + [Tài liệu hướng dẫn] This is _test_ *case* documentation + [Các thẻ] test 1 + [Tiền thiết lập] My Overriding Test Setup + Log Nothing to see + [Hậu thiết lập] My Overriding Test Teardown + +first test + [Tài liệu hướng dẫn] 3-This is the documentation\n4-A continued line of documentation + [Các thẻ] first second + [Tiền thiết lập] Log To Console Test Setup + [Thời gian chờ] 60 + First Keyword nonsense + ${first}= Check Logic 'Vâng' + ${second}= Check Logic 'Tắt' + Log Variables + Log Test executed with success, first=${first}, second=${second} + [Hậu thiết lập] Log To Console Test Teardown + +second test + [Các thẻ] first second # This is a comment + [Tiền thiết lập] Log To Console Test Setup # This is a comment + [Mẫu] First Keyword # This is a comment + [Thời gian chờ] 60 # This is a comment No Operation - First Keyword - Log To Console Test execution with success + Log this is ddt + Log To Console Test executed with success + [Hậu thiết lập] Log To Console Test Teardown # This is a comment + +third test + Đã cho "Mr. Smith" is registered + Và "cart" has objects + Khi "Mr. Smith" clicks in checkout + Thì the total is presented and awaits confirmation + Nhưng it is shown the unavailable payment method *** Các từ khóa *** +My Suite Teardown + [Các đối số] ${scalar arg} ${default arg}=default @{list arg} + [Tài liệu hướng dẫn] This is *user* _keyword_ documentation + Log ${scalar arg} + Log Many @{list arg} + [Return] Success + +Duplicate UK + No Operation + +My Test Setup + [Thời gian chờ] + No Operation + First Keyword - Log To Console This is First Keyword + [Các đối số] ${arg}=None @{no_list} # This is a comment + [Tài liệu hướng dẫn] 5-This is the documentation\n\n7-A continued line of documentation + [Các thẻ] first second # This is a comment + Log To Console This is the first keyword + +${user} is registered + No Operation + +${cart} has objects + No Operation + +${user} clicks in checkout + No Operation + +the total is presented and awaits confirmation + No Operation + +it is shown the unavailable payment method + No Operation diff --git a/utest/resources/robotdata/language/lang_zh_cn.robot b/utest/resources/robotdata/language/lang_zh_cn.robot index 657dec485..924d8fd2b 100644 --- a/utest/resources/robotdata/language/lang_zh_cn.robot +++ b/utest/resources/robotdata/language/lang_zh_cn.robot @@ -3,12 +3,119 @@ Language: Chinese Simplified # A blank line +*** 设置 *** +说明 This test data file is used in *RobotIDE* _integration_ tests.\n1-This is another line of the documentation\n2-A continued line of documentation +用例集启程 Run Keywords Log To Console Suite Setup +... AND Log Test +... AND Log to Console Test +... AND My Suite Setup +用例集终程 My Suite Teardown ${scalar} @{LIST} +用例启程 My Test Setup +用例终程 My Overriding Test Teardown +用例标签 new_tag ride regeression # Comment on Tags +元数据 My Meta data +程序库 seleniumlibrary # Purposefully wrong case | | +程序库 Process # This is a comment +资源文件 en/full_en.resource +程序库 LibSpecLibrary +程序库 ${LIB NAME} +程序库 ArgLib ${ARG} +资源文件 ../resources/resource.resource +资源文件 ../resources/resource2.robot +资源文件 PathResource.robot +资源文件 ../resources/resource.robot +资源文件 ${RES_PATH}/another_resource.robot +资源文件 ${RES_PATH}/more_resources/${RES NAME} +资源文件 ${RES_PATH}/more_resources${/}${EMPTY}even_more_resources.robot +变量文件 ../resources/varz.py +变量文件 ../resources/dynamic_varz.py ${ARG} +变量文件 en/full_en.yaml # This is a comment +变量文件 en/full_en.json # This is a comment +变量文件 en/full_en.py # This is a comment +变量文件 ${RES_PATH}/more_varz.py +程序库 ${technology lib} # defined in varz.py | | +程序库 ${operating system} # defined in another_resource.robot | | + +*** 变量 *** +${SCALAR} value +@{LIST} 1 2 3 4 a b c d +${LIB NAME} Collections +${RES_PATH} ../resources +${ARG} value +${myvar} 123 # This is a comment + +*** 备注 *** +This is a comments block +Second line of comments *** 用例 *** -First Test +My Test + [说明] This is _test_ *case* documentation + [标签] test 1 + [启程] My Overriding Test Setup + Log Nothing to see + [终程] My Overriding Test Teardown + +first test + [说明] 3-This is the documentation\n4-A continued line of documentation + [标签] first second + [启程] Log To Console Test Setup + [超时] 60 + First Keyword nonsense + ${first}= Check Logic '是' + ${second}= Check Logic '关' + Log Variables + Log Test executed with success, first=${first}, second=${second} + [终程] Log To Console Test Teardown + +second test + [标签] first second # This is a comment + [启程] Log To Console Test Setup # This is a comment + [模板] First Keyword # This is a comment + [超时] 60 # This is a comment No Operation - First Keyword - Log To Console Test execution with success + Log this is ddt + Log To Console Test executed with success + [终程] Log To Console Test Teardown # This is a comment + +third test + 假定 "Mr. Smith" is registered + 并且 "cart" has objects + 当 "Mr. Smith" clicks in checkout + 那么 the total is presented and awaits confirmation + 但是 it is shown the unavailable payment method *** 关键字 *** +My Suite Teardown + [参数] ${scalar arg} ${default arg}=default @{list arg} + [说明] This is *user* _keyword_ documentation + Log ${scalar arg} + Log Many @{list arg} + [Return] Success + +Duplicate UK + No Operation + +My Test Setup + [超时] + No Operation + First Keyword - Log To Console This is First Keyword + [参数] ${arg}=None @{no_list} # This is a comment + [说明] 5-This is the documentation\n\n7-A continued line of documentation + [标签] first second # This is a comment + Log To Console This is the first keyword + +${user} is registered + No Operation + +${cart} has objects + No Operation + +${user} clicks in checkout + No Operation + +the total is presented and awaits confirmation + No Operation + +it is shown the unavailable payment method + No Operation diff --git a/utest/resources/robotdata/language/lang_zh_tw.robot b/utest/resources/robotdata/language/lang_zh_tw.robot index 0d65cd280..8b98631e2 100644 --- a/utest/resources/robotdata/language/lang_zh_tw.robot +++ b/utest/resources/robotdata/language/lang_zh_tw.robot @@ -3,12 +3,119 @@ Language: Chinese Traditional # A blank line +*** 設置 *** +說明 This test data file is used in *RobotIDE* _integration_ tests.\n1-This is another line of the documentation\n2-A continued line of documentation +測試套啟程 Run Keywords Log To Console Suite Setup +... AND Log Test +... AND Log to Console Test +... AND My Suite Setup +測試套終程 My Suite Teardown ${scalar} @{LIST} +測試啟程 My Test Setup +測試終程 My Overriding Test Teardown +測試標籤 new_tag ride regeression # Comment on Tags +元數據 My Meta data +函式庫 seleniumlibrary # Purposefully wrong case | | +函式庫 Process # This is a comment +資源文件 en/full_en.resource +函式庫 LibSpecLibrary +函式庫 ${LIB NAME} +函式庫 ArgLib ${ARG} +資源文件 ../resources/resource.resource +資源文件 ../resources/resource2.robot +資源文件 PathResource.robot +資源文件 ../resources/resource.robot +資源文件 ${RES_PATH}/another_resource.robot +資源文件 ${RES_PATH}/more_resources/${RES NAME} +資源文件 ${RES_PATH}/more_resources${/}${EMPTY}even_more_resources.robot +變量文件 ../resources/varz.py +變量文件 ../resources/dynamic_varz.py ${ARG} +變量文件 en/full_en.yaml # This is a comment +變量文件 en/full_en.json # This is a comment +變量文件 en/full_en.py # This is a comment +變量文件 ${RES_PATH}/more_varz.py +函式庫 ${technology lib} # defined in varz.py | | +函式庫 ${operating system} # defined in another_resource.robot | | + +*** 變量 *** +${SCALAR} value +@{LIST} 1 2 3 4 a b c d +${LIB NAME} Collections +${RES_PATH} ../resources +${ARG} value +${myvar} 123 # This is a comment + +*** 備註 *** +This is a comments block +Second line of comments *** 案例 *** -First Test +My Test + [說明] This is _test_ *case* documentation + [標籤] test 1 + [啟程] My Overriding Test Setup + Log Nothing to see + [終程] My Overriding Test Teardown + +first test + [說明] 3-This is the documentation\n4-A continued line of documentation + [標籤] first second + [啟程] Log To Console Test Setup + [逾時] 60 + First Keyword nonsense + ${first}= Check Logic '是' + ${second}= Check Logic '關' + Log Variables + Log Test executed with success, first=${first}, second=${second} + [終程] Log To Console Test Teardown + +second test + [標籤] first second # This is a comment + [啟程] Log To Console Test Setup # This is a comment + [模板] First Keyword # This is a comment + [逾時] 60 # This is a comment No Operation - First Keyword - Log To Console Test execution with success + Log this is ddt + Log To Console Test executed with success + [終程] Log To Console Test Teardown # This is a comment + +third test + 假定 "Mr. Smith" is registered + 並且 "cart" has objects + 當 "Mr. Smith" clicks in checkout + 那麼 the total is presented and awaits confirmation + 但是 it is shown the unavailable payment method *** 關鍵字 *** +My Suite Teardown + [参数] ${scalar arg} ${default arg}=default @{list arg} + [說明] This is *user* _keyword_ documentation + Log ${scalar arg} + Log Many @{list arg} + [Return] Success + +Duplicate UK + No Operation + +My Test Setup + [逾時] + No Operation + First Keyword - Log To Console This is First Keyword + [参数] ${arg}=None @{no_list} # This is a comment + [說明] 5-This is the documentation\n\n7-A continued line of documentation + [標籤] first second # This is a comment + Log To Console This is the first keyword + +${user} is registered + No Operation + +${cart} has objects + No Operation + +${user} clicks in checkout + No Operation + +the total is presented and awaits confirmation + No Operation + +it is shown the unavailable payment method + No Operation diff --git a/utest/resources/robotdata/resources/resource2.robot b/utest/resources/robotdata/resources/resource2.robot index 4d51165e9..82cc6a6f0 100644 --- a/utest/resources/robotdata/resources/resource2.robot +++ b/utest/resources/robotdata/resources/resource2.robot @@ -1,5 +1,7 @@ +Language: English + *** Settings *** -Library AnotherArgLib ${param1} \ ${param1} here too: ${param2} ${param2} +Library AnotherArgLib ${param1} ${param1} here too: ${param2} ${param2} *** Variables *** @{RESOURCE 2 List VARIABLE} 1 2 3 4 @@ -10,3 +12,16 @@ ${param2} Hello Resource2 UK [Timeout] No Operation + +My Suite Setup + No Operation + +My Suite Teardown + [Arguments] @{args} + No Operation + +My Overriding Test Setup + Log To Console This is My Overriding Test Setup + +My Overriding Test Teardown + Log To Console This is My Overriding Test Teardown From 70549af383ba9a206a7dc06ddfca77274325237c Mon Sep 17 00:00:00 2001 From: HelioGuilherme66 Date: Fri, 30 Aug 2024 19:25:55 +0100 Subject: [PATCH 10/11] Correct continuation on Documentation for function transform_doc_languagein Text Editor --- README.adoc | 2 +- src/robotide/application/releasenotes.py | 2 +- src/robotide/editor/texteditor.py | 11 ++++- src/robotide/lib/robot/parsing/model.py | 7 ++- .../lib/robot/parsing/tablepopulators.py | 23 ++++++++-- src/robotide/lib/robot/writer/formatters.py | 17 +++++--- src/robotide/lib/robot/writer/rowsplitter.py | 12 +++++- src/robotide/version.py | 2 +- utest/editor/test_texteditor.py | 26 +++++++++++ .../robotdata/language/en/full_en.resource | 26 ++++++----- .../robotdata/language/lang_en.robot | 18 ++++---- .../robotdata/language/lang_es.robot | 16 ++++--- .../robotdata/language/lang_pt.robot | 16 ++++--- .../robotdata/language/pt/full_task_pt.robot | 43 ++++++++----------- 14 files changed, 145 insertions(+), 76 deletions(-) diff --git a/README.adoc b/README.adoc index 223a398b7..b97cdc5b7 100644 --- a/README.adoc +++ b/README.adoc @@ -40,7 +40,7 @@ Likewise, the current version of wxPython, is 4.2.1, but RIDE is known to work w `pip install -U robotframework-ride` -(3.8 <= python <= 3.12) Install current development version (**2.1dev70**) with: +(3.8 <= python <= 3.12) Install current development version (**2.1dev71**) with: `pip install -U https://github.com/robotframework/RIDE/archive/master.zip` diff --git a/src/robotide/application/releasenotes.py b/src/robotide/application/releasenotes.py index 5fd5f799e..c72d50bc8 100644 --- a/src/robotide/application/releasenotes.py +++ b/src/robotide/application/releasenotes.py @@ -326,7 +326,7 @@ def set_content(self, html_win, content):
 python -m robotide.postinstall -install
 
-

RIDE {VERSION} was released on 16/August/2024.

+

RIDE {VERSION} was released on 30/August/2024.