mirror of
https://github.com/TrentSPalmer/hugo_themes_report.git
synced 2025-11-21 02:08:25 -08:00
fix deprecated find_elements_by* and find_element_by*
This commit is contained in:
@@ -1,32 +1,34 @@
|
||||
import re
|
||||
from test.test_description import TestDescription
|
||||
from unittest import TestCase
|
||||
import re
|
||||
|
||||
from selenium.webdriver.common.by import By
|
||||
|
||||
|
||||
class TestDescriptionPerLicense(TestDescription, TestCase):
|
||||
def test_description_per_license(self):
|
||||
match = re.compile(r'^(.*)(\s\(\d*\))$')
|
||||
|
||||
self.driver.find_element_by_id('button-for-filter-by-license').click()
|
||||
self.driver.find_element(By.ID, 'button-for-filter-by-license').click()
|
||||
|
||||
licenseSelectionRow = self.driver.find_element_by_id(
|
||||
'licenseSelectionRow'
|
||||
licenseSelectionRow = self.driver.find_element(
|
||||
By.ID, 'licenseSelectionRow'
|
||||
)
|
||||
|
||||
inputs = [
|
||||
x.get_attribute(
|
||||
'id'
|
||||
) for x in licenseSelectionRow.find_elements_by_tag_name(
|
||||
'input'
|
||||
) for x in licenseSelectionRow.find_elements(
|
||||
By.TAG_NAME, 'input'
|
||||
)
|
||||
]
|
||||
|
||||
for i, x in enumerate(inputs):
|
||||
button = self.driver.find_element_by_id(
|
||||
x).find_element_by_xpath('..')
|
||||
button = self.driver.find_element(
|
||||
By.ID, x).find_element(By.XPATH, '..')
|
||||
|
||||
license = match.search(
|
||||
button.find_element_by_tag_name('label').text).group(1)
|
||||
button.find_element(By.TAG_NAME, 'label').text).group(1)
|
||||
if i == 0:
|
||||
self.licenses = license
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user