From 5014be49b6dfe565a1287553a2706e97ce769a58 Mon Sep 17 00:00:00 2001 From: Trent Palmer Date: Mon, 23 Aug 2021 11:09:35 -0700 Subject: [PATCH] add TestIDsForDuplicates to test_selenium.py --- test/test_selenium.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/test_selenium.py b/test/test_selenium.py index 1febe5d..6d195f3 100644 --- a/test/test_selenium.py +++ b/test/test_selenium.py @@ -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)))