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


TypeScript browser.actions方法代碼示例

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


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

示例1: it

    it('should display context menu on right click with proper elements in view mode', () => {
      browser.actions().mouseMove(page.graphContainer(), {x: 0, y: 0}).perform();

      browser.actions().click(protractor.Button.RIGHT).perform();

      expect(page.contextMenu().getCssValue('display')).toEqual('block');
      expect(page.visibleContextMenuItems().map(e => e.getAttribute('id')))
        .toEqual(['select-all', 'copy', 'cut', 'paste', 'undo', 'redo']);
    });
開發者ID:lukaszkostrzewa,項目名稱:graphy,代碼行數:9,代碼來源:app.e2e-spec.ts

示例2: it

 it ('Check tooltip texts: ' + description, () => {
   inputDynamicPopupText.clear();
   inputDynamicPopupText.sendKeys(data.inputText);
   browser.actions()
     .mouseMove(tooltipDynamic as any)
     .perform();
   expect(tooltipElement.getText()).toBe(data.inputText);
   browser.actions()
     .mouseMove(inputDynamicTooltipText as any)
     .perform();
 });
開發者ID:yusijs,項目名稱:ng2-bootstrap,代碼行數:11,代碼來源:tooltip-demo.e2e-spec.ts

示例3: it

  it('Append to body.', () => {
    browser.actions()
      .mouseMove(tooltipEl.buttonDefaultTooltip)
      .perform();
    expect(tooltipEl.tooltipElement.isPresent()).toBe(true);

    browser.actions()
      .mouseMove(tooltipEl.buttonAppendedToBody)
      .perform();
    expect(tooltipEl.tooltipElement.isPresent()).toBe(true);
  });
開發者ID:Zuiago,項目名稱:ngx-bootstrap,代碼行數:11,代碼來源:tooltip-demo.e2e-spec.ts

示例4: expect

      input.getSize().then((size) => {
        browser.actions()
            .mouseMove(input, {x: size.width - 5, y: 5})
            .click()
            .perform();

        expect(input.getAttribute('value')).toBe('1');

        browser.actions()
            .mouseMove(input, {x: size.width - 5, y: size.height - 5})
            .click()
            .perform();

        expect(input.getAttribute('value')).toBe('0');
      });
開發者ID:Daniel-McK,項目名稱:material2,代碼行數:15,代碼來源:input.e2e.ts

示例5: it

 it('Static modal does not close by misclick', () => {
   browser.actions()
     .mouseMove({ x: 0, y: 0 })
     .click()
     .perform();
   expect(modalWindow.isDisplayed()).toBe(true);
 });
開發者ID:Zuiago,項目名稱:ngx-bootstrap,代碼行數:7,代碼來源:modals-demo.e2e-spec.ts

示例6: it

  it('should login a test user', () => {
    const submitButton = getSubmitButton();
    browser.wait(until.presenceOf(submitButton), 10000, 'submit button taking too long to appear in the DOM');

    let emailInput = element(by.id('username'));
    let passwordInput = element(by.id('password'));
    browser.wait(until.visibilityOf(emailInput), 10000, 'Email input taking too long to appear in the DOM');
    browser.wait(until.visibilityOf(passwordInput), 10000, 'Password input taking too long to appear in the DOM');
    emailInput.sendKeys(testDataJson.username);
    passwordInput.sendKeys(testDataJson.password);

    expect(emailInput.isPresent()).toBe(true, 'email input not present');
    expect(passwordInput.isPresent()).toBe(true, 'password input not present');
    expect(submitButton.isPresent()).toBe(true, 'login button not present');
    browser.actions().mouseMove(submitButton).click().perform()
      .then(
        () => {
          browser.waitForAngular();
          browser.driver.sleep(5000); // This is important, otherwise the following fails!
          browser.wait(dashboardVisited, 10000, 'Dashboard page taking too long to load');
          browser.executeScript('return window.localStorage.getItem("access_token")')
            .then(
              (token: string) => {
                expect(token !== null && token.length > 3).toBe(true, 'no access token set: ' + token);
              }
            ).catch(
              () => {
                fail('Login failed: no access token');
              }
            );
        }
      );
  });
開發者ID:HiP-App,項目名稱:HiP-CmsAngularApp,代碼行數:33,代碼來源:login.component.e2e-spec.ts

示例7: deleteComment

 deleteComment() {
   let scrollToEle = element.all(by.css('.comment-container')).get(0);
   let trashIcon = element.all(by.css('.fa.fa-trash-o')).get(0);
   browser.actions().mouseMove(scrollToEle).perform().then(() => waitForElementVisibility(trashIcon))
   .then(() => trashIcon.click())
   .then(() => waitForElementVisibility(element(by.css('.modal-backdrop'))));
 }
開發者ID:JonZeolla,項目名稱:incubator-metron,代碼行數:7,代碼來源:alert-details.po.ts


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