I'm using your library in order to add Behavior Driven Development capabilities into my application and I'm having a good experience with that. I'm not sure if this feature belongs to some Milestone, or it can be considered out of scope of this project, but I would like to give a try anyway.
The problem
One thing that I noticed, and I was struggling to get working into my instance was: I would like to have a browser ready for my selenium based testing using Splinter with a difference: I would like to connect to a browser available through an external tool like selenium-hub pointing to my django test server.
Actually behave-django already create a Test Server, but only listening localhost.
Suppose I'm using the following docker-compose structure, with my django app running under myapp service; I would like to connect to a remote webdriver into http://selenium-hub:4444/wd/hub and connect, during the behave run, to http://myapp:<a_test_port>.
Something like this:
from splinter.browser import Browser
# (...)
context.selenium_browser = Browser(driver_name='remote', browser='chrome',
command_executor='http://selenium-hub:4444/wd/hub')
# (...)
context.selenium_browser.visit(context.get_url()) # But this url will point to the right place since the browser belongs the same network as django app
There is brilliant project called docker-selenium, maintained by the SeleniumHQ itself that create docker images ready for being used with a remote Webdriver. In a nutshell you can delegate the selenium calls to this API called selenium-hub that will work as a load balancer of browers, adding the ability to select different types of browsers (e.g. Chrome, Firefox, Edge and so on) using the same interface.
What is going to be the outcomes from this feature
By adding a way to perform such kind of tests, or a configuration param that allow us to listen a Live server in a local docker network, I would be able to point the selenium browser to http://myapp:port through a real context.get_url(), having a pretty smooth development and also this feature could be easily integrated to a CI/CD pipeline as well.
Some good finding about how to integrate it
I noticed that we already have a SeleniumTestCaseBase object on the stable branch of Django, interestingly configurable, as you can see on this link:
If you guys find this feature useful I can also create a PR for it with a suggestion. What it sounds like?
Thank you!
Hello guys, and thanks for the great work.
I'm using your library in order to add Behavior Driven Development capabilities into my application and I'm having a good experience with that. I'm not sure if this feature belongs to some Milestone, or it can be considered out of scope of this project, but I would like to give a try anyway.
The problem
One thing that I noticed, and I was struggling to get working into my instance was: I would like to have a browser ready for my selenium based testing using
Splinter
with a difference: I would like to connect to a browser available through an external tool likeselenium-hub
pointing to my django test server.Actually
behave-django
already create a Test Server, but only listeninglocalhost
.Suppose I'm using the following docker-compose structure, with my django app running under
myapp
service; I would like to connect to a remote webdriver intohttp://selenium-hub:4444/wd/hub
and connect, during the behave run, tohttp://myapp:<a_test_port>
.Something like this:
Remark about selenium-hub and chrome container
There is brilliant project called
docker-selenium
, maintained by the SeleniumHQ itself that create docker images ready for being used with a remote Webdriver. In a nutshell you can delegate the selenium calls to this API calledselenium-hub
that will work as a load balancer of browers, adding the ability to select different types of browsers (e.g. Chrome, Firefox, Edge and so on) using the same interface.What is going to be the outcomes from this feature
By adding a way to perform such kind of tests, or a configuration param that allow us to listen a Live server in a local docker network, I would be able to point the selenium browser to http://myapp:port through a real
context.get_url()
, having a pretty smooth development and also this feature could be easily integrated to a CI/CD pipeline as well.Some good finding about how to integrate it
I noticed that we already have a
SeleniumTestCaseBase
object on the stable branch of Django, interestingly configurable, as you can see on this link:If you guys find this feature useful I can also create a PR for it with a suggestion. What it sounds like? Thank you!