问题
I am stuck at this point below:
'''selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: .has-error'''
I tried to find a solution related to ".has-error" in order to get one of the functional tests via TDD to pass. Anyone ever experienced being stuck with that? Am I doing something wrong or missing a very little point? Your help would be appreciated!
Related code between my template/selenium:
Python part:
self.wait_for(lambda: self.assertEqual(self.browser.find_element_by_css_selector('.has-error').text,
"You can't have an empty list item"))
html part:
<div class="form-group has-error">
<span class="help-block">{{ error }}</span>
</div>
{% endif %}
来源:https://stackoverflow.com/questions/61740786/tdd-testing-css-and-html