예제 #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_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!')
예제 #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!')
예제 #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!')
예제 #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!')
예제 #7
0
파일: run_test.py 프로젝트: elainte/GRobot
 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!')