summaryrefslogtreecommitdiff
path: root/tests/cradio.py
diff options
context:
space:
mode:
authorGravatar Artyom Shalkhakov <artyom.shalkhakov@gmail.com>2018-05-28 21:34:07 +0600
committerGravatar Artyom Shalkhakov <artyom.shalkhakov@gmail.com>2018-05-28 21:34:07 +0600
commit7f6f6045c0c1cc9bd8323e3e7de905e0e46fe82d (patch)
tree5e21a934f0d49d35633ccbc65ab8114d4570d9e0 /tests/cradio.py
parent373cb403871c0c77f26cb76213adde3aeb278240 (diff)
Adding: cradio (support for client-side radio box).
Diffstat (limited to 'tests/cradio.py')
-rw-r--r--tests/cradio.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/cradio.py b/tests/cradio.py
new file mode 100644
index 00000000..b70b2ef1
--- /dev/null
+++ b/tests/cradio.py
@@ -0,0 +1,27 @@
+import unittest
+import base
+
+# issue: initialization doesn't quite work
+
+class Suite(base.Base):
+# test case:
+# initially the source is EMPTY
+# then we pick SECOND variant and check the source
+# then we pick the FIRST variant and check the source
+ 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)
+ el1 = self.xpath('label[1]/input')
+ el2 = self.xpath('label[2]/input')
+ self.assertEqual(False, el1.is_selected())
+ self.assertEqual(True, el2.is_selected())
+ el1.click()
+ alert = self.driver.switch_to.alert
+ self.assertEqual("Now it's A", alert.text)
+ 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)