• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python mslib.wait_for_element_present函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中mslib.wait_for_element_present函数的典型用法代码示例。如果您正苦于以下问题:Python wait_for_element_present函数的具体用法?Python wait_for_element_present怎么用?Python wait_for_element_present使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了wait_for_element_present函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: starter_dialog_translate_from_not_orig

def starter_dialog_translate_from_not_orig(self,sel,from_lang,to_lang='hr'):
    """Choose the a new translation and translate from a sub that is not the orig lang.
    Return from_lang

    This assumes you know the original language and want to edit the original subs.

    Post-condition: the widget is launched and you will be on step 1 or Edit step
    """
    #Figure out orig lang fail is there isn't a set lang already
    mslib.wait_for_text_present(self,sel,"This video")
    if sel.is_element_present(testvars.create_lang_unknown):
        self.fail("can't make a new translation when video has no orig lang set - test is invalid")
    else:
        ol = sel.get_text(testvars.create_lang_known)
        orig_lang = ol.split("in ")[1]
        lc = sel.get_value("css=select.to-language option:contains('"+orig_lang+" ')")
        lang_code = re.sub("\d+$","",lc)
    if lang_code == from_lang:
        self.fail("invalid test - from lang "+str(from_lang)+" is the same as the origi lang"+str(orig_lang))
        
    select_video_language(self,sel,sub_lang=to_lang,from_lang=from_lang)
    time.sleep(5)
    close_howto_video(self,sel)
    mslib.wait_for_element_present(self,sel,"css=.unisubs-help-heading")
    return from_lang
开发者ID:pculture,项目名称:unisubs-testing,代码行数:25,代码来源:widget.py


示例2: test_537

    def test_537(self):
        """Add comments on a translation using non-ascii characters
        
        http://litmus.pculture.org/show_test.cgi?id=537
        """
        
        sel = self.selenium
        sel.set_timeout(testvars.MSTestVariables["TimeOut"])
        #get a video and open page      
        website.SiteLogout(self,sel)
        test_video_url = website.get_video_with_translations(self,sel)
        print test_video_url
        sel.open(test_video_url)
        language = website.get_translated_lang(self,sel)
        
        
        #Login and go to language comments page
        website.SiteLogIn(self,sel,testvars.siteuser,testvars.passw)
        sel.open(test_video_url)
        mslib.wait_for_element_present(self,sel,testvars.video_lang+":contains('"+language+"')")
        sel.click(testvars.video_lang+":contains('"+language+"')")
        mslib.wait_for_element_present(self,sel,testvars.video_lang_hd+":contains('"+language+"')")
        sel.click(testvars.comments_tab) 

        #Enter some non-ascii comments
        print "1. entering croatian comment text"
        website.enter_comment_text(self,sel,comments_text.hr_comment_text)
        website.verify_comment_text(self,sel,comments_text.hr_comment_text)
        print "2. entering japanese comment text"
        website.enter_comment_text(self,sel,comments_text.jp_comment_text)
        website.verify_comment_text(self,sel,comments_text.jp_comment_text)
        print "3. entering russian comment text"
        website.enter_comment_text(self,sel,comments_text.ru_comment_text)
        website.verify_comment_text(self,sel,comments_text.ru_comment_text)
开发者ID:pculture,项目名称:unisubs-testing,代码行数:34,代码来源:sg_80_comments.py


示例3: SiteLogout

def SiteLogout(self,sel):
    """
    Description: Logout of site using site Logout button.

    """
    sel.open("/logout/?next=/")
    mslib.wait_for_element_present(self,sel,testvars.WebsiteUI["Login_Button"])
开发者ID:pculture,项目名称:unisubs-testing,代码行数:7,代码来源:website.py


示例4: Login

def Login(self,sel,auth_type):
    """
    Description: Log on using website button and select an external login option.
    auth_type can be either 'twitter', 'open-id', or 'google'

    Requires: valid account for selected login.  See testvars for existing accounts.

    Pre-condition: user is on the site page
    
    Post-condition: offsite login form displayed, see offsite
    
    
    """
    # auth_type can be either ".twitter", ".open-id", "google"
    if auth_type == "twitter":
        auth_link = "css=a#twitter.provider"
    elif auth_type == "open-id":
        auth_link = "css=a#open-id.provider"
    elif auth_type == "google":
        auth_link = "css=a#google.provider"
    else:
        self.fail("unrecognized auth type")
    sel.select_window("null")
    mslib.wait_for_element_present(self,sel,testvars.WebsiteUI["Login_Button"])
    sel.click(testvars.WebsiteUI["Login_Button"])
    mslib.wait_for_element_present(self,sel,auth_link)
    sel.click(auth_link)
    sel.wait_for_page_to_load(testvars.MSTestVariables["TimeOut"])
开发者ID:pculture,项目名称:unisubs-testing,代码行数:28,代码来源:website.py


示例5: edit_translation

def edit_translation(self,sel,subtextfile,new_text=""):
    """
    Description: Update the translation text with either the orig text or text provided in a file.

    Options:
        new_text - text string

    Pre-condition - Editing Translation Widget opened
    """
    print ("Editing the translation")
    sel.select_window("null")
    mslib.wait_for_element_present(self,sel,"css=.unisubs-titlesList")
    for i,line in enumerate(codecs.open(subtextfile)):
        x = i+1
        sub_cell = "css=.unisubs-titlesList li:nth-child("+str(x)+")"
        if sel.is_element_present(sub_cell) == False:
            break
        thetextarea = "css=textarea"
        if new_text == "":
            ed_text = str(line).upper()
        else:
            ed_text = new_text
        sel.click(sub_cell)
        sel.type(thetextarea, u'ed_text')
        sel.get_eval("this.browserbot.getUserWindow().unisubs.widget.fireKeySequence(this.browserbot.getUserWindow().document.getElementsByClassName('unisubs-subedit')[0], 13,13);") 
        time.sleep(1)
    sel.click(testvars.WidgetUI["Next_step"])
开发者ID:pculture,项目名称:unisubs-testing,代码行数:27,代码来源:widget.py


示例6: starter_dialog_translate_from_orig

def starter_dialog_translate_from_orig(self,sel,to_lang='hr'):
    """Choose the a new translation and translate from original lang
    Return orig_lang

    This assumes you know the original language and want to edit the original subs.

    Post-condition: the widget is launched and you will be on step 1 or Edit step
    """
    #Figure out orig lang fail is there isn't a set lang already
    mslib.wait_for_text_present(self,sel,"This video")
    sel.select_frame("relative=top")
    if sel.is_element_present(testvars.create_lang_unknown):
        self.fail("can't make a new translation when video has no orig lang set - test is invalid")
    else:
        time.sleep(5)
        ol = sel.get_text(testvars.create_lang_known)
        orig_lang = ol.split("in ")[1]
        if not sel.is_element_present("css=select.from-language option:contains('"+orig_lang+" ')"):
            print "orig lang not transcribed - choosing other existing lang"
            lc = sel.get_value("css=select.from-language option")
        else:
            lc = sel.get_value("css=select.from-language option:contains('"+orig_lang+" ')")
        lang_code = re.sub("\d+$","",lc) #gives only the letters of the value field.
        from_code = re.sub("\D","",lc)  #gives only the number - used in from pulldown.
        select_video_language(self,sel,sub_lang=to_lang,from_lang=from_code)
        time.sleep(5)
        close_howto_video(self,sel)
        mslib.wait_for_element_present(self,sel,"css=div.unisubs-help-heading")
        return orig_lang
开发者ID:pculture,项目名称:unisubs-testing,代码行数:29,代码来源:widget.py


示例7: test_691

 def test_691(self):
     """Pagedemo New York Times video 1 - forked the subs and create a fresh set of captions in hr lang.
     
     http://litmus.pculture.org/show_test.cgi?id=691
     """
     test_id = 691
     sel = self.selenium
     testpage = "/pagedemo/nytimes_youtube_embed"
     subtextfile = os.path.join(testvars.MSTestVariables["DataDirectory"],"OctopusGarden.txt")
     sel.open(testpage)
     sel.wait_for_page_to_load(testvars.timeout)
     sel.window_maximize()
     mslib.wait_for_element_present(self,sel,testvars.WebsiteUI["SubtitleMe_menu"])
     time.sleep(5)
     sel.get_eval('this.browserbot.getUserWindow().unisubs.widget.Widget.getAllWidgets()[0].openMenu()')
     widget.open_starter_dialog(self,sel)
     widget.starter_dialog_fork(self,sel,to_lang='hr')
     widget.transcribe_video(self, sel, subtextfile)
     widget.sync_video(self, sel, subtextfile)
     widget.site_login_from_widget_link(self,sel)
     #verify subs still present
     print "verifying subtitles are still present"
     sel.select_window("null")
     mslib.wait_for_element_present(self,sel,"css=.unisubs-titlesList")
     widget.verify_sub_text(self,sel,subtextfile)
     if sel.is_element_present("css=.unisubs-modal-login"): #Login
         sel.click("css=.unisubs-log")
         widget.site_login_auth(self,sel)
         sel.select_window("null")
     widget.submit_sub_edits(self,sel,offsite=True)
开发者ID:pculture,项目名称:unisubs-testing,代码行数:30,代码来源:sg_78_widget_pagedemo.py


示例8: test_741

 def test_741(self):
     """widgetizer on MC site html5 mp4.
     http://litmus.pculture.org/show_test.cgi?id=741
     Video with widget embedded on Miro Community test page.
     """
     print self.shortDescription()
     sel = self.selenium
     mc_page = "widgetizer_tests"
     test_page = selvars.set_unisubs_mc_page(self,mc_page)
     sel.open(test_page)
     sel.wait_for_page_to_load(testvars.timeout)
     mslib.wait_for_element_present(self, sel,"body#video_page div.unisubs-videoTab:nth-child(2) >  a.unisubs-subtitleMeLink span.unisubs-tabTextchoose")
     time.sleep(3)
     sel.get_eval('this.browserbot.getUserWindow().unisubs.widget.Widget.getAllWidgets()[1].openMenu()')
     time.sleep(2)
     if sel.is_element_present(testvars.WebsiteUI["AddSubtitles_menuitem"]) == True:
         print "has subtitles - edit and revert"
         subtextfile = "subs.txt"
         orig_rev = store_subs(self,sel)
         sel.open(test_page)
         sel.wait_for_page_to_load(testvars.timeout)
         mslib.wait_for_element_present(self,sel,testvars.WebsiteUI["SubtitleMe_menu"])
         time.sleep(3)
         sel.get_eval('this.browserbot.getUserWindow().unisubs.widget.Widget.getAllWidgets()[1].openMenu()')
         widget.starter_dialog_edit_orig(self,sel)
         edit_subs(self,sel,orig_rev,subtextfile)          
     else:
         make_new_subs(self,sel,subtextfile)
开发者ID:pculture,项目名称:unisubs-testing,代码行数:28,代码来源:sg_94_widgetizer.py


示例9: click_time_shift_arrows

def click_time_shift_arrows(self,sel,subtextfile):
    """
    Description: clicks the left and right arrows on subtitle text box.
    Verifies that the time has been changed by .05 seconds.

    Options:
        subtextfile - text used in transcribe step.
        
    """
    sub_li = 1
    sel.select_window("null")
    mslib.wait_for_element_present(self,sel,"css=.unisubs-activestep:contains('3')")
    mslib.wait_for_element_present(self,sel,testvars.WidgetUI["Sync_sub"])
    sub_cell_start_time = "css=li:nth-child("+str(sub_li)+") > .unisubs-timestamp span span.unisubs-timestamp-time"
    up_arrow = "css=li:nth-child("+str(sub_li)+") > .unisubs-timestamp span .unisubs-changeTime .unisubs-up"
    down_arrow = "css=li:nth-child("+str(sub_li)+") > .unisubs-timestamp span .unisubs-changeTime .unisubs-down"
    for x in range(0,3):  
        #Click up (right) and verify time jump of .05 seconds
        start_time = sel.get_text(sub_cell_start_time)
        sel.focus(up_arrow)
        sel.click_at(up_arrow,"")
        new_start_time = sel.get_text(sub_cell_start_time)
        self.assertAlmostEqual(mslib.calc_time_diff(start_time,new_start_time),float(.05),3)
        #maybe verify the pixel change on the timeline
    for x in range(0,3):
        #Click text-arrow right and verify time jump
        start_time = sel.get_text(sub_cell_start_time)
        sel.click_at(down_arrow,"")
        new_start_time = sel.get_text(sub_cell_start_time)
        self.assertAlmostEqual(mslib.calc_time_diff(new_start_time,start_time),float(.05),3)
开发者ID:pculture,项目名称:unisubs-testing,代码行数:30,代码来源:widget.py


示例10: test_689

    def test_689(self):
        """Pagedemo New York Times video 1 - edit original subs
        
        http://litmus.pculture.org/show_test.cgi?id=689
        """
        test_id = 689
        sel = self.selenium
        testpage = "/pagedemo/nytimes_youtube_embed"
        subtextfile = os.path.join(testvars.MSTestVariables["DataDirectory"],"OctopusGarden.txt")
        sel.open(testpage)
        sel.wait_for_page_to_load(testvars.timeout)
        sel.window_maximize()
        mslib.wait_for_element_present(self,sel,testvars.WebsiteUI["SubtitleMe_menu"])
        time.sleep(5)
        sel.get_eval('this.browserbot.getUserWindow().unisubs.widget.Widget.getAllWidgets()[0].openMenu()')
        widget.starter_dialog_edit_orig(self,sel)
        widget.goto_step(self,sel,step="2")
        widget.edit_text(self,sel,subtextfile)
        #Login

        if sel.is_element_present("css=div div.unisubs-needLogin a"):
            sel.click("css=div div.unisubs-needLogin a")
            mslib.wait_for_element_present(self,sel,"css=.unisubs-modal-login")
            sel.click("css=.unisubs-log")
            widget.site_login_auth(self,sel)
            sel.select_window("null")
        widget.submit_sub_edits(self,sel,offsite=True)
开发者ID:pculture,项目名称:unisubs-testing,代码行数:27,代码来源:sg_78_widget_pagedemo.py


示例11: test_623

 def test_623(self):
     """offsite widget on MC site.
     video url: http://www.youtube.com/watch?v=FNEImAIM4L4
     http://litmus.pculture.org/show_test.cgi?id=623
     Video with widget embedded on Miro Community test page.
     """
     mc_page = "hunter"
     vid_pos = "css=p.pElementTest span span.unisubs-widget div.unisubs-videoTab a span.unisubs-tabTextchoose"
     vid_title = "hunter.s.thompson.avi"
     print self.shortDescription()
     sel = self.selenium
     test_page = selvars.set_unisubs_mc_page(self, mc_page)
     sel.open(test_page)
     sel.wait_for_page_to_load(testvars.timeout)
     mslib.wait_for_element_present(self, sel, testvars.WebsiteUI["SubtitleMe_menu"])
     time.sleep(3)
     sel.get_eval("this.browserbot.getUserWindow().unisubs.widget.Widget.getAllWidgets()[0].openMenu()")
     time.sleep(2)
     if sel.is_element_present(testvars.WebsiteUI["AddSubtitles_menuitem"]) == True:
         print "has subtitles - edit and revert"
         subtextfile = "subs.txt"
         orig_rev = store_subs(self, sel)
         sel.open(test_page)
         sel.wait_for_page_to_load(testvars.timeout)
         mslib.wait_for_element_present(self, sel, testvars.WebsiteUI["SubtitleMe_menu"])
         time.sleep(3)
         sel.get_eval("this.browserbot.getUserWindow().unisubs.widget.Widget.getAllWidgets()[0].openMenu()")
         widget.starter_dialog_edit_orig(self, sel)
         edit_subs(self, sel, orig_rev, subtextfile)
     else:
         make_new_subs(self, sel, subtextfile)
开发者ID:pculture,项目名称:unisubs-testing,代码行数:31,代码来源:sg_78_widget_offsite.py


示例12: starter_dialog_edit_orig

def starter_dialog_edit_orig(self,sel):
    """Choose the current lang to edit.
    Return orig_lang

    Gets the videos orig lang to edit the original subs - or sets it to English if none set.

    Post-condition: the widget is launched and you will be on step 1.
    """
    
    #Figure our the original lang or choose your own
    orig_lang = "Original"
    time.sleep(5)
    if sel.is_element_present(testvars.WebsiteUI["AddSubtitles_menuitem"]):
        sel.click(testvars.WebsiteUI["AddSubtitles_menuitem"])
    time.sleep(15)
    if sel.is_element_present(testvars.create_lang_unknown): # No lang set, going to use English
        orig_lang = "English"
        select_video_language(self,sel,vid_lang='en',sub_lang='en')
    elif sel.is_element_present(testvars.create_lang_known):        
        ol = sel.get_text(testvars.create_lang_known)
        orig_lang = ol.split("in ")[1]
        print orig_lang
        lc = sel.get_value("css=select.to-language option:contains('"+orig_lang+"')")
        lang_code = re.sub("\d+$","",lc)
        select_video_language(self,sel,vid_lang=lang_code,sub_lang=lang_code)
    else:
        print "video opened directly - no lang select dialogs"
    time.sleep(10)
    close_howto_video(self,sel)
    mslib.wait_for_element_present(self,sel,"css=div.unisubs-help-heading")
    return orig_lang
开发者ID:pculture,项目名称:unisubs-testing,代码行数:31,代码来源:widget.py


示例13: test_737

    def test_737(self):
        """flowplayer offsite embed - subtitle and playback
 
        http://litmus.pculture.org/show_test.cgi?id=737
        Flowplayer with widget embedded on Miro Community test page.
        """
        mc_page = "embed_tests"
        vid_title = "flow player test"
        subtextfile = os.path.join(testvars.MSTestVariables["DataDirectory"], "737_flow.txt")
        print self.shortDescription()
        sel = self.selenium
        test_page = selvars.set_unisubs_mc_page(self, mc_page)
        sel.open(test_page)
        sel.wait_for_page_to_load(testvars.timeout)
        time.sleep(5)
        if sel.is_element_present(
            "css=p.other-flow div.unisubs-videoTab a.unisubs-subtitleMeLink span.unisubs-tabTextchoose:contains('Subtitle Me')"
        ):
            sel.click(
                "css=p.other-flow div.unisubs-videoTab a.unisubs-subtitleMeLink span.unisubs-tabTextchoose:contains('Subtitle Me')"
            )
        else:
            sel.get_eval("this.browserbot.getUserWindow().unisubs.widget.Widget.getAllWidgets()[5].openMenu()")
        make_new_subs(self, sel, subtextfile)
        # Playback Subs
        time.sleep(5)
        try:
            sel.get_eval("this.browserbot.getUserWindow().unisubs.widget.Widget.getAllWidgets()[5].play()")
            mslib.wait_for_element_present(self, sel, "css=p.other-flow span.unisubs-captionSpan")
            sel.get_eval("this.browserbot.getUserWindow().unisubs.widget.Widget.getAllWidgets()[5].pause()")
            caption_position = sel.get_element_height("css=p.other-flow span.unisubs-captionSpan")
            verify_caption_position(self, sel, caption_position)
        except:
            print "sub position playback failed"
            self.verificationErrors.append("sub playback / position test failed")
开发者ID:pculture,项目名称:unisubs-testing,代码行数:35,代码来源:sg_78_widget_offsite.py


示例14: back_step

def back_step(self,sel):
    """
    Description: Clicks the 'Back to' link to go back 1 step.
    """
    while sel.is_text_present("Back to Typing"):
        sel.click("link=Back to Typing")
        mslib.wait_for_element_present(self,sel,"css=.unisubs-activestep")
开发者ID:pculture,项目名称:unisubs-testing,代码行数:7,代码来源:widget.py


示例15: click_lang_tab

def click_lang_tab(self,sel,language):
    """Click on a lanugage tab.

    Assumes you are on the videos tab and know the lang you want.
    """
    mslib.wait_for_element_present(self,sel,testvars.video_lang+":contains('"+language+"')")
    sel.click(testvars.video_lang+":contains('"+language+"')")
    sel.wait_for_page_to_load(testvars.MSTestVariables["TimeOut"])
    self.failUnless(sel.is_element_present(testvars.video_lang_hd+":contains('"+language+"')"))
开发者ID:pculture,项目名称:unisubs-testing,代码行数:9,代码来源:website.py


示例16: test_613

    def test_613(self):
        """Submit a video and add to team.

        http://litmus.pculture.org/show_test.cgi?id=613.      
        """
        sel = self.selenium
        sel.set_timeout(testvars.timeout)
        #login
        website.SiteLogIn(self,sel,testvars.siteuser,testvars.passw)
        #create team
        team = "miro"+time.strftime("%m%d%H%M%S", time.gmtime())
        team_logo_path = os.path.join(testvars.MSTestVariables["DataDirectory"],"sheep.png")
        website.open_teams_page(self,sel)
        sel.click(testvars.start_team)
        sel.wait_for_page_to_load(testvars.timeout)
        website.create_team(self,sel,team,team_logo_path)
        
        #submit video
        sel.window_maximize()
        test_video_url = website.submit_random_youtube(self,sel)
        print test_video_url
        mslib.wait_for_element_present(self,sel,"css=span.sort_label strong:contains('Add video')")
        vid_title = sel.get_text(testvars.vid_title)
        #add video to team and verify values
        teamli = "add/video/"+team



                  
        sel.click(testvars.video_add_to_team)
##        sel.click_at("css=span.sort_label strong:contains('Add video')","")
        sel.click_at("css=a[href*='"+teamli+"']","")
        
        sel.wait_for_page_to_load(testvars.timeout)
        print "verifying the inital add page"

        if sel.is_element_present("css=.errorlist")== True:
            print "error adding video to team"
            self.fail()
        else:
            mslib.wait_for_text_present(self,sel,"Video language")
            sel.select("id_language", "value=en")
            sel.click(testvars.teams_save)
            sel.wait_for_page_to_load(testvars.timeout)
        self.assertTrue(sel.is_element_present("css=li.active a:contains('"+team+"')"))
        sel.click(testvars.teams_video_tab)
        sel.wait_for_page_to_load(testvars.timeout)
        print "verifying team videos list"
        self.assertTrue(sel.is_element_present("css=tr.video-container td a[href*='"+test_video_url+"info/']"),"test_video_url error")
#        self.assertTrue(sel.is_element_present("css=tr.video-container td:contains('"+vid_title[0:10]+"')"),"vid_title error")
        # delete the video from the team
        sel.click("css=td a:contains('"+vid_title[0:10]+"') +div +div +div.small.grey a.remove-video")
        self.failUnless(re.search(r"^Remove this video[\s\S]$", sel.get_confirmation()))

        # logout
        sel.click(testvars.WebsiteUI["Logout_Button"])
开发者ID:pculture,项目名称:unisubs-testing,代码行数:56,代码来源:sg_88_teams.py


示例17: get_diff_url

def get_diff_url(self,sel,rev_link):
    """Gets the url id of a revision for comparing.

    """
    sel.click(rev_link)
    mslib.wait_for_element_present(self,sel,"css=ul.breadcrumb li a:contains('Revision History')")
    d = sel.get_eval("window.location")
    diff_id = d.split('/')[-1]
    sel.click("css=ul.breadcrumb li a:contains('Revision History')")
    sel.wait_for_page_to_load(testvars.MSTestVariables["TimeOut"])
    return diff_id
开发者ID:pculture,项目名称:unisubs-testing,代码行数:11,代码来源:website.py


示例18: verify_login

def verify_login(self,sel,username="sub_writer"):
    """
    Description: Verifies user is logged in by finding the logout button on the
    website and then starting the demo and looking for logout menu item on the
    Subtitle Me button.

    Pre-Condition: must be logged into site.

    """
    mslib.wait_for_element_present(self,sel,"css=li[id=me_menu]")
    self.failUnless(sel.is_element_present("css=div[id=menu_name]:contains('"+username+"')"),\
                    "user not logged in, user_panel not displayed")
开发者ID:pculture,项目名称:unisubs-testing,代码行数:12,代码来源:website.py


示例19: GmailAuth

def GmailAuth(self,sel,user,passw):
    """
    Description: Perform gmail account sign-in once window
                 has been launced via website or widget.
    Requires: valid username and password
    """
    sel.select_pop_up("null")
    print "gmail auth: "+ user
    mslib.wait_for_element_present(self,sel,"signIn")
    sel.type("Email", user)
    sel.type("Passwd", passw)
    sel.click("signIn")
    sel.wait_for_page_to_load(testvars.timeout)
开发者ID:pculture,项目名称:unisubs-testing,代码行数:13,代码来源:offsite.py


示例20: Login

def Login(self,sel,auth_type):
    """
    Description: Initiates login sequence using the Subtitle Me menu that's attached to
    an embedded video, either onsite or offsite.

    auth_type can be 'log' (for site), 'twitter','openid','google'
    Requires valid accounts for chosen login type

    Pre-condition: Subtitle me widget menu should be present on page.

    Post-condition: either site or external login authorization pages are opened.
    For offsite login options see <a href="offsite.html">offsite</a>
    """
    print "logging in using "+auth_type+ " account"
    mslib.wait_for_element_present(self,sel, testvars.WebsiteUI["SubtitleMe_menu"])
    sel.click(testvars.WebsiteUI["SubtitleMe_menu"])
    time.sleep(5)  # give the widget a chance to open directly if it's going to.
    select_video_language(self,sel)
    close_howto_video(self,sel)
            
    if sel.is_element_present("css=.unisubs-modal-widget"):
        mslib.wait_for_element_present(self,sel,testvars.WidgetUI["Must_Login"])
        sel.click(testvars.WidgetUI["Must_Login"])
        
    else:
        if sel.is_element_present("css=.unisubs-uniLogo"):
            mslib.wait_for_element_present(self,sel,testvars.WebsiteUI["Login_menuitem"])
            sel.click(testvars.WebsiteUI["Login_menuitem"])

 #   sel.select_frame("relative=top")
    mslib.wait_for_element_present(self,sel,"css=.unisubs-modal-login-content")
    sel.click("css=a.unisubs-" +auth_type)
开发者ID:pculture,项目名称:unisubs-testing,代码行数:32,代码来源:widget.py



注:本文中的mslib.wait_for_element_present函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python msmbuilder.MSMLib类代码示例发布时间:2022-05-27
下一篇:
Python msilib.Dialog类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap