Example #1
0
def test_lambda_wait():
    incman = Incrementor()
    ec, tc = wait_for(lambda self: self.i_sleep_a_lot() > 10,
                      [incman],
                      delay=.05)
    print "Function output %s in time %s " % (ec, tc)
    Assert.less(tc, 2, "Should take less than 2 seconds")
Example #2
0
def test_simple_wait():
    incman = Incrementor()
    ec, tc = wait_for(incman.i_sleep_a_lot,
                      fail_condition=0,
                      delay=.05)
    print "Function output %s in time %s " % (ec, tc)
    Assert.less(tc, 1, "Should take less than 1 seconds")
Example #3
0
    def test_sort_by_price_ascending_should_succeed(self):
        home_page = HomePage(self.driver).open_home_page()
        TV_page = home_page.header.open_TV_page()
        TV_page.sort_by_price_ascending()
        sleep(2)
        WebDriverWait(self.driver, 30).until(EC.invisibility_of_element_located(TV_page._processing_info))

        Assert.less(TV_page.text_price_first_product(), TV_page.text_price_second_product())
 def test_less_fail_int_message(self):
     try:
         Assert.less(2, 1, "message")
     except AssertionError as e:
         Assert.equal(e.msg, "message")
 def test_less_fail_string_message(self):
     try:
         Assert.less("2", "1", "message")
     except AssertionError as e:
         Assert.equal(e.msg, "message")
 def test_less_success(self):
     Assert.less("1", "2")
     Assert.less(1, 2)
Example #7
0
 def test_less_fail_int_message(self):
     try:
         Assert.less(2, 1, "message")
     except AssertionError, e:
         pass
Example #8
0
 def test_less_fail_string_message(self):
     try:
         Assert.less("2", "1", "message")
     except AssertionError, e:
         pass
Example #9
0
 def test_less_fail_int(self):
     try:
         Assert.less(2, 1)
     except AssertionError, e:
         pass 
Example #10
0
 def test_less_fail_int_message(self):
     try:
         Assert.less(2, 1, "message")
     except AssertionError as e:
         Assert.equal(e.msg, "message")
Example #11
0
 def test_less_fail_string_message(self):
     try:
         Assert.less("2", "1", "message")
     except AssertionError as e:
         Assert.equal(e.msg, "message")
Example #12
0
 def test_less_success(self):
     Assert.less("1", "2")
     Assert.less(1, 2)
Example #13
0
def test_lambda_wait():
    incman = Incrementor()
    ec, tc = wait_for(lambda self: self.i_sleep_a_lot() > 2, [incman])
    print "Function output %s in time %s " % (ec, tc)
    Assert.less(tc, 12, "Should take less than 12 seconds")
Example #14
0
def test_simple_wait():
    incman = Incrementor()
    ec, tc = wait_for(incman.i_sleep_a_lot, fail_condition=0)
    print "Function output %s in time %s " % (ec, tc)
    Assert.less(tc, 4, "Should take less than 4 seconds")