Exemple #1
0
    def loadHumanEventsAol(self):        
#         completo el formulario de login
        ax = RouteAxis()
        ax.to_url = re.compile(re.escape('https://my.screenname.aol.com')+'.*')
        ax.from_url = ''
        she = SecuencedHumanEvent()
        she.writeText('*****@*****.**')
#         she.writeText('*****@*****.**')
        he = KeyboardHumanEvent.pressTabForward()
        she.pushHumanEvent(he)
        she.writeText('peteco')
#         she.writeText('Petec0')
        he = MouseHumanEvent.doHardClickMouse("input[id='submitID']")
        she.pushHumanEvent(he)        
        self.navigator.setAxis(ax,she)
        
#         si me dice que mi navegador es viejo voy a clasic mail
        ax = RouteAxis()
        ax.from_url = 'http://mail.aol.com/33490-311/aol-6/en-us/Suite.aspx'
        ax.to_url = 'http://phoenix.aol.com/main' 
        she = SecuencedHumanEvent()
        he = MouseHumanEvent.moveMouseTo("a[href$='switchToWebsuite']",'AOL Mail Classic')
        she.pushHumanEvent(he)
        he = MouseHumanEvent.clickMouse()
        she.pushHumanEvent(he)
        self.navigator.setAxis(ax,she)
        
#         voy a basic view
        ax = RouteAxis()
        ax.from_url = 'http://mail.aol.com/33490-311/aol-6/en-us/Suite.aspx'
        ax.to_url = 'http://mail.aol.com/33490-311/aol-6/en-us/Suite.aspx'
        she = SecuencedHumanEvent()
        he = MouseHumanEvent.moveMouseTo("a[href$='Today.aspx']",'Basic Version')
        she.pushHumanEvent(he)
        he = MouseHumanEvent.clickMouse()
        she.pushHumanEvent(he)
        self.navigator.setAxis(ax,she)
        
#         voy a spam
        ax = RouteAxis()
        ax.from_url = 'http://mail.aol.com/33490-311/aol-6/en-us/Suite.aspx'
        ax.to_url = 'http://mail.aol.com/33490-311/aol-6/en-us/Lite/Today.aspx'
        she = SecuencedHumanEvent()
        he = MouseHumanEvent.moveMouseTo('span','Spam')
        she.pushHumanEvent(he)
        he = MouseHumanEvent.clickMouse()
        she.pushHumanEvent(he)
        self.navigator.setAxis(ax,she)
        
#         clickeo el primer mail no leido
        ax = RouteAxis()
        ax.to_url = re.compile(re.escape('http://mail.aol.com/33490-311/aol-6/en-us/Lite/MsgList.aspx')+'.*')
        she = SecuencedHumanEvent()
        he = MouseHumanEvent.moveMouseTo("tr.row-unread td[id^='linkValue']")
        she.pushHumanEvent(he)
        he = MouseHumanEvent.clickMouse()
        she.pushHumanEvent(he)
        self.navigator.setAxis(ax,she)

        ax = RouteAxis()
        ax.from_url = 'http://mail.aol.com/33490-311/aol-6/en-us/Lite/MsgList.aspx'
        ax.to_url = re.compile(re.escape('http://mail.aol.com/33490-311/aol-6/en-us/Lite/MsgRead.aspx?folder=Spam') + '.*')
        ax.css_selector_condition = "div[class='removedImage'] a[class='wsLink']"
        she = SecuencedHumanEvent()
        he = MouseHumanEvent.moveMouseTo("a[class='wsLink']",'Show')
        she.pushHumanEvent(he)
        he = MouseHumanEvent.clickMouse()
        she.pushHumanEvent(he)
        self.navigator.setAxis(ax,she)
        
        ax = RouteAxis()
        ax.from_url = re.compile(re.escape('http://mail.aol.com/33490-311/aol-6/en-us/Lite/MsgRead.aspx?folder=Spam') + '.*')
        ax.to_url = re.compile(re.escape('http://mail.aol.com/33490-311/aol-6/en-us/Lite/MsgRead.aspx?folder=Spam') + '.*')
        she = SecuencedHumanEvent()
        he = MouseHumanEvent.moveMouseTo("input[value='Not Spam']")
        she.pushHumanEvent(he)
        he = MouseHumanEvent.clickMouse()
        she.pushHumanEvent(he)
        self.navigator.setAxis(ax,she)
        
# #         #hago que haga click en un mail
#         ax = RouteAxis()
#         ax.from_url = 'http://mail.aol.com/33490-311/aol-6/en-us/Suite.aspx'
#         ax.to_url = 'http://mail.aol.com/33490-311/aol-6/en-us/Suite.aspx'
#         ax.css_selector_condition = """div[class='navItemCurrent'] div[class='text'] span"""
#         she = SecuencedHumanEvent()
#         he = MouseHumanEvent.moveMouseTo('div[class="dojoxGrid-row]:not(.row-read)"')
#         she.pushHumanEvent(he)
#         self.navigator.setAxis(ax,she)
        
        self.view.load(QUrl('http://mail.aol.com'))