diff options
author | Artyom Shalkhakov <artyom.shalkhakov@gmail.com> | 2018-05-30 20:26:06 +0600 |
---|---|---|
committer | Artyom Shalkhakov <artyom.shalkhakov@gmail.com> | 2018-05-30 20:26:06 +0600 |
commit | 4bf7bfd52e5e822b05665b1872a2cfd31417486d (patch) | |
tree | b0f5b8b6f14c318b1634ae987eb7a84961983455 /tests/cradio.py | |
parent | 6fc9746d0cc8f18cc570647b8e571a34c5aeb0fe (diff) |
Multi-group test
Diffstat (limited to 'tests/cradio.py')
-rw-r--r-- | tests/cradio.py | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/tests/cradio.py b/tests/cradio.py index acc8dc11..cc075593 100644 --- a/tests/cradio.py +++ b/tests/cradio.py @@ -5,8 +5,10 @@ class Suite(base.Base): def test_1(self): """Test case 1""" self.start("Cradio/main") - txt = self.body_text() - self.assertEqual("Wilbur Walbur Hello, I'm B. I'll be your waiter for this evening.", txt) + txt = self.xpath('div[1]').text + self.assertEqual("Hello, I'm B. I'll be your waiter for this evening.", txt) + txt2 = self.xpath('div[2]').text + self.assertEqual('Value:', txt2) el1 = self.xpath('label[1]/input') el2 = self.xpath('label[2]/input') self.assertEqual(False, el1.is_selected()) @@ -17,5 +19,15 @@ class Suite(base.Base): alert.accept() self.assertEqual(True, el1.is_selected()) self.assertEqual(False, el2.is_selected()) - txt = self.body_text() - self.assertEqual("Wilbur Walbur Hello, I'm A. I'll be your waiter for this evening.", txt) + txt = self.xpath('div[1]').text + self.assertEqual("Hello, I'm A. I'll be your waiter for this evening.", txt) + txt2 = self.xpath('div[2]').text + self.assertEqual('Value:', txt2) + # now check that the second radio group works as well + el3 = self.xpath('label[4]/input') + el3.click() + alert = self.driver.switch_to.alert + alert.accept() + txt2 = self.xpath('div[2]').text + self.assertEqual('Value: Y', txt2) + self.assertEqual("Hello, I'm A. I'll be your waiter for this evening.", txt) |