2023-01-19 13:07:40 +08:00
|
|
|
"""TAG:contains("TEXT") is a special, non-standard CSS Selector
|
2022-10-30 11:29:55 +08:00
|
|
|
that gets converted to XPath: '//TAG[contains(., "TEXT")]'
|
2023-01-19 13:07:40 +08:00
|
|
|
before it's used by Selenium calls. Also part of jQuery."""
|
2020-11-25 11:47:01 +08:00
|
|
|
from seleniumbase import BaseCase
|
2023-01-19 13:07:40 +08:00
|
|
|
BaseCase.main(__name__, __file__)
|
2020-11-25 11:47:01 +08:00
|
|
|
|
|
|
|
|
2021-03-11 06:27:52 +08:00
|
|
|
class ContainsSelectorTests(BaseCase):
|
2020-11-25 11:47:01 +08:00
|
|
|
def test_contains_selector(self):
|
|
|
|
self.open("https://xkcd.com/2207/")
|
2021-07-30 09:25:50 +08:00
|
|
|
self.assert_element('div.box div:contains("Math Work")')
|
2020-11-25 11:47:01 +08:00
|
|
|
self.click('a:contains("Next")')
|
2021-07-30 09:25:50 +08:00
|
|
|
self.assert_element('div div:contains("Drone Fishing")')
|