コード例 #1
0
ファイル: test_template.py プロジェクト: drptbl/nightwatch-2
def yourtest():
    this = nightwatch_utils.driver(driver_path)  #This should always be present

    #start your commands here
    #each command requires specific arguments that need to get passed in. For the most part, you'll need to use 'this' as an argument. Refer to commands.py to see what objects are returned
    browser.getURL(this, 'http://www.yourtestsite.com')
    browser.quit()  #Each test should quit the browser.
コード例 #2
0
ファイル: parser.py プロジェクト: shaheermirzacs/Budgeteer
def parse(commands):

    _command = commands[0]

    if _command == 'help':  # Done
        command.help()
    elif _command == 'add':  # Done
        command.add(commands[1:])
    elif _command == 'display':  # All done
        # TODO: Date
        # sort [date|cost]
        command.display()
    elif _command == 'delete':  # Done
        command.delete(commands[1])
    elif _command == 'find':  # TODO
        if len(commands) == 1:
            print('please enter criteria')
            return True

        command.find(commands[1:])
    elif _command == 'clear':
        command.clear()
    elif _command == 'quit':  # Done
        command.quit()
        return False

    return True
コード例 #3
0
ファイル: test_template.py プロジェクト: drptbl/nightwatch-2
def yourtest():
    this = nightwatch_utils.driver(driver_path) #This should always be present

    #start your commands here
    #each command requires specific arguments that need to get passed in. For the most part, you'll need to use 'this' as an argument. Refer to commands.py to see what objects are returned
    browser.getURL(this, 'http://www.yourtestsite.com')
    browser.quit() #Each test should quit the browser.
コード例 #4
0
ファイル: google.py プロジェクト: drptbl/nightwatch-2
def googletest():
    this = nightwatch_utils.driver(driver_path)

    browser.getURL(this, 'http://www.google.com')
    browser.refresh(this)
    browser.assertElementPresent(this, 'body')
    browser.clickClearAndType(this, '#lst-ib', 'automated testing')
    browser.clickRetry(this, '.lsb[value="Search"]')
    browser.pause(5)  # pause for 5 seconds
    browser.snapshot(this, 'google-results.png')
    browser.quit(this)
コード例 #5
0
ファイル: yelp.py プロジェクト: drptbl/nightwatch-2
def yelptest():
    this = nightwatch_utils.driver(driver_path) #This should always be present

    #start your commands here
    browser.getURL(this, 'http://www.yelp.com')
    browser.assertElementPresent(this,'body')
    browser.assertElementPresent(this,'#find_desc[name=find_desc]')
    browser.clickClearAndType(this, '#find_desc[name=find_desc]', 'sushi')
    browser.clickRetry(this,'#header-search-submit[title=Search]')
    browser.pause(5) # pause for 5 seconds
    browser.snapshot(this,'yelp-results.png')
    browser.quit(this)
コード例 #6
0
def quit_app(data=None):
    Gtk.main_quit()
    commands.quit()
コード例 #7
0
        run = False
else:
    run = bf.ask_to_play()

while run:
    command = input(
        'What would you like to do? Type help for options. ').lower()

    if command == 'help':
        commands.help()

    elif command == 'give':
        hotbar = commands.give(hotbar)

    elif command == 'quit':
        run = commands.quit()

    elif command == 'remove':
        hotbar = commands.remove(hotbar)

    elif command == 'see':
        for s in hotbar:
            print(s)

    elif command == 'add':
        hotbar = commands.add(hotbar)

    elif command == 'creeper':
        aww = 'AWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW'
        man = 'MANNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN'
        print(f'{aww}\n{man}!!!!!!!!')
コード例 #8
0
def end():
    browser.quit(this)
    return this