Open yashaka opened 4 years ago
But now, the core API of selene should work:
from selene import Browser, Config mobile = Browser(Config( driver=yourAppiumDriver, timeout=10, ...))
So then u should throw mobile to each test as a fixture, and call
mobile.element(..)
?
you can manage your mobile instance in a whatever way you like. Just keep it as a global variable and import where do you need it
# tests/conftest.py
from selene import Browser, Config
mobile = Browser(Config(
driver=yourAppiumDriver,
timeout=10,
...))
# tests/test_app.py
from tests.conftest import mobile
def test_something():
mobile. ...
or use it as an explicit fixture:
# tests/conftest.py
from selene import Browser, Config
import pytest
# here it is implemented yet as a global variable, but you can change implementation to create it in the fixture below each time...
mobile_browser = Browser(Config(
driver=yourAppiumDriver,
timeout=10,
...))
@pytest.fixture
def mobile()
return mobile_browser
# tests/test_app.py
def test_something(mobile):
mobile. ...
@yashaka understood. Thank you!
Example of project with configured Appium + Selene - https://github.com/qa-guru/mobile-tests-13-py
Currently if you use
it will fail with something like:
For now it's unclear should we fix the "shared browser" in Selene or not... Maybe it's good to keep it as it is, i.e. web-ui oriented, not web+mobile oriented... We'll see...
But now, the core API of selene should work: