Example #1
0
 def test_popup_messages_collection(self):
     self.robot.open("%salert" % base_url)
     def _test():
         self.assertIn('this is a confirm', self.robot.popup_messages)
         return True
     with confirm(self.robot, True, callback=_test):
         self.robot.click( 'id=confirm-button')
 
     self.robot.wait_for_alert()
 
     with prompt(self.robot, confirm=False):
         self.robot.click( 'id=prompt-button')
 
     self.assertIn('Prompt ?', self.robot.popup_messages)
 
     self.robot.click( 'id=alert-button')
 
     self.assertIn('this is an alert', self.robot.popup_messages)
Example #2
0
 def test_popup_messages_collection(self):
     self.robot.open("%salert" % base_url)
     def _test():
         self.assertIn('this is a confirm', self.robot.popup_messages)
         return True
     with confirm(self.robot, True, callback=_test):
         self.robot.click( 'id=confirm-button')
 
     self.robot.wait_for_alert()
 
     with prompt(self.robot, confirm=False):
         self.robot.click( 'id=prompt-button')
 
     self.assertIn('Prompt ?', self.robot.popup_messages)
 
     self.robot.click( 'id=alert-button')
 
     self.assertIn('this is an alert', self.robot.popup_messages)
Example #3
0
 def test_confirm_callback(self):
     self.robot.open("%salert" % base_url)
     with confirm(self.robot, callback=lambda: False):
         self.robot.click('id=confirm-button')
     msg = self.robot.wait_for_alert()
     self.assertEqual(msg, 'you denied!')
Example #4
0
 def test_confirm(self):
     self.robot.open("%salert" % base_url)
     with confirm(self.robot):
         self.robot.click('id=confirm-button')
     msg = self.robot.wait_for_alert()
     self.assertEqual(msg, 'you confirmed!')
Example #5
0
 def test_confirm_callback(self):
     self.robot.open("%salert" % base_url)
     with confirm(self.robot, callback=lambda: False):
         self.robot.click( 'id=confirm-button')
     msg = self.robot.wait_for_alert()
     self.assertEqual(msg, 'you denied!')
Example #6
0
 def test_confirm(self):
     self.robot.open("%salert" % base_url)
     with confirm(self.robot):
         self.robot.click('id=confirm-button')
     msg = self.robot.wait_for_alert()
     self.assertEqual(msg, 'you confirmed!')
Example #7
0
 def test_no_confirm(self):
     self.robot.open("%salert" % base_url)
     with confirm(self.robot,False):
         self.robot.selenium('click','id=confirm-button')
     msg = self.robot.wait_for_alert()
     self.assertEqual(msg, 'you denied!')