Closed mikelietz closed 5 years ago
If I attempt to run selenium-requests instead, the ImportError I get is for 'parse'. Pip tells me that's installed.
Thanks for reporting this issue @mikelietz
It looks like there are two problems here.
(1) The minimal example will need to be updated for the current release, as BehaveDriver
has been removed and replaced with regular selenium class names.
(2) The selenium-requests example, as written, only works on Python3 right now. Though, making this example Py2 compatible shouldn't be too much work.
I'll address these problems shortly.
Hey @mikelietz
I just updated the examples in the master
branch. In the process, I also discovered another bug ( #69 ) along the way, which I just merged a patch for and released in v0.2.2
You should be all set with these latest changes. Let me know if that works for you.
Thanks for the quick update! I grabbed the latest and tried to run it - it does execute now but now there are TypeErrors:
minimal-project $ behave
Feature: Sample Snippets test # features/myFeature.feature:2
As a developer
I should be able to use given text snippets
Scenario: open URL # features/myFeature.feature:6
Given the page url is not "http://webdriverjs.christian-bromann.com/" # ../../../../../../usr/local/lib/python2.7/site-packages/behave_webdriver/steps/expectations.py:149 0.002s
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/behave/model.py", line 1329, in run
match.run(runner.context)
File "/usr/local/lib/python2.7/site-packages/behave_webdriver/transformers.py", line 111, in run
if transformer_class and (isinstance(transformer_class, partial) and issubclass(transformer_class.func, TransformerBase)) or issubclass(transformer_class, TransformerBase):
TypeError: issubclass() arg 1 must be a class
And I open the url "http://webdriverjs.christian-bromann.com/" # None
Then I expect that the url is "http://webdriverjs.christian-bromann.com/" # None
And I expect that the url is not "http://google.com" # None
Scenario: click on link # features/myFeature.feature:13
Given the title is not "two" # ../../../../../../usr/local/lib/python2.7/site-packages/behave_webdriver/steps/expectations.py:22 0.000s
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/behave/model.py", line 1329, in run
match.run(runner.context)
File "/usr/local/lib/python2.7/site-packages/behave_webdriver/transformers.py", line 111, in run
if transformer_class and (isinstance(transformer_class, partial) and issubclass(transformer_class.func, TransformerBase)) or issubclass(transformer_class, TransformerBase):
TypeError: issubclass() arg 1 must be a class
And I open the url "http://webdriverjs.christian-bromann.com/" # None
When I click on the link "two" # None
Then I expect that the title is "two" # None
Failing scenarios:
features/myFeature.feature:6 open URL
features/myFeature.feature:13 click on link
0 features passed, 1 failed, 0 skipped
0 scenarios passed, 2 failed, 0 skipped
0 steps passed, 2 failed, 6 skipped, 0 undefined
Took 0m0.002s
@mikelietz this is the other bug ( #69 ) I mentioned. The fix for this was released in v0.2.2 So you shouldn't run into this if using the latest version.
If you installed behave-webdriver with pip
be sure to upgrade it like so
pip install --upgrade behave-webdriver
My mistake - I had only upgraded what I had downloaded, for the tests, not the installed module. Thanks and yes, it is now working.
I'm attempting to use this in Python 2.7 on a Mac. I installed behave and behave-webdriver via pip.