Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aaltat committed May 11, 2024
1 parent d56683a commit 3f2430c
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,46 @@ documentation for further details.

Plugin API is new SeleniumLibrary 4.0

= Language =

SeleniumLibrary offers possibility to translte keyword names and documentation to new language. If language
is defined, SeleniumLibrary will search from
[https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#module-search-path | module search path]
Python packages starting with `robotframework_seleniumlibrary_translation` by using
[https://packaging.python.org/en/latest/guides/creating-and-discovering-plugins/ | Python pluging API]. Library
is using naming convention to find Python plugins.

The package must implement single API call, ``get_language`` without any arguments. Method must return a
dictionary containing two keys: ``language`` and ``path``. The language key value defines which language
the package contains. Also value should match (case insentive) the library ``language`` import parameter.
The path parameter value should be full path to the translation file.

== Translation file ==

The file name or extension is not important, but data must be in [https://www.json.org/json-en.html | json]
format. The keys of json are the methods names, not the keyword names, which implements keywords. Value of
key is json object which contains two keys: ``name`` and ``doc``. The ``name`` key contains the keyword
translated name and `doc` contains translated documentation. Providing doc and name are optional, example
translation json file can only provide translations to keyword names or only to documentatin. But it is
always recomended to provide translation to both name and doc. Special key ``__intro__`` is for class level
documentation and ``__init__`` is for init level documentation. These special values ``name`` can not be
translated, instead ``name`` should be kept the same.

== Generating template translation file ==

Template translation file, with English language can be created by running:
`rfselib translation /path/to/translation.json` command. Command does not provide translations to other
languages, it only provides easy way to create full list keywords and their documentation in correct
format. It is also possible to add keywords from library plugins by providing `--plugings` arguments
to command. Example: `rfselib translation --plugings myplugin.SomePlugin /path/to/translation.json` The
genered json file contains `sha256` key, which constains the sha256 sum of the library documentation,
the sha256 sum is used by `rfselib translation --compare /path/to/translation.json` command, which compares
transation to to library and prints outs a table which tell if there are changes needed for translation file.

Example project for translation can be found from
[https://github.com/MarketSquare/robotframework-seleniumlibrary-translation-fi | robotframework-seleniumlibrary-translation-fi]
repository.

= Plugin: my_lib =

Some dummy documentation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ SeleniumLibrary can be imported with several optional arguments.
Default value to wait for page load to complete until a timeout exception is raised.
- ``action_chain_delay``:
Default value for `ActionChains` delay to wait in between actions.
- ``language``:
Defines language which is used to translate keyword names and documentation.

0 comments on commit 3f2430c

Please sign in to comment.