Skip to content

Releases: seleniumbase/SeleniumBase

Add the Dutch translation and update Russian

20 Apr 23:17
c47cf81
Compare
Choose a tag to compare

Add the Dutch translation and update Russian

  • Example Dutch test:
from seleniumbase.translate.dutch import Testgeval

class MijnTestklasse(Testgeval):

    def test_voorbeeld_1(self):
        self.url_openen("https://nl.wikipedia.org/wiki/Hoofdpagina")
        self.controleren_element('a[title*="hoofdpagina gaan"]')
        self.controleren_tekst("Welkom op Wikipedia", "td.hp-welkom")
        self.tekst_bijwerken("#searchInput", "Stroopwafel")
        self.klik("#searchButton")
        self.controleren_tekst("Stroopwafel", "#firstHeading")
        self.controleren_element('img[alt="Stroopwafels"]')
        self.tekst_bijwerken("#searchInput", "Rijksmuseum Amsterdam")
        self.klik("#searchButton")
        self.controleren_tekst("Rijksmuseum", "#firstHeading")
        self.controleren_element('img[alt="Het Rijksmuseum"]')
        self.terug()
        self.controleren_ware("Stroopwafel" in self.huidige_url_ophalen())
        self.vooruit()
        self.controleren_ware("Rijksmuseum" in self.huidige_url_ophalen())
  • And here's the updated Russian test:
from seleniumbase.translate.russian import ТестНаСелен  # noqa

class МойТестовыйКласс(ТестНаСелен):

    def test_пример_1(self):
        self.открыть("https://ru.wikipedia.org/wiki/")
        self.подтвердить_элемент('[title="Русский язык"]')
        self.подтвердить_текст("Википедия", "h2.main-wikimedia-header")
        self.обновить_текст("#searchInput", "МГУ")
        self.нажмите("#searchButton")
        self.подтвердить_текст("университет", "#firstHeading")
        self.подтвердить_элемент('img[alt="МГУ, вид с воздуха.jpg"]')
        self.обновить_текст("#searchInput", "приключения Шурика")
        self.нажмите("#searchButton")
        self.подтвердить_текст("Операция «Ы» и другие приключения Шурика")
        self.подтвердить_элемент('img[alt="Постер фильма"]')
        self.назад()
        self.подтвердить_правду("университет" in self.получить_текущий_URL())
        self.вперед()
        self.подтвердить_правду("Шурика" in self.получить_текущий_URL())

Add option: "--cap-string=STRING" to set capabilities

19 Apr 18:53
57fae1c
Compare
Choose a tag to compare

Add option to set browser desired capabilities with --cap-string=STRING

  • Example:
pytest basic_test.py --cap-string='{"browserName":"chrome","name":"test1"}' --server="127.0.0.1" --browser=remote

(Enclose cap-string in single quotes. Enclose parameter keys in double quotes.)

If using a local Selenium Grid with SeleniumBase, start up the Grid Hub and nodes first:

seleniumbase grid-hub start
seleniumbase grid-node start

For more information on setting browser desired capabilities, see: https://github.com/seleniumbase/SeleniumBase/blob/master/examples/capabilities/ReadMe.md

Add the SeleniumBase Russian translation

19 Apr 01:02
ffc44bf
Compare
Choose a tag to compare

Add the SeleniumBase Russian translation

  • Here's an example test in Russian: (UPDATED)
from seleniumbase.translate.russian import ТестНаСелен  # noqa

class МойТестовыйКласс(ТестНаСелен):

    def test_пример_1(self):
        self.открыть("https://ru.wikipedia.org/wiki/")
        self.подтвердить_элемент('[title="Русский язык"]')
        self.подтвердить_текст("Википедия", "h2.main-wikimedia-header")
        self.обновить_текст("#searchInput", "МГУ")
        self.нажмите("#searchButton")
        self.подтвердить_текст("университет", "#firstHeading")
        self.подтвердить_элемент('img[alt="МГУ, вид с воздуха.jpg"]')
        self.обновить_текст("#searchInput", "приключения Шурика")
        self.нажмите("#searchButton")
        self.подтвердить_текст("Операция «Ы» и другие приключения Шурика")
        self.подтвердить_элемент('img[alt="Постер фильма"]')
        self.назад()
        self.подтвердить_правду("университет" in self.получить_текущий_URL())
        self.вперед()
        self.подтвердить_правду("Шурика" in self.получить_текущий_URL())

Add Guest Mode and DevTools options for Chromium

18 Apr 05:31
815dad7
Compare
Choose a tag to compare

Add Guest Mode and DevTools options for Chromium tests

Usage:

  • --guest
    (When the Guest Mode option is set, the Chromium browser launches in Guest Mode.)
  • --devtools
    (When the Devtools option is set, Chromium will open the DevTools window on startup.)

Fix MSEdgeDriver automatic installation

15 Apr 04:48
85233b3
Compare
Choose a tag to compare

Fix MSEdgeDriver automatic installation

  • The MSEdgeDriver being using must be on the local SeleniumBase Path rather than on the System Path. This prevents permission issues. If it's not there when a test uses the Edge Browser, it will automatically get downloaded into the SeleniumBase drivers folder.

Here's an example of running a SeleniumBase test using the new Edge browser:

cd examples/
pytest basic_test.py -v --browser=edge
=============================================== test session starts ================================================
platform darwin -- Python 3.7.0, pytest-5.3.5, py-1.8.0, pluggy-0.13.1 -- /Users/michael/.virtualenvs/sbase7/bin/python
metadata: {'Python': '3.7.0', 'Platform': 'Darwin-18.7.0-x86_64-i386-64bit', 'Packages': {'pytest': '5.3.5', 'py': '1.8.0', 'pluggy': '0.13.1'}, 'Plugins': {'timeout': '1.3.4', 'html': '2.0.1', 'rerunfailures': '9.0', 'xdist': '1.31.0', 'ordering': '0.6', 'forked': '1.1.3', 'metadata': '1.8.0', 'cov': '2.8.1', 'seleniumbase': '1.37.2'}}
rootdir: /Users/michael/github/SeleniumBase, inifile: pytest.ini
plugins: timeout-1.3.4, html-2.0.1, rerunfailures-9.0, xdist-1.31.0, ordering-0.6, forked-1.1.3, metadata-1.8.0, cov-2.8.1, seleniumbase-1.37.2
collected 1 item                                                                                                   

basic_test.py::MyTestClass::test_basic 
Warning: msedgedriver not found. Installing now:

Downloading edgedriver_mac64.zip from:
https://msedgedriver.azureedge.net/79.0.309.65/edgedriver_mac64.zip ...
Download Complete!

Extracting ['msedgedriver'] from edgedriver_mac64.zip ...
Unzip Complete!

The file [msedgedriver] was saved to:
/Users/michael/github/SeleniumBase/seleniumbase/drivers/msedgedriver

Making [msedgedriver 79.0.309.65] executable ...
[msedgedriver] is now ready for use!

PASSED

================================================ 1 passed in 11.58s

Brython integration and more

13 Apr 08:19
e3b1a4a
Compare
Choose a tag to compare

Brython integration and more

  • Add the Brython integration (Example with Python replacing JS)
  • Add methods for pressing arrow keys
  • Update the language translations
  • Update the offline demo page with the associated test
  • Improve JS method reliability
  • Add and update User Agent tests
  • Update the example proxy list
  • Update Python dependencies

Add methods and examples for offline testing

09 Apr 06:58
7368173
Compare
Choose a tag to compare

Add methods and examples for offline testing:

  • Add methods for injecting html into a web page
self.load_html_string(html_string, new_page=True)
self.load_html_file(html_file, new_page=True)
self.open_html_file(html_file)
  • Use complete cloudflare links for accessing libraries
  • Add assert_raises() to avoid the camel-casing of assertRaises()
  • Update the beautifulsoup and certifi dependences
  • Improve highlighting in Demo Mode
  • Increase the bring_to_front() z-index setting
  • Make sure jQuery is fully activated before using it
  • Add an offline example with a single-page web app

Update error output, logging, and dependencies

03 Apr 06:07
998655d
Compare
Choose a tag to compare

Update error output, logging, and dependencies

  • Update error output
  • Refactor logging
  • Update Python dependencies

Translate SeleniumBase to Portuguese

30 Mar 07:04
198e81e
Compare
Choose a tag to compare

Translate SeleniumBase to Portuguese

  • Here's the example test:
# Portuguese Language Test - Python 3 Only!
from seleniumbase.translate.portuguese import CasoDeTeste

class MinhaClasseDeTeste(CasoDeTeste):

    def test_exemplo_1(self):
        self.abrir_url("https://pt.wikipedia.org/wiki/")
        self.verificar_texto("Wikipédia")
        self.verificar_elemento('[title="Visitar a página principal"]')
        self.atualizar_texto("#searchInput", "Rio de Janeiro")
        self.clique("#searchButton")
        self.verificar_texto("Rio de Janeiro", "#firstHeading")
        self.verificar_elemento('img[alt*="edifícios"]')
        self.atualizar_texto("#searchInput", "São Paulo")
        self.clique("#searchButton")
        self.verificar_texto("São Paulo", "#firstHeading")
        self.verificar_elemento('img[src*="Monumento"]')
        self.voltar()
        self.verificar_verdade("Janeiro" in self.obter_url_atual())
        self.avançar()  # noqa
        self.verificar_verdade("Paulo" in self.obter_url_atual())

Add methods for checkboxes and radio buttons

29 Mar 20:34
805ea80
Compare
Choose a tag to compare

Add methods for checkboxes and radio buttons

self.is_selected(selector, by=By.CSS_SELECTOR, timeout=None)
# Duplicates: self.is_checked(selector, by=By.CSS_SELECTOR, timeout=None)

self.select_if_unselected(selector, by=By.CSS_SELECTOR)
# Duplicates: self.check_if_unchecked(selector, by=By.CSS_SELECTOR)

self.unselect_if_selected(selector, by=By.CSS_SELECTOR)
# Duplicates: self.uncheck_if_checked(selector, by=By.CSS_SELECTOR)