-
Notifications
You must be signed in to change notification settings - Fork 50
add option --splinter-webdriver-executable for phantomjs and chrome #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add option --splinter-webdriver-executable for phantomjs and chrome #24
Conversation
Conflicts: CHANGES.rst pytest_splinter/plugin.py
Are you sure this is a good idea? The arguments already have long names and they are fixtures so cannot make then short, We will end up invoking it like this: get_args(splinter_webdriver_executavle=splinter_webdriver_executable Since this is an internal function anyway, I think it is better to keeo it as it is. |
nobody stops you to rename the parameters in get_args function so it will get_args(executable=splinter_webdriver_executable, On 14 April 2015 at 11:01, sureshvv notifications@github.com wrote:
Anatoly Bubenkov |
But then the code inside get_args will have to change, and it will become confusing to people who know/follow the code. Currently git diff now shows the same block of code extracted and neatly moved up into a separate function. While I agree that the keyword style arguments will make the test look prettier, I am not so sure that it is an overall improvement. |
git diff will also show you renamed arguments, which is pretty readable, On 14 April 2015 at 11:35, sureshvv notifications@github.com wrote:
Anatoly Bubenkov |
…-webdriver-executable Conflicts: pytest_splinter/plugin.py tests/test_plugin.py
pytest_splinter/plugin.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you forget to pass as kwargs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't follow your question.
get_args returns a dict which is passed as kwargs to the Browser() constructor. get_args has keyword arguments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
call get_args like:
get_args(driver=splinter_webdriver,....
add option --splinter-webdriver-executable for phantomjs and chrome
thanks! |
1.3.5 is out |
Thank you. Is pep257 checking not part of tox tests? I thought I addressed all the issues. |
now it is :) On 20 April 2015 at 21:47, sureshvv notifications@github.com wrote:
Anatoly Bubenkov |
I have an issue after this pull request. My phantomjs binary is in ~/.virtualenvs/mx/bin/ (installed via nodeenv). After update to current version of pytest-splinter, I always get the following exception: def start(self):
"""
Starts PhantomJS with GhostDriver.
:Exceptions:
- WebDriverException : Raised either when it can't start the service
or when it can't connect to the service
"""
try:
self.process = subprocess.Popen(self.service_args, stdin=subprocess.PIPE,
close_fds=platform.system() != 'Windows',
stdout=self._log, stderr=self._log)
except Exception as e:
> raise WebDriverException("Unable to start phantomjs with ghostdriver.", e)
E selenium.common.exceptions.WebDriverException: Message: Unable to start phantomjs with ghostdriver.
E Screenshot: available via screen I fixed this with this workaround in my conftest.py: @pytest.fixture(scope='session')
def splinter_webdriver_executable(request):
return distutils.spawn.find_executable(request.config.option.splinter_webdriver) |
thanks for noticing! |
--splinter-webdriver-executable=$HOME/.virtualenvs/mx/bin should help you. But not sure why this pull request broke it. Was it working before? |
look at the last commit :) |
aah.. coincidentally named fixtures :) |
On 04/21/2015 01:43 PM, sureshvv wrote:
|
On 04/21/2015 01:50 PM, Benjamin Hedrich wrote:
mx/account/tests/acceptance/test_email_confirmation.py .. With 1.3.6 the issue seems to be resolved! Thank you! |
Actually I think it is better to raise an Exception if executable not found rather than quietly ignore the option, |
btw: while looking into why the error from |
And I agree with @sureshvv: it's an error and should not pass silently. |
@sureshvv but where do you see that we silently ignore the option? |
@bubenkoff @blueyed Sorry.. I was reading too fast :-) It is fine as it is |
No description provided.