當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript browser.driver.findElement方法代碼示例

本文整理匯總了TypeScript中protractor.browser.driver.findElement方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript browser.driver.findElement方法的具體用法?TypeScript browser.driver.findElement怎麽用?TypeScript browser.driver.findElement使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在protractor.browser.driver的用法示例。


在下文中一共展示了browser.driver.findElement方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: insereDadosFacebook

 async insereDadosFacebook() {
     await browser.driver.findElement(by.css("input[name=email]")).sendKeys('teste-professor-1@logoseducacao.com.br');
     await browser.sleep(500);// espera fim do preencimento
     await browser.driver.findElement(by.css("input[type=password]")).sendKeys('professor123#' + protractor.Key.ENTER);
     await browser.sleep(500);// espera fim do preencimento
     await waitRenderElement('app-class-daily');
 }
開發者ID:keviocastro,項目名稱:daily-ui,代碼行數:7,代碼來源:login.po.ts

示例2: insereDadosGoogle

 async insereDadosGoogle() {
     let inputEmail = 'input#identifierId';
     await browser.driver.wait(async () => await $(inputEmail).isPresent() && await $('.CwaK9 span.RveJvd.snByac').isPresent(), 30 * 1000);
     await browser.driver.findElement(by.css(inputEmail)).sendKeys('teste-professor-1@logoseducacao.com.br'+ protractor.Key.ENTER );
     await browser.sleep(1000);
     let inputPass = 'input[name=password]'
     await browser.driver.wait(() => $(inputPass).isPresent(), 30 * 1000);
     await browser.driver.findElement(by.css(inputPass)).sendKeys('professor123#'+ protractor.Key.ENTER);
     await browser.sleep(1000);
     await browser.driver.wait(async () => (await browser.driver.getCurrentUrl()).includes('class-daily'),30*1000);
 }
開發者ID:keviocastro,項目名稱:daily-ui,代碼行數:11,代碼來源:login.po.ts

示例3:

 return browser.switchTo().frame(iframe).then( () => {
   let el = browser.driver.findElement(by.id('tinymce'));
   let text = el.getText();
   return browser.switchTo().defaultContent().then(()=>{
     return browser.waitForAngular().then(()=>{return text});
   });
 });              
開發者ID:dmacfarlane,項目名稱:ng2-mentions,代碼行數:7,代碼來源:app.po.ts

示例4: it

  it('should transfer component state', function() {
    // Load the page without waiting for Angular since it is not bootstrapped automatically.
    browser.driver.get(browser.baseUrl + 'transferstate');

    // Test the contents from the server.
    const serverDiv = browser.driver.findElement(by.css('div'));
    expect(serverDiv.getText()).toEqual('5');

    // Bootstrap the client side app and retest the contents
    browser.executeScript('doBootstrap()');
    expect(element(by.css('div')).getText()).toEqual('50');

    // Make sure there were no client side errors.
    verifyNoBrowserErrors();
  });
開發者ID:BobChao87,項目名稱:angular,代碼行數:15,代碼來源:transferstate-spec.ts

示例5: it

  it('should display: Hello world!', function() {
    // Load the page without waiting for Angular since it is not bootstrapped automatically.
    browser.driver.get(browser.baseUrl + 'helloworld');

    const style = browser.driver.findElement(by.css('style[ng-transition="hlw"]'));
    expect(style.getText()).not.toBeNull();

    // Test the contents from the server.
    const serverDiv = browser.driver.findElement(by.css('div'));
    expect(serverDiv.getText()).toEqual('Hello world!');

    // Bootstrap the client side app.
    browser.executeScript('doBootstrap()');

    // Retest the contents after the client bootstraps.
    expect(element(by.css('div')).getText()).toEqual('Hello world!');

    // Make sure the server styles got replaced by client side ones.
    expect(element(by.css('style[ng-transition="hlw"]')).isPresent()).toBe(false);
    expect(element(by.css('style')).getText()).toBe('');

    // Make sure there were no client side errors.
    verifyNoBrowserErrors();
  });
開發者ID:BobChao87,項目名稱:angular,代碼行數:24,代碼來源:helloworld-spec.ts

示例6: it

 it('should have credits as a link', () => {
   expect(browser.driver.findElement(by.className('credit')).getAttribute('href')).toEqual('https://fullstack-developer.academy/');
 });
開發者ID:marley-js,項目名稱:Mastering-TypeScript-Programming-Techniques,代碼行數:3,代碼來源:spec.ts

示例7: clickGoogle

 async clickGoogle() {
     await browser.driver.findElement(by.css('button[data-provider=google-oauth2]')).click();
 }
開發者ID:keviocastro,項目名稱:daily-ui,代碼行數:3,代碼來源:login.po.ts

示例8: clickFacebook

 async clickFacebook() {
     await browser.driver.findElement(by.css('button[data-provider=facebook]')).click();
 }
開發者ID:keviocastro,項目名稱:daily-ui,代碼行數:3,代碼來源:login.po.ts


注:本文中的protractor.browser.driver.findElement方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。