def run():

    result = False

    # TODO, ideally, it should be something like
    # ApplicationFactory.create("libreoffice")
    # The factory has the responsibility to decide the platform
    lo = ApplicationFactory.create("libreoffice", "sled11", "gnome")

    lo.loCloseWindow()

    sleep(1)

    DOC = settings.TESTDATAPATH + os.sep + "libreoffice" + os.sep + "test-fr.odt"  # script directory

    lo.loLaunchMax(DOC)

    wait(2)

    try:
        find(Pattern("1377573392284.png").similar(0.90))
        find(Pattern("1378888426114.png").similar(0.93))
        result = True
    except FindFailed:
        result = False

    lo.loCloseWindow()

    return result
Exemplo n.º 2
0
def testEvinceFind(file_name, keyword):

    ret = False

    evince = ApplicationFactory.create("evince", "opensuse123", "gnome")

    # old snippet
    # app = loadApp()
    # openFile(app, file_name)

    # reg = app.window()

    # click(Evince.MENU_EDIT)
    # click("1377160293615.png")
    # type(keyword)

    # isVanish = waitVanish("1377160477858.png",10)

    # if isVanish:
    #     if exists("1377161046584.png"):
    #         ret = Evince.PASS

    # app.close()

    return ret
def run():

    result =  False

    lo = ApplicationFactory.create("libreoffice", "sled11", "gnome")

    lo.loCloseWindow()

    sleep(3)

    DOC = settings.TESTDATAPATH + os.sep + "libreoffice" + os.sep + "test-fr.odt" # script directory
    
    lo.loLaunchMax(DOC)

    type(Key.HOME, Key.CTRL)
    type(Key.F7, Key.CTRL)

    try:
        find(Pattern("1377508139965.png").similar(0.90))
        type(Key.ENTER)
        find("1377566544897.png")        
        result = True
    except FindFailed:
        result = False

    lo.loCloseWindow()

    return result
Exemplo n.º 4
0
def testEvinceToolbar():

    ret = False

    evince = ApplicationFactory.create("evince", "opensuse123", "gnome")

    # implement test case here

    return ret
Exemplo n.º 5
0
def testEvinceView(file_name):

    ret = False

    evince = ApplicationFactory.create("evince", "opensuse123", "gnome")

    # implement test case here
    
    return ret
Exemplo n.º 6
0
def testEvinceView(file_name):

    ret = False

    evince = ApplicationFactory.create("evince", "opensuse123", "gnome")

    # implement test case here

    return ret
Exemplo n.º 7
0
def testEvinceToolbar():

    ret = False

    evince = ApplicationFactory.create("evince", "opensuse123", "gnome")

    # implement test case here
    
    return ret
Exemplo n.º 8
0
def testEvinceOpenFile(app_name, file_name):

    ret = False

    evince = ApplicationFactory.create("evince", "opensuse123", "gnome")    
    # old snippet
    # openFile(app, file_name)
    # reg = app.window()

    # if reg.exists("1377762212876.png"):
    #     ret = Evince.PASS
    # app.close()
    return ret
def run():

    result = False

    lo = ApplicationFactory.create("libreoffice", "sled11", "gnome")

    lo.loCloseWindow()

    sleep(3)

    lo.loLaunchMax()

    if exists(lo.LO_STARTUP_SCREEN):
        click(lo.LO_STARTUP_SCREEN_WRITER)

    sleep(1)

    type("T", Key.ALT)
    type("O", Key.ALT)
    sleep(1)
    doubleClick("1377240557411.png")
    wait("1377240608259.png")

    for i in range(12):
        type(Key.DOWN)

    wait("1377240996427.png")

    for i in range(4):
        type(Key.TAB)

    type("smtp.gmail.com")

    for i in range(4):
        type(Key.TAB)

    type(Key.SPACE)

    wait(Pattern("1377500254667.png").similar(0.90))

    try:
        find(Pattern("1377241409683.png").similar(0.90))
        result = True
    except FindFailed:
        result = False

    lo.loCloseWindow()
    return result
Exemplo n.º 10
0
def run():

    result =  False

    lo = ApplicationFactory.create("libreoffice", "sled11", "gnome")

    lo.loCloseWindow()

    sleep(3)
    
    lo.loLaunchMax()
    
    if exists(lo.LO_STARTUP_SCREEN):
        click(lo.LO_STARTUP_SCREEN_WRITER)    

    sleep(1)
    
    type("T", Key.ALT )
    type("O", Key.ALT )
    sleep(1)    
    doubleClick("1377240557411.png")
    wait("1377240608259.png")
    
    for i in range(12):
        type(Key.DOWN)

    wait("1377240996427.png")
    
    for i in range(4):
        type(Key.TAB)
        
    type("smtp.gmail.com")
    
    for i in range(4):
        type(Key.TAB)
        
    type(Key.SPACE)

    wait(Pattern("1377500254667.png").similar(0.90))

    try: 
        find(Pattern("1377241409683.png").similar(0.90))
        result = True
    except FindFailed:
        result = False
    
    lo.loCloseWindow()
    return result
Exemplo n.º 11
0
def run():

    result = False

    lo = ApplicationFactory.create("libreoffice", "sled11", "gnome")

    lo.loCloseWindow()

    sleep(3)

    DOC = settings.TESTDATAPATH + os.sep + "libreoffice" + os.sep + "data0.odb"  # script directory
    lo.loLaunchMax(DOC)

    try:
        click("1378372781588.png")
        doubleClick("1378372843380.png")

        wait("1378372980533.png", 10)

        type(Key.F4, Key.ALT)
        wait(2)
        lo.loCloseWindow()

        wait(5)

        lo.loLaunchMax(DOC)

        click("1378372781588.png")

        #create a new report by using Design View
        click("1378373516997.png")

        wait("1378373557102.png")

        doubleClick("1378373787308.png")
        doubleClick("1378373810164.png")
        type(Key.F4, Key.ALT)
        wait(1)
        type("s", Key.CTRL)
        wait(1)
        click(lo.LO_BUTTON_SAVE)
        wait(1)
        type(Key.F4, Key.ALT)
        wait(1)

        #reg acts as an image for result computing and a button to click
        reg = "1378449304604.png"
        find(reg)
        performDelete(reg)
        #end

        #use Wizard to create a new report
        click("1378449600484.png")
        wait("1378449675902.png")
        click("1378449705861.png")
        click(lo.LO_BUTTON_FINISH)

        wait("1378449823380.png", 10)
        type(Key.F4, Key.ALT)
        wait(1)

        #reg acts as an image for result computing and a button to click
        reg = "1378449993668.png"
        find(reg)
        performDelete(reg)
        #end

        result = True

    except FindFailed:
        result = False

    lo.loCloseWindow()

    return result
def run():

    result = False

    logger = logging.getLogger("MyLogger")
    ch = logging.StreamHandler(sys.stdout)
    ch.setLevel(logging.DEBUG)
    formatter = logging.Formatter(
        '%(asctime)s - %(name)s - %(levelname)s - %(message)s')
    ch.setFormatter(formatter)
    logger.addHandler(ch)

    lo = ApplicationFactory.create("libreoffice", "sled11", "gnome")

    lo.loCloseWindow()
    sleep(3)

    lo.loLaunchMax()

    #Test Case 1029917
    try:
        if exists(lo.LO_STARTUP_SCREEN):
            click(lo.LO_STARTUP_SCREEN_WRITER)

        wait(3)

        G_Button = "1378454718539.png"

        Thumb = "1378454775171.png"
        Image = "1378455608069.png"

        if not exists(Thumb):
            click(G_Button)
        rightClick(Thumb)
        wait(1)

        wait(Pattern("1378454993460.png").similar(0.50), 10)  #vp3
        logger.info('vp3 done')

        #insert copy
        type(Key.DOWN)
        type(Key.RIGHT)
        type(Key.ENTER)
        wait(1)
        click(Thumb)
        type(Key.F4, Key.ALT)
        wait(2)
        find(Image)

        click(Image)
        type(Key.DELETE)  #vp4 end
        logger.info('vp4 done')

        wait(1)

        if not exists(Thumb):
            click(G_Button)
        rightClick(Thumb)  #vp5 begin
        wait(1)
        #insert link
        type(Key.DOWN)
        type(Key.RIGHT)
        type(Key.DOWN)
        type(Key.ENTER)
        wait(1)
        click(Thumb)
        type(Key.F4, Key.ALT)
        wait(2)
        find(Image)
        click(Image)
        type(Key.DELETE)
        logger.info('vp5 done')

        #vp5 end

        wait(1)
        if not exists(Thumb):
            click(G_Button)
        rightClick(Thumb)  #vp6 begin
        wait(1)
        #insert background page
        type(Key.DOWN)
        type(Key.RIGHT)
        type(Key.DOWN)
        type(Key.DOWN)
        type(Key.RIGHT)
        type(Key.ENTER)
        wait(1)
        click(Thumb)
        type(Key.F4, Key.ALT)
        wait(2)
        find(Image)
        type("z", Key.CTRL)
        logger.info('vp6 done')

        #vp6 end

        wait(1)
        '''
        #vp7
        #insert background paragraph
        #first type a simple paragraph

        #issue here.  type(Key.SHIFT, Key.ENTER) can't input Shift + Enter
        for i in range(15):
            type('s')
            type(Key.SHIFT, Key.ENTER)

        if not exists(Thumb):
            click(G_Button)
        rightClick(Thumb)
        wait(1)
        #insert background page
        type(Key.DOWN)
        type(Key.RIGHT)
        type(Key.DOWN)
        type(Key.DOWN)
        type(Key.RIGHT)
        type(Key.DOWN)
        type(Key.ENTER)
        wait(1)
        click(Thumb)
        type(Key.F4, Key.ALT)
        wait(2)
        find(Image)
        '''

        result = True

    except FindFailed:
        pass

    lo.loCloseWindow()
    return result
Exemplo n.º 13
0
def run():

    result =  False

    lo = ApplicationFactory.create("libreoffice", "sled11", "gnome")

    lo.loCloseWindow()

    sleep(3)

    DOC = settings.TESTDATAPATH + os.sep + "libreoffice" + os.sep + "test-fr.odt" # script directory
    
    lo.loLaunchMax(DOC)
   
    try:
        # open the Hyphenation Dialog
        type(Key.HOME, Key.CTRL)
        type("T", Key.ALT)
        type(Key.DOWN)
        type(Key.RIGHT)
        type(Key.DOWN)
        type(Key.DOWN)
        type(Key.DOWN)
        type(Key.DOWN)
        type(Key.ENTER)

        wait(1)

        # Hyphenate all
        type("A", Key.ALT)
        find("1377568829826.png")
        type(Key.ENTER)
        find(Pattern("1377568871362.png").similar(0.90))
        find(Pattern("1377568881786.png").similar(0.90))
        type(Key.END, Key.CTRL)
        find(Pattern("1377568924058.png").similar(0.90))
        find(Pattern("1377568932274.png").similar(0.90))

        # open the Hyphenation dialog
        type(Key.HOME, Key.CTRL)
        type("T", Key.ALT)
        type(Key.DOWN)
        type(Key.RIGHT)
        type(Key.DOWN)
        type(Key.DOWN)
        type(Key.DOWN)
        type(Key.DOWN)
        type(Key.ENTER)

        for i in range(10):
            type("R", Key.ALT)

        find("1377568829826.png")
        type(Key.ENTER)

        type(Key.HOME, Key.CTRL)           

        find(Pattern("1377570689899.png").similar(0.90))        
        find(Pattern("1377569447674.png").similar(0.90))
        find(Pattern("1377569414898.png").similar(0.90))
        
        type(Key.END, Key.CTRL)
        find(Pattern("1377570277402.png").similar(0.90))
       
        result = True
    except FindFailed:
        result = False

    lo.loCloseWindow()

    return result
def run():

    result = False

    lo = ApplicationFactory.create("libreoffice", "sled11", "gnome")

    lo.loCloseWindow()

    sleep(3)

    DOC = settings.TESTDATAPATH + os.sep + "libreoffice" + os.sep + "test-fr.odt"  # script directory

    lo.loLaunchMax(DOC)

    try:
        # open the Hyphenation Dialog
        type(Key.HOME, Key.CTRL)
        type("T", Key.ALT)
        type(Key.DOWN)
        type(Key.RIGHT)
        type(Key.DOWN)
        type(Key.DOWN)
        type(Key.DOWN)
        type(Key.DOWN)
        type(Key.ENTER)

        wait(1)

        # Hyphenate all
        type("A", Key.ALT)
        find("1377568829826.png")
        type(Key.ENTER)
        find(Pattern("1377568871362.png").similar(0.90))
        find(Pattern("1377568881786.png").similar(0.90))
        type(Key.END, Key.CTRL)
        find(Pattern("1377568924058.png").similar(0.90))
        find(Pattern("1377568932274.png").similar(0.90))

        # open the Hyphenation dialog
        type(Key.HOME, Key.CTRL)
        type("T", Key.ALT)
        type(Key.DOWN)
        type(Key.RIGHT)
        type(Key.DOWN)
        type(Key.DOWN)
        type(Key.DOWN)
        type(Key.DOWN)
        type(Key.ENTER)

        for i in range(10):
            type("R", Key.ALT)

        find("1377568829826.png")
        type(Key.ENTER)

        type(Key.HOME, Key.CTRL)

        find(Pattern("1377570689899.png").similar(0.90))
        find(Pattern("1377569447674.png").similar(0.90))
        find(Pattern("1377569414898.png").similar(0.90))

        type(Key.END, Key.CTRL)
        find(Pattern("1377570277402.png").similar(0.90))

        result = True
    except FindFailed:
        result = False

    lo.loCloseWindow()

    return result
def run():

    result =  False

    logger = logging.getLogger("MyLogger")
    ch = logging.StreamHandler(sys.stdout)
    ch.setLevel(logging.DEBUG)
    formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
    ch.setFormatter(formatter)
    logger.addHandler(ch)

    lo = ApplicationFactory.create("libreoffice", "sled11", "gnome")

    lo.loCloseWindow()
    sleep(3)

    lo.loLaunchMax()

    #Test Case 1029917
    try:
        if exists(lo.LO_STARTUP_SCREEN):
            click(lo.LO_STARTUP_SCREEN_WRITER)

        wait(3)

        G_Button = "1378454718539.png"

        Thumb = "1378454775171.png"
        Image = "1378455608069.png"

        if not exists(Thumb):
            click(G_Button)
        rightClick(Thumb)
        wait(1)

        wait(Pattern("1378454993460.png").similar(0.50),10) #vp3
        logger.info('vp3 done')


        #insert copy
        type(Key.DOWN)
        type(Key.RIGHT)
        type(Key.ENTER)
        wait(1)
        click(Thumb)
        type(Key.F4, Key.ALT)
        wait(2)
        find(Image) 

        click(Image)
        type(Key.DELETE) #vp4 end
        logger.info('vp4 done')

        wait(1)

        if not exists(Thumb):
            click(G_Button)
        rightClick(Thumb) #vp5 begin
        wait(1)
        #insert link
        type(Key.DOWN)
        type(Key.RIGHT)
        type(Key.DOWN)
        type(Key.ENTER)
        wait(1)
        click(Thumb)
        type(Key.F4, Key.ALT)
        wait(2)
        find(Image)
        click(Image)
        type(Key.DELETE) 
        logger.info('vp5 done')

        #vp5 end
        
        wait(1)
        if not exists(Thumb):
            click(G_Button)
        rightClick(Thumb) #vp6 begin
        wait(1)
        #insert background page
        type(Key.DOWN)
        type(Key.RIGHT)
        type(Key.DOWN)
        type(Key.DOWN)
        type(Key.RIGHT)
        type(Key.ENTER)
        wait(1)
        click(Thumb)
        type(Key.F4, Key.ALT)
        wait(2)
        find(Image)
        type("z", Key.CTRL)
        logger.info('vp6 done')

        #vp6 end
        
        wait(1)
        
        '''
        #vp7
        #insert background paragraph
        #first type a simple paragraph

        #issue here.  type(Key.SHIFT, Key.ENTER) can't input Shift + Enter
        for i in range(15):
            type('s')
            type(Key.SHIFT, Key.ENTER)

        if not exists(Thumb):
            click(G_Button)
        rightClick(Thumb)
        wait(1)
        #insert background page
        type(Key.DOWN)
        type(Key.RIGHT)
        type(Key.DOWN)
        type(Key.DOWN)
        type(Key.RIGHT)
        type(Key.DOWN)
        type(Key.ENTER)
        wait(1)
        click(Thumb)
        type(Key.F4, Key.ALT)
        wait(2)
        find(Image)
        '''

        result = True

    except FindFailed:
        pass

    lo.loCloseWindow()
    return result