@@ -168,19 +168,6 @@ def test_xpath_single_slash(self):
168
168
"""Test XPath detection with single slash."""
169
169
assert FindElementsMixin ._get_expression_type ('/html/body' ) == By .XPATH
170
170
171
- def test_id_selector (self ):
172
- """Test ID selector detection."""
173
- assert FindElementsMixin ._get_expression_type ('#main-content' ) == By .ID
174
-
175
- def test_class_selector (self ):
176
- """Test class selector detection."""
177
- assert FindElementsMixin ._get_expression_type ('.btn-primary' ) == By .CLASS_NAME
178
-
179
- def test_class_selector_not_xpath (self ):
180
- """Test that class selector doesn't conflict with XPath dot slash."""
181
- assert FindElementsMixin ._get_expression_type ('.button' ) == By .CLASS_NAME
182
- assert FindElementsMixin ._get_expression_type ('./button' ) == By .XPATH
183
-
184
171
def test_css_selector_default (self ):
185
172
"""Test CSS selector as default."""
186
173
assert FindElementsMixin ._get_expression_type ('div.content > p' ) == By .CSS_SELECTOR
@@ -192,6 +179,11 @@ def test_css_selector_attribute(self):
192
179
def test_css_selector_pseudo_class (self ):
193
180
"""Test CSS selector with pseudo-classes."""
194
181
assert FindElementsMixin ._get_expression_type ('button:hover' ) == By .CSS_SELECTOR
182
+
183
+ def test_css_selector_not_xpath (self ):
184
+ """Test that css selector doesn't conflict with XPath dot slash."""
185
+ assert FindElementsMixin ._get_expression_type ('.button' ) == By .CSS_SELECTOR
186
+ assert FindElementsMixin ._get_expression_type ('./button' ) == By .XPATH
195
187
196
188
def test_complex_xpath_expressions (self ):
197
189
"""Test complex XPath expressions are detected correctly."""
@@ -208,12 +200,6 @@ def test_edge_case_expressions(self):
208
200
"""Test edge case expressions."""
209
201
# Empty string should default to CSS
210
202
assert FindElementsMixin ._get_expression_type ('' ) == By .CSS_SELECTOR
211
-
212
- # Just a dot should be class selector
213
- assert FindElementsMixin ._get_expression_type ('.' ) == By .CLASS_NAME
214
-
215
- # Just a hash should be ID selector
216
- assert FindElementsMixin ._get_expression_type ('#' ) == By .ID
217
203
218
204
219
205
class TestEnsureRelativeXPath :
0 commit comments