예제 #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)
예제 #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)
예제 #3
0
 def test_prompt_callback(self):
     self.robot.open("%salert" % base_url)
     with prompt(self.robot, callback=lambda: 'another value'):
         self.robot.click('id=prompt-button')
     value = self.robot.evaluate('promptValue')
     self.assertEqual(value, 'another value')
예제 #4
0
 def test_prompt(self):
     self.robot.open("%salert" % base_url)
     with prompt(self.robot, 'my value'):
         self.robot.click('id=prompt-button')
     value = self.robot.evaluate('promptValue')
     self.assertEqual(value, 'my value')
예제 #5
0
 def test_prompt_callback(self):
     self.robot.open("%salert" % base_url)
     with prompt(self.robot, callback=lambda: 'another value'):
         self.robot.click( 'id=prompt-button')
     value = self.robot.evaluate('promptValue')
     self.assertEqual(value, 'another value')
예제 #6
0
 def test_prompt(self):
     self.robot.open("%salert" % base_url)
     with prompt(self.robot, 'my value'):
         self.robot.click( 'id=prompt-button')
     value = self.robot.evaluate('promptValue')
     self.assertEqual(value, 'my value')