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


TypeScript by.className方法代碼示例

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


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

示例1: it

    it(`should upload a new image successfully`, () => {
        element(by.className('upload_link')).click();

        expect<any>(element(by.className('upload_button')).getText()).toEqual('Upload');

        // Set properties of file to upload
        element(by.className('form-control')).sendKeys(tag);
        // Change focus
        // https://github.com/SeleniumHQ/selenium/wiki/Frequently-Asked-Questions#q-the-onchange-event-doesnt-fire-after-a-call-sendkeys
        element(by.xpath('//*[@path="title"]')).click();

        // Upload file
        element(by.id('fileupload')).sendKeys(path.resolve(process.cwd(), 'e2e', 'cloudinary_logo.png'));

        // Wait for upload to complete
        expect(element(by.className('status-code')).getText()).toMatch(/Completed with status code 200/i);

        browser.controlFlow().execute(function () {
            // Add this command to the test's control flow so the value changes only after the previous command completes successfully
            deleteByTag = true;
        });

        // Verify the new image exists in the photo list
        element(by.className('back_link')).click();
        expect(element(by.xpath(`//h2[text()="${tag}"]`)).isDisplayed()).toBeTruthy();
    });
開發者ID:RTLcoil,項目名稱:cloudinary_angular,代碼行數:26,代碼來源:app.e2e-spec.ts

示例2: submitTransaction

 static submitTransaction(transaction: string, type: string) {
     return OperationsHelper.click(element(by.className('side-button')).all(by.className('button-item')).all(by.className('primary')).first())
     .then(() => {
         OperationsHelper.click(element(by.className('transaction-modal')).all(by.id('dropdownMenu1')).first());
     })
     .then(() => {
         OperationsHelper.retrieveMatchingElementsByCSS('.transaction-modal', '.dropdown-item', 1)
         .then((elements) => {
             for (var i = 0; i < elements.length; i++) {
                 let elm = elements[i];
                 browser.executeScript(scrollMe, elm);
                 OperationsHelper.retrieveTextFromElement(elm)
                 .then((text) => {
                     if(text.toString() === type) {
                         return OperationsHelper.click(elm)
                     }
                 });
             }
         });
     })
     .then(() => {
       return browser.executeScript(`
           var editor = document.getElementsByClassName('CodeMirror')[0].CodeMirror;
           editor.focus();
           return editor.setValue('');
       `)
     })
     .then(() => {
         return element(by.css('.CodeMirror textarea')).sendKeys(transaction)
     })
     .then(() => {
         return OperationsHelper.click(element(by.id('submitTransactionButton')));
     })
 }
開發者ID:bloonbullet,項目名稱:composer,代碼行數:34,代碼來源:test.ts

示例3: it

 it('Displays Client detail', () => {
     const clientPage = manageGroupPage.clientPanelsById(Constants.defaultClientId);
     expect(clientPage.element(by.className('client-name')).getText()).toEqual('Mvc App Live');
     expect(clientPage.element(by.className('client-id')).getText()).toEqual('Id: ' + Constants.defaultClientId);
     expect(clientPage.element(by.className('client-enviroment')).getText()).toEqual('Live');
     expect(clientPage.element(by.className('client-description')).getText()).toEqual('Application');
 });
開發者ID:PjMitchell,項目名稱:ConfigServer,代碼行數:7,代碼來源:manageGroupPage.spec.ts

示例4: expect

 .then((s) => {
     createPage.save();
     const groupPanel = homepage.groupPanelsById(s);
     expect(groupPanel.element(by.className('home-group-id')).getText()).toEqual(s);
     expect(groupPanel.element(by.className('home-group-img')).getAttribute('src')).toEqual(Constants.path('/Resource/ClientGroupImages/testimage.JPG'));
     expect(groupPanel.element(by.className('home-group-name')).getText()).toEqual(input);
     done();
 });
開發者ID:PjMitchell,項目名稱:ConfigServer,代碼行數:8,代碼來源:createGroupPage.spec.ts

示例5: it

 it('opens TaskDetailsPage', () => {
   element.all(by.className('task-list-item')).then((tasks) => {
     tasks[0].click();
     browser.driver.sleep(5000); // wait for the animation
     expect(element(by.className('toolbar-title')).getText()).toContain('Reflow Lead-Free');
   });
 });
開發者ID:apollo-ng,項目名稱:governess,代碼行數:7,代碼來源:tasks.e2e-spec.ts

示例6: it

 it('Open all activity groups', () => {
   activityPage.get();
   element.all(by.className('activity-group-meta')).click();
   browser.wait(ExpectedConditions.visibilityOf(
     activityPage.activitiesList.get(aIndex)), constants.conditionTimeout);
   expect<any>(activityPage.activitiesList.get(aIndex).isDisplayed()).toBe(true);
 });
開發者ID:sillsdev,項目名稱:web-languageforge,代碼行數:7,代碼來源:activity.e2e-spec.ts

示例7: waitForToast

 waitForToast() {
   return browser
     .wait(until.elementLocated(by.className('ngx-toastr')), 500, 'not found')
     .then((el) => {
       return browser.wait(until.elementIsVisible(el), 5000, 'not found');
     });
 }
開發者ID:scttcper,項目名稱:toastr-ng2,代碼行數:7,代碼來源:app.po.ts

示例8: it

  it('should support AfterView hooks', function () {
    let parentEle = element(by.tagName('after-view-parent'));
    let buttonEle = parentEle.element(by.tagName('button')); // Reset
    let commentEle = parentEle.element(by.className('comment'));
    let logEles = parentEle.all(by.css('h4 ~ div'));
    let childViewInputEle = parentEle.element(by.css('my-child-view input'));
    let logCount: number;

    expect(childViewInputEle.getAttribute('value')).toContain('Magneta');
    expect(commentEle.isPresent()).toBe(false, 'comment should not be in DOM');

    logEles.count().then(function(count: number) {
      logCount = count;
      return childViewInputEle.sendKeys('-test-');
    }).then(function() {
      expect(childViewInputEle.getAttribute('value')).toContain('-test-');
      expect(commentEle.isPresent()).toBe(true, 'should have comment because >10 chars');
      expect(commentEle.getText()).toContain('long name');
      return logEles.count();
    }).then(function(count: number) {
      expect(logCount + 7).toEqual(count, '7 additional log messages should have been added');
      logCount = count;
      return buttonEle.click();
    }).then(function() {
      expect(logEles.count()).toBeLessThan(logCount, 'log should shrink after reset');
    });
  });
開發者ID:JohnnyQQQQ,項目名稱:angular,代碼行數:27,代碼來源:e2e-spec.ts

示例9: clickYesForConfirmation

 clickYesForConfirmation() {
   let okButton = element(by.css('.metron-dialog')).element(by.buttonText('OK'));
   let maskElement = element(by.className('modal-backdrop'));
   waitForElementVisibility(maskElement)
   .then(() => okButton.click())
   .then(() => waitForElementInVisibility(maskElement));
 }
開發者ID:iraghumitra,項目名稱:incubator-metron,代碼行數:7,代碼來源:tree-view.po.ts

示例10: it

 it('timer and parent seconds should match', function () {
   let parent = element(by.tagName(parentTag));
   let message = parent.element(by.tagName('countdown-timer')).getText();
   browser.sleep(10); // give `seconds` a chance to catchup with `message`
   let seconds = parent.element(by.className('seconds')).getText();
   expect(message).toContain(seconds);
 });
開發者ID:DanielKucal,項目名稱:angular,代碼行數:7,代碼來源:e2e-spec.ts


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