Skip to content

Commit adbbd19

Browse files
authored
Merge pull request #369 from seleniumbase/partial-link-text-updates-2
Update a method name from the last Pull Request
2 parents 418e35c + 36076b9 commit adbbd19

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

help_docs/method_summary.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ self.is_partial_link_text_present(link_text)
2727

2828
self.get_link_attribute(link_text, attribute, hard_fail)
2929

30-
self.get_partial_link_attribute(link_text, attribute, hard_fail)
30+
self.get_partial_link_text_attribute(link_text, attribute, hard_fail)
3131

3232
self.wait_for_link_text_present(link_text, timeout=settings.SMALL_TIMEOUT)
3333

seleniumbase/fixtures/base_case.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,8 @@ def get_link_attribute(self, link_text, attribute, hard_fail=True):
266266
else:
267267
return None
268268

269-
def get_partial_link_attribute(self, link_text, attribute, hard_fail=True):
269+
def get_partial_link_text_attribute(self, link_text, attribute,
270+
hard_fail=True):
270271
""" Finds a link by partial link text and then returns the attribute's
271272
value. If the partial link text or attribute cannot be found, an
272273
exception will get raised if hard_fail is True (otherwise None
@@ -462,7 +463,7 @@ def click_partial_link_text(self, partial_link_text,
462463
element.click()
463464
except Exception:
464465
found_css = False
465-
text_id = self.get_partial_link_attribute(
466+
text_id = self.get_partial_link_text_attribute(
466467
partial_link_text, "id", False)
467468
if text_id:
468469
link_css = '[id="%s"]' % partial_link_text
@@ -477,14 +478,14 @@ def click_partial_link_text(self, partial_link_text,
477478
found_css = True
478479

479480
if not found_css:
480-
ngclick = self.get_partial_link_attribute(
481+
ngclick = self.get_partial_link_text_attribute(
481482
partial_link_text, "ng-click", False)
482483
if ngclick:
483484
link_css = '[ng-click="%s"]' % ngclick
484485
found_css = True
485486

486487
if not found_css:
487-
onclick = self.get_partial_link_attribute(
488+
onclick = self.get_partial_link_text_attribute(
488489
partial_link_text, "onclick", False)
489490
if onclick:
490491
link_css = '[onclick="%s"]' % onclick
@@ -3197,7 +3198,8 @@ def __click_dropdown_link_text(self, link_text, link_css):
31973198
return False
31983199

31993200
def __get_href_from_partial_link_text(self, link_text, hard_fail=True):
3200-
href = self.get_partial_link_attribute(link_text, "href", hard_fail)
3201+
href = self.get_partial_link_text_attribute(
3202+
link_text, "href", hard_fail)
32013203
if not href:
32023204
return None
32033205
if href.startswith('//'):

0 commit comments

Comments
 (0)