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


TypeScript globals.element類代碼示例

本文整理匯總了TypeScript中protractor/globals.element的典型用法代碼示例。如果您正苦於以下問題:TypeScript element類的具體用法?TypeScript element怎麽用?TypeScript element使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: it

  it('should allow removing courses', () => {

    // Check browser url (dashboard)
    expect(browser.driver.getCurrentUrl()).toMatch('/courses');

    // Get the number of courses present in the dashboard
    var courses1 = element.all(by.className('course-title'));
    var i = courses1.count;

    // Get and click the button to edit the last one of the courses
    var lastEditCoursesIcon = element.all(by.className('course-put-icon')).last();
    page.waitUntilElementNotVisible('#put-delete-course-modal');
    lastEditCoursesIcon.click();
    page.waitForAnimation();

    // Get and click the checkbox to allow the course's deletion
    browser.driver.findElement(by.css('label[for=delete-checkbox]')).then(function(deletionAllow) {
      deletionAllow.click();

      // Get and click the button to delete the course
      browser.driver.findElement(by.css('div.delete-div a.btn-flat')).then(function(deleteButton) {
        deleteButton.click().then(function() {
          browser.waitForAngular();

          // Get the number of courses present in the dashboard
          var courses2 = element.all(by.className('course-title'));
          var j = courses2.count;

          // Should be exactly one course less than before the deletion
          expect(Number(j.toString()) === (Number(i.toString()) - 1));
        });
      });
    });
  });
開發者ID:pabloFuente,項目名稱:full-teaching,代碼行數:34,代碼來源:app.e2e-spec.ts

示例2: getDropdownActionState

 getDropdownActionState() {
     return protractor.promise.all([
         element.all(by.css('.dropdown.open .dropdown-menu span:not(.disabled)')).count(),
         element.all(by.css('.dropdown.open .dropdown-menu span.disabled')).count(),
         element.all(by.css('.dropdown-menu')).isDisplayed()
     ]).then(args => {
         return  {
             enabled: args[0],
             disabled: args[1],
             displayed: args[2][0],
         }
     });
 }
開發者ID:JonZeolla,項目名稱:incubator-metron,代碼行數:13,代碼來源:sensor-list.po.ts

示例3: it

 it('should wait on async function in conditional', async function() : Promise<any> {
   browser.get('http://www.angularjs.org');
   let todoList = element.all(by.repeater('todo in todoList.todos'));
   if ((await todoList.count()) > 1) {
     expect(todoList.get(1).getText()).toEqual('build an angular app');
   }
 });
開發者ID:AleNoemi,項目名稱:protractor,代碼行數:7,代碼來源:spec.ts

示例4: getFormData

 getFormData() {
   let mainPanel = element.all(by.css('.metron-slider-pane-edit')).last();
   return protractor.promise.all([
     mainPanel.element(by.css('.form-title')).getText(),
     mainPanel.element(by.css('input[name="sensorTopic"]')).getAttribute('value'),
     mainPanel.element(by.css('select[formcontrolname="parserClassName"]')).getAttribute('value'),
     mainPanel.element(by.css('input[formcontrolname="grokStatement"]')).getAttribute('value'),
     mainPanel.all(by.css('div[name="fieldSchema"] table tr')).getText(),
     mainPanel.all(by.css('div[name="threatTriage"] table tr')).getText(),
     mainPanel.element(by.css('input[formcontrolname="index"]')).getAttribute('value'),
     mainPanel.element(by.css('metron-config-number-spinner[name="batchSize"] input')).getAttribute('value'),
     mainPanel.all(by.css('metron-config-advanced-form input')).getAttribute('value')
   ]).then(args => {
     return  {
       title: args[0],
       parserName: args[1],
       parserType: args[2],
       grokStatement: args[3],
       fieldSchemaSummary: args[4],
       threatTriageSummary: args[5],
       indexName: args[6],
       batchSize: args[7],
       advancedConfig: args[8]
     }
   });
 }
開發者ID:JonZeolla,項目名稱:incubator-metron,代碼行數:26,代碼來源:sensor-config.po.ts

示例5: expect

      submitEditCourseBtn.click().then(function() {
        browser.waitForAngular();

        //The last course should have changed its name
        var editedCourse = element.all(by.className('course-title')).last();
        expect(editedCourse.getText()).toEqual('[EDITED]');
      });
開發者ID:pabloFuente,項目名稱:full-teaching,代碼行數:7,代碼來源:app.e2e-spec.ts

示例6: getIconButton

 getIconButton(name: string, className: string) {
     return element.all(by.css('table>tbody>tr')).filter(row => {
         return row.all(by.tagName('td')).get(0).getText().then(pName => {
             return pName === name;
         })
     }).get(0).element(by.css(className));
 }
開發者ID:JonZeolla,項目名稱:incubator-metron,代碼行數:7,代碼來源:sensor-list.po.ts

示例7: getRow

 getRow(name: string) {
     return element.all(by.css('table>tbody>tr')).filter(row => {
         return row.all(by.tagName('td')).get(0).getText().then(pName => {
             return pName === name;
         })
     }).get(0);
 }
開發者ID:JonZeolla,項目名稱:incubator-metron,代碼行數:7,代碼來源:sensor-list.po.ts


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