add TestIDsForDuplicates to test_selenium.py

This commit is contained in:
Trent Palmer 2021-08-23 11:09:35 -07:00
parent fae3e8b328
commit 5014be49b6

View File

@ -19,3 +19,10 @@ class TestSelenium(TestCase):
def tearDown(self):
self.driver.quit()
class TestIDsForDuplicates(TestSelenium, TestCase):
def test_for_unique_ids(self):
ids = [x.get_attribute(
'id') for x in self.driver.find_elements_by_xpath('//*[@id]')]
self.assertEqual(len(ids), len(set(ids)))