Skip to content

Commit

Permalink
Merge pull request #11 from AdCombo/py310_ready
Browse files Browse the repository at this point in the history
TECH-192 for PP offers page fixes
  • Loading branch information
dpanfilovadcombo authored Aug 8, 2024
2 parents 90a9760 + ba686e1 commit 565aeeb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion combo_e2e/pages/uicomponents/helpers/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def parse_table_thead(head: str, tag_text_key: str, attributes: Set[str]):
# group title, not column name
continue
if item.tag == HEAD_COLUMN_TAG:
formatted_key = format_tag_text(item.text)
formatted_key = format_tag_text(''.join(item.itertext()))
if tag_text_key in res and formatted_key in res[tag_text_key]:
raise ValueError(
f"Duplicate value={formatted_key} of th.text in header of table"
Expand Down
7 changes: 6 additions & 1 deletion combo_e2e/pages/uicomponents/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,12 @@ def __get__(self, obj, objtype=None):

@classmethod
def _compile_xpath_by_visible_name(cls, name: str):
return f'//{cls.head_tag_name}[contains(text(),"{name}")]'
if '/' in name:
parts = name.split('/')
xpath_conditions = ' and '.join([f'.//span[text()="{part}"]' for part in parts])
return f'//{cls.head_tag_name}[{xpath_conditions}]'
else:
return f'//{cls.head_tag_name}[contains(text(),"{name}")]'

def _compile_xpath_by_attribute_name(self, name: str, value: str):
if not (value and name):
Expand Down

0 comments on commit 565aeeb

Please sign in to comment.