TDD/testing CSS and HTML

浪尽此生 提交于 2021-01-28 06:02:00

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!