def test_get_unattached(self): assert Element(css='bar').__get__(None, None) is None
class TestPage(PageObject): test_elem1 = Element(css='foo')
class TestPage(PageObject): test_elem = Element(css='bar')
class TestPage(PageObject): test_elem = Element(css='bar', context=True)
class TestPage(PageObject): test_elem1 = Element(css='foo') test_elem2 = Element(id_='bar')
def test_page_element_bad_args(self): with pytest.raises(ValueError): Element() with pytest.raises(ValueError): Element(id_='foo', xpath='bar')
def test_page_element(self): elem = Element(css='foo') assert elem.locator == (By.CSS_SELECTOR, 'foo')