Skip to content

Releases: seleniumbase/SeleniumBase

Add, update, and refactor translations

18 May 20:35
d253b9b
Compare
Choose a tag to compare

Add, update, and refactor translations

  • Improve the SeleniumBase Universal Translator API
  • Refactoring

(Language Support: English, Chinese, Dutch, French, Italian, Japanese, Korean, Portuguese, Russian, and Spanish)

Add translations for:

  • wait_for_text()
  • wait_for_element_visible()
  • wait_for_element_not_visible()
  • wait_for_element_present()
  • wait_for_element_absent()
  • sleep()
  • wait()
  • submit()
  • js_click()
  • inspect_html()
  • save_screenshot()
  • choose_file()
  • execute_script()
  • ad_block()
  • skip()
  • assert_no_js_errors()
  • open_new_window()
  • switch_to_window()
  • switch_to_default_window()
  • highlight()
  • highlight_click()
  • scroll_to()
  • scroll_to_top()
  • scroll_to_bottom()

More documentation available on seleniumbase.io

Add translations to the Universal Translator API

18 May 07:02
Compare
Choose a tag to compare

Add translations to the Universal Translator API

Adding:

  • assert_equal()
  • assert_not_equal()
  • refresh_page()
  • get_current_url()
  • get_page_source()
  • is_text_visible()
  • is_element_visible()
  • is_element_present()

Fix an issue with double-clicking on Windows

18 May 03:55
f032011
Compare
Choose a tag to compare

Fix an issue with double-clicking on Windows

Also refresh some out-of-date Python dependencies:

  • setuptools>=46.4.0
  • soupsieve==1.9.6
  • beautifulsoup4==4.9.1
  • pdfminer.six==20200517

Update the Universal Translator API

15 May 08:12
9d7112e
Compare
Choose a tag to compare

Add the SeleniumBase Universal Translator API

11 May 08:13
0c68192
Compare
Choose a tag to compare

Add the SeleniumBase Universal Translator API

SeleniumBase supports the following 10 languages:

  • English
  • Chinese / 中文
  • Dutch / Nederlands
  • French / Français
  • Italian / Italiano
  • Japanese / 日本語
  • Korean / 한국어
  • Portuguese / Português
  • Russian / Русский
  • Spanish / Español

Examples can be found in [SeleniumBase/examples/translations].

Multi-language tests are run with pytest like any other test. Every test method has a one-to-one mapping to every other supported language.
Examples:

self.开启网址(URL) = self.open(URL)
self.нажмите(CSS) = self.click(CSS)
self.뒤로() = self.go_back()

You can use SeleniumBase to translate any test from one language to another by using the console scripts interface:

seleniumbase translate
* Usage:
seleniumbase translate [SB_FILE].py [LANGUAGE] [ACTION]

* Languages:
``--en`` / ``--English``  |  ``--zh`` / ``--Chinese``
``--nl`` / ``--Dutch``    |  ``--fr`` / ``--French``
``--it`` / ``--Italian``  |  ``--ja`` / ``--Japanese``
``--ko`` / ``--Korean``   |  ``--pt`` / ``--Portuguese``
``--ru`` / ``--Russian``  |  ``--es`` / ``--Spanish``

* Actions:
``-p`` / ``--print``  (Print translation output to the screen)
``-o`` / ``--overwrite``  (Overwrite the file being translated)
``-c`` / ``--copy``  (Copy the translation to a new ``.py`` file)

* Examples:
Translate test_1.py into Chinese and only print the output:
>>> seleniumbase translate test_1.py --zh  -p
Translate test_2.py into Portuguese and overwrite the file:
>>> seleniumbase translate test_2.py --pt  -o
Translate test_3.py into Dutch and make a copy of the file:
>>> seleniumbase translate test_3.py --nl  -c

* Output:
Translates a SeleniumBase Python file into the language
specified. Method calls and ``import`` lines get swapped.
Both a language and an action must be specified.
The ``-p`` action can be paired with one other action.
When running with ``-c`` (or ``--copy``) the new file name
will be the orginal name appended with an underscore
plus the 2-letter language code of the new language.
(Example: Translating ``test_1.py`` into Japanese with
``-c`` will create a new file called ``test_1_ja.py``.)

Also included in this Release are the following updates/changes:

  • Allow multithreaded browser sessions to be reused when specified
  • Update the pytest dependency version to 5.4.2
  • Improve error-handling when using headless mode on Linux
  • Add methods for controlling Local Storage and Session Storage:
self.set_local_storage_item(key, value)
self.get_local_storage_item(key)
self.remove_local_storage_item(key)
self.clear_local_storage()
self.get_local_storage_keys()
self.get_local_storage_items()
self.set_session_storage_item(key, value)
self.get_session_storage_item(key)
self.remove_session_storage_item(key)
self.clear_session_storage()
self.get_session_storage_keys()
self.get_session_storage_items()

Add --crumbs option to delete cookies between tests

03 May 20:27
74a93be
Compare
Choose a tag to compare

Add option to delete all cookies between tests that reuse sessions

  • Usage: (from cmd): --crumbs
    --crumbs is only needed when also using --reuse-session, where the same browser session is reused between tests. When not using --reuse-session, every test spins up a completely clean browser session where no cookies are set.

Update translations and some refactoring

03 May 02:37
90b7bea
Compare
Choose a tag to compare

Update translations and some refactoring

  • Add translations for JS Tour methods
  • Refactoring base_case methods
  • Move "objectify.py" into console scripts
  • Organize setup.py classifiers
  • Update Python dependencies

Improve automation on Safari browsers. And more.

29 Apr 03:56
4ab846e
Compare
Choose a tag to compare

Improve automation on Safari browsers. And more.

  • Improve automation on Safari browsers
  • Improve hover_and_click actions
  • Update the demo page
  • Update example tests
  • Refresh the "pip" dependency

Update the assert_downloaded_file(file) method

28 Apr 03:55
ed68e3e
Compare
Choose a tag to compare

Update the assert_downloaded_file(file) method

  • Now by default waits up to six seconds for the file to appear in the downloads folder.
  • The default timeout can be changed.
  • This change was made to allow time for a download to complete.

Update language translations

27 Apr 05:19
15af189
Compare
Choose a tag to compare

Update language translations

  • Add translations for assert_link_text(LINK_TEXT)
  • Update a few Portuguese translations
  • Update example tests
  • Update __init__.py files to display languages