Example #1
0
 def testTicketExists(self):
     self.open(base_url + "/logout")
     self.registerTestUser()
     self.login()
     self.createTestTicket("existingTicket", 99, 10)
     self.assert_element("#btn-buy-existingTicket")
     backend.clean_database()
Example #2
0
 def testTicketAmountFailUpper(self):
     self.open(base_url + "/logout")
     self.registerTestUser()
     self.login()
     self.createTestTicket("testAmountFU", 99, 10)
     self.click("#btn-buy-testAmountFU")
     self.sleep(1)
     self.type("#buy-ticket-quantity", "200")
     self.click("#buy-ticket-button")
     #Verify error message
     self.assert_text("Please select 1 to 100 tickets", "#error_msg")
     backend.clean_database()
Example #3
0
 def testTicketAmountSuccessUpper(self):
     self.open(base_url + "/logout")
     self.registerTestUser()
     self.login()
     self.createTestTicket("testAmountSU", 99, 10)
     self.click("#btn-buy-testAmountSU")
     self.sleep(1)
     self.type("#buy-ticket-quantity", "50")
     self.click("#buy-ticket-button")
     #No error message
     self.assert_text_not_visible("", "#error_msg")
     backend.clean_database()
Example #4
0
 def testUserHasBalance(self):
     self.open(base_url + "/logout")
     self.registerTestUser()
     self.login()
     backend.add_user_funds("*****@*****.**", 50)
     self.createTestTicket("testLowPrice", 1, 10)
     self.click("#btn-buy-testLowPrice")
     self.sleep(1)
     self.type("#buy-ticket-quantity", "1")
     self.click("#buy-ticket-button")
     #No error message
     self.assert_text_not_visible("", "#error_msg")
     backend.clean_database()
Example #5
0
 def testUserDoesntHaveBalance(self):
     self.open(base_url + "/logout")
     self.registerTestUser()
     self.login()
     backend.add_user_funds("*****@*****.**", -10000)
     self.createTestTicket("testCantAfford", 1, 10)
     self.click("#btn-buy-testCantAfford")
     self.sleep(1)
     self.type("#buy-ticket-quantity", "1")
     self.click("#buy-ticket-button")
     #No error message
     self.assert_text("You do not have enough funds to purchase this",
                      "#error_msg")
     backend.add_user_funds("*****@*****.**", 10000)
     backend.clean_database()
Example #6
0
    def testTicketInStock(self):
        self.open(base_url + "/logout")
        self.registerTestUser()
        self.login()
        self.createTestTicket("testStock", 1, 10)
        self.click("#btn-buy-testStock")
        self.sleep(1)
        self.type("#buy-ticket-quantity", "1")
        self.click("#buy-ticket-button")
        #Verify no error
        self.assert_text_not_visible("", "#error_msg")

        self.sleep(1)
        self.click("#btn-buy-testStock")
        self.sleep(1)
        self.type("#buy-ticket-quantity", "1")
        self.click("#buy-ticket-button")
        #Verify error message
        self.assert_text("There are not enough tickets available",
                         "#error_msg")
        backend.clean_database()
Example #7
0
 def refresh(self):
     backend.clean_database()
     self.open(base_url + '/logout')
     self.register()
     self.login()
     self.open(base_url)