Comments (2)
By default, the 'parse' matcher is in use.
Defining a generic step for this use should be as simple as the following:
@then(u'I should see "{text}"')
def expect_some_text(context, text):
assert context.behave_driver.element_contains('body', text)
The problem you're encountering with the latter two steps is that, in order to use regex matching, you'd need to change the step matcher first.
So you could define the same kind of step using the regex matcher this way
from behave import use_step_matcher
use_step_matcher('re')
@then(u'I should see "([^"]*)?"')
def step_impl(context, value):
assert context.behave_driver.element_contains('body', value)
If you change the matcher, don't forget to change it back as needed, so your other steps don't unexpectedly stop working.
For more info, you can read about this more in the behave documentation
from behave-webdriver.
Thank you! I wasn't sure if this was better asked there or here.
from behave-webdriver.
Related Issues (20)
- Configure AppVeyor for Internet Explorer HOT 1
- Transform step parameters HOT 2
- Some tests assume test url is always on localhost:8000 HOT 2
- Pip install fails on Python2 HOT 5
- can't run minimal-project HOT 6
- TypeError: issubclass() arg 1 must be a class HOT 2
- redundant "I pause for " HOT 1
- Cannot go to behave-webdriver step declaration in PyCharm (Professional) HOT 6
- PyPI Deploy failing due to description content type. HOT 2
- "When I click on the link" isn't clicking on the link HOT 1
- Does it also support Page object model HOT 2
- conditions.element_contains_value((MobileBy.IOS_PREDICATE, "name = 'login'"), text_='login')(context.behave_driver) Exception: Message: Method is not implemented HOT 5
- How to add firefox_profile into the behave.webdriver framework HOT 2
- behave-webdriver HOT 2
- The step "When I clear the inputfield "{element}" doesn't work in Chrome HOT 1
- support for find_elements HOT 1
- sre_constants.error: nothing to repeat
- TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases HOT 6
- Suggestion: use @step instead of more specific decorators HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from behave-webdriver.