def VerifySorting(strColumnName):
    columnIndex = GetColumnIndexByName(strColumnName)
    WebObjsSort = Users.Sort(columnIndex)

    WebObjsSort.Click()
    Waiter.Wait(3)
    strAsc = WebObjsSort.getAttribute('class')

    strFirstRecord = Users.FirstRecord(columnIndex).contentText
    strLastRecord = Users.LastRecord(columnIndex).contentText

    WebObjsSort.Click()
    Waiter.Wait(3)
    strDesc = WebObjsSort.getAttribute('class')

    strFirstRecord2 = Users.FirstRecord(columnIndex).contentText  #textContent;
    strLastRecord2 = Users.LastRecord(columnIndex).contentText  #textContent;

    Log.Message("Order By: {" + strColumnName + " " + strAsc +
                "} First Value: {" + strFirstRecord + "}, Last Value: {" +
                strLastRecord + "}")
    Log.Message("Order By: {" + strColumnName + " " + strDesc +
                "} First Value: {" + strFirstRecord2 + "}, Last Value: {" +
                strLastRecord2 + "}")

    Logger.CheckPoint("Validate Sorting On Column {" + strColumnName +
                      "} . Pass") if (
                          strFirstRecord == strLastRecord2
                          and strLastRecord == strFirstRecord2
                      ) else Log.Error("Validate Sorting On Column {" +
                                       strColumnName + "}. Failed")
    def submit_order(self):
        global Master
        data = (self.bttn_clicks1, self.v.get(), self.bttn_clicks2,
                self.k.get(), self.bttn_clicks3, self.bttn_clicks4,
                self.bttn_clicks5, self.bttn_clicks6)  # tuple to send to DB
        # print("%s %s %s %s %s %s %s %s" % (self.bttn_clicks1, self.v.get(),self.bttn_clicks2, self.k.get(), self.bttn_clicks3,self.bttn_clicks4, self.bttn_clicks5, self.bttn_clicks6))
        Waiter.orderDetails(data)
        # order_data = (a,b,c,d,e) # tuple to send to DB
        #messagebox.showinfo(title='Order status', message='Your order has been placed!')
        self.frame_image.destroy()
        self.frame_drinks.destroy()
        self.frame_food.destroy()
        # master.destroy()

        self.frame_order = ttk.Frame(Master)
        self.frame_order.pack(side="right", fill="both")

        orderStr = Waiter.getOrderDetailsStr()

        self.a = ttk.Label(self.frame_order,
                           text="%s" % (orderStr),
                           font=("Helvetica", 12))
        self.a.pack(side="top", expand=True)

        self.bill = ttk.Button(self.frame_order,
                               text="Generate Bill",
                               command=self.bill_step)
        self.bill.pack(side="bottom")
    def __init__(self):
        thread_with_server = threading.Thread(target=self.create_server)

        # p1 run server that listen on port 8888
        # p2 run Waiter class that waits to start data transmission when mouse is on the left edge of the screen
        p1 = Process(target=thread_with_server.start())
        p2 = Process(target=Waiter.Waiter(500).mainloop())
    def get_mouse_position_delta(self, event, x_previous_width, y_previous_height):
        width, height = event.x, event.y

        self.xdelta = width - x_previous_width
        self.ydelta = height - y_previous_height
        self.x_previous = width
        self.y_previous = height
        tup = (self.xdelta, self.ydelta,)
        if width > self.width_to_destroy_transparantwin:
            p1 = Process(target=self.destroy())
            p2 = Process(target=Waiter.Waiter(height).mainloop())
            p1.start()
            p2.start()

        to_send = pickle.dumps(tup)
        global globalna
        globalna.put(to_send)
        # print tup
        # a, b = tup
        # print a
        # print b
        # globalna.put(str(self.xdelta) + ',' + str(self.ydelta))
        # print str(self.xdelta) + ',' + str(self.ydelta)
        # globalna.put('{},{}'.format(self.xdelta, self.ydelta))
        print('Parametr x: {}, Parameter y: {}'.format(self.xdelta, self.ydelta))
Beispiel #5
0
    def bill_step(self):

        Waiter.sendBillRequest()

	billStr = Waiter.getBillDetailsStr()

        self.frame_order.destroy()

        self.frame_bill = ttk.Frame(Master)
        self.frame_bill.pack(side = "right",fill = "both")

	self.a=ttk.Label(self.frame_bill, text="%s"%(billStr), font=("Helvetica",12))
	self.a.pack(side = "top", expand=True)

	self.bill = ttk.Button(self.frame_bill, text="Close", command=newOrder)
        self.bill.pack()
def LoginWithValidInput(
        StrUserName=str(Project.Variables.VariableByName['UserName']),
        StrPassword=str(Project.Variables.VariableByName['Password'])):
    BrowserFactry.InitBrowser()

    WebObjUserName = Login.UserName()
    Sys.Desktop.Keys(StrUserName)

    WebObjPassword = Login.Password()
    Sys.Desktop.Keys(StrPassword)

    WebObjLogin = Login.Login()
    WebObjLogin.Click()

    if (Waiter.WaitTillDocumentReady()):
        WebObjLoginUsrName = Login.GetLoginUserName()

        ActualLoginUsrName = WebObjLoginUsrName.textContent

        Log.Message("Actual Login User Name: " + ActualLoginUsrName)
        Log.Message("Login User Name: " + StrUserName)

        if (ActualLoginUsrName == "Welcome " + StrUserName):
            Log.Checkpoint(
                "Validation for Successful Login Pass. Login User Name: " +
                ActualLoginUsrName)
        else:
            Log.Error(
                "Validation for Successful Login Failed. Actual User Name: " +
                ActualLoginUsrName + ", Expected  User Name: " + StrUserName)
def LoginWithInvalidCredentials(StrUserName, StrPassword):
    BrowserFactry.InitBrowser()

    WebObjUserName = Login.UserName()
    Sys.Desktop.Keys(StrUserName)

    WebObjPassword = Login.Password()
    Sys.Desktop.Keys(StrPassword)

    WebObjLogin = Login.Login()
    WebObjLogin.Click()
    Waiter.Wait(1, "Wait for Message.")

    WebObjErrorMsg = Login.ErrorMessage()

    ActualErrorMsg = WebObjErrorMsg.textContent
    Log.Message("Actual Error Msg: " + ActualErrorMsg)

    ExpectedErrorMsg = Login.GetValueFromOR("ErrMsg", "InvalidCredentials")
    Log.Message("Expected Error Msg: " + ExpectedErrorMsg)

    if (ActualErrorMsg == ExpectedErrorMsg):
        Log.Checkpoint(
            "Validation for Invalid Credentials Error Message Pass. Error Msg:"
            + ActualErrorMsg)
    else:
        Log.Error(
            "Validation for Invalid Credentials Error Message Failed. Actual Error Msg: "
            + ActualErrorMsg + ", Expected Error Msg: " + ExpectedErrorMsg)
def GetWebElement(FindBy, Value, All=False):
    WebElement = None
    ObjAttributes = Log.CreateNewAttributes()
    ObjAttributes.Bold = True
    ObjAttributes.BackColor = clLtGray
    Log.Message(
        "Search Object With, How: {" + FindBy + "}, Using: {" + Value + "}",
        '', pmNormal, ObjAttributes)
    return Waiter.Synchronization(FindBy, Value, All)
def GetColumnIndexByName(strColumnName):
    Waiter.Wait(1)
    WebObjsUserWebTable = Users.UserWebTable()
    count = BuiltIn.VarArrayHighBound(WebObjsUserWebTable, 1)
    if (count > -1):
        for index in range(0, count + 1):
            if (aqString.Trim(
                    WebObjsUserWebTable[index].innerText) == strColumnName):
                Log.Message("Index Number of Column {" + strColumnName +
                            "} is " + str(index + 2))
                return index + 2
Beispiel #10
0
def InitBrowser():
    TestBrowser = ObjBrowserProperties.GetTestBrowser()
    if (TestBrowser == "iexplore"):
        BrowserFactry.LaunchIE()
    elif (TestBrowser == "chrome"):
        BrowserFactry.LaunchChrome()
    elif (TestBrowser == "firefox"):
        BrowserFactry.LaunchFirefox()
    elif (TestBrowser == 'edge'):
        BrowserFactry.LaunchEdge()
    else:
        Log.Message("No Test Browser Found...")
        Runner.Stop()

    return GetPageObject() if (Waiter.WaitTillDocumentReady()) else None
Beispiel #11
0
def add_objects_to_game():
    global objectslist
    map = constants.REST
    for y in range(0, 10):
        for x in range(0, 10):
            if map[y][x] == 1:
                objectslist.append(Table(x, y))
    map = constants.BANANA
    for y in range(0, 10):
        for x in range(0, 10):
            if map[y][x] == 1:
                objectslist.append(banana.Banana(x, y))
    global waiter
    waiter = Waiter.Waiter(1, 1, 0, objectslist)
    objectslist.append(waiter)
def NavigateToSystemUserPage():
    LoginSteps.LoginWithValidInput()

    WebObjAdmin = Users.Admin()
    WebObjUsrMgmt = Users.UserManagement()

    WebObjAdmin.Click()
    WebObjUsrMgmt.Click()
    Waiter.Wait(5)
    strPageUrl = BrowserFactry.GetPageUrl()

    Logger.CheckPoint('Navigate To Sytem User Page Successfully: ' +
                      strPageUrl) if (
                          aqString.Find(strPageUrl, 'viewSystemUsers') != -1
                      ) else Log.Error('Navigate To Sytem User Page Failed: ' +
                                       strPageUrl)
 def login(self):
     print(self.username.get(), self.password.get())
     username = self.username.get()
     password = self.password.get()
     if username == 'admin' and password == 'admin':
         self.destroy()
         self = Admin.Admin_page()
     elif username == 'chef' and password == 'chef':
         self.destroy()
         self = Chef.Chef_page()
     elif username == 'waiter' and password == 'waiter':
         # Get Data from database
         self.destroy()
         self = Waiter.Waiter_page(username)
         #s = Customer.Customer_page(username,password)
     else:
         tmsg.showinfo("Error", "Wrong Username or password")
Beispiel #14
0
def add_objects_to_game():
    global objectslist
    map = placeTables.geneticAlgorithm(stoly=10,
                                       n_populacja=200,
                                       eliteSize=20,
                                       mutationRate=0.02,
                                       generations=200).totable()
    for y in range(0, 10):
        for x in range(0, 10):
            if map[y][x] == 1:
                objectslist.append(Table(x, y))
    map = constants.BANANA
    for y in range(0, 10):
        for x in range(0, 10):
            if map[y][x] == 1:
                objectslist.append(banana.Banana(x, y))
    global waiter
    waiter = Waiter.Waiter(1, 1, 0, objectslist)
    objectslist.append(waiter)
Beispiel #15
0
"""Main entrypoint of the Python-based SOAP webapp

Here, all required parts of the app are "hooked in". Adapt this file if you
want to add new services to this app.
"""
import logging
from spyne.server.wsgi import WsgiApplication
from spyne.util.wsgi_wrapper import WsgiMounter

import Waiter

logging.basicConfig(level=logging.INFO)

# We use the wsgi mounter to hook up potentially more than one SOAP service
# inside a single app.
application = WsgiMounter(
    {Waiter.SERVICENAME: WsgiApplication(Waiter.create_app())})

if __name__ == '__main__':
    # Only for debugging! (Will start the app in a simple Python thread
    # without nginx or uwsgi when main.py is directly executed.)
    from wsgiref.simple_server import make_server
    logging.basicConfig(level=logging.INFO)

    server = make_server('0.0.0.0', 5000, application)
    server.serve_forever()
Beispiel #16
0
# star=aStar.aStar([4,6,0,0,0,""],[6,6,0,0,0,""])
# print("WYNIK")
# result=star.astar()
# result2= result.parent
# order=[]
# while True:
#     order=[result.name[5]]+order
#     result=result.parent
#     if result.parent is None:
#         break
# print(result2)
# print(order)
# class elo():
#     i=5
#     c=3
#
# zd=xd= elo()
# zd.i=10
# print(zd.i , " ", xd.i)


waiter = Waiter.Waiter(1, 1, 1)
print(waiter)
waiter.ordersqueue.put("FORWARD")
waiter.ordersqueue.put("FORWARD")
waiter.ordersqueue.put("FORWARD")
waiter.do()
print(waiter)
waiter.do()
print(waiter)
Beispiel #17
0
    def exit(self):
	global Master
        Master.destroy()
        Waiter.closeAndExit()
Beispiel #18
0
def RefreshPage():
    GetPageObject().Keys("[F5]")
    return GetPageObject() if (Waiter.WaitTillDocumentReady()) else None