Releases: seleniumbase/SeleniumBase
Releases · seleniumbase/SeleniumBase
Updates to running WebDriver tests with Safari
Updates to running WebDriver tests with Safari
- Update Safari WebDriver launcher
- Set default Safari position and dimensions if not maximized
- Add an example test for the Apple developer site WebDriver instructions
- Add a localized
set_window_rect(x, y, width, height)
- Add additional ways to set the web browser's user agent
- Refresh Python dependencies
Fix Chrome proxy with auth; and a few other updates
Fix Chrome proxy with auth; and a few other updates
- Do not use the Chrome flag: "--disable-extensions" (it breaks proxy auth)
- Add cmd option
--use-auto-ext
to use Chrome's Automation Extension - Auto-generate the desired capabilities "name" if
"*"
is passed - Remove unused "portalocker" from Python dependencies
Proxy Instructions:
# Run tests through a proxy server
pytest proxy_test.py --proxy=IP_ADDRESS:PORT
# Run tests through a proxy server with authentication
pytest proxy_test.py --proxy=USERNAME:PASSWORD@IP_ADDRESS:PORT
Multiple Updates (Translations, Settings, etc)
Multiple Updates (Translations, Settings, etc)
- Add more translated methods (language translations)
- Add more custom parameters for passing into tests
- Add additional custom markers for pytest
- Make Chrome tests more efficient
- Update the
seleniumbase mkdir DIR
command - Use a simplified URL format in tests
- Update and add tests
- Update GitHub Workflows
Add the Dutch translation and update Russian
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
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
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
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
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
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
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