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


TypeScript by.model方法代碼示例

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


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

示例1: it

  it('should add numbers', () => {
    element(by.model('first')).sendKeys('4');
    element(by.model('second')).sendKeys('5');
    element(by.id('gobutton')).click();

    expect(element(by.binding('latest')).getText()).toEqual('9');
  });
開發者ID:angular,項目名稱:protractor-cookbook,代碼行數:7,代碼來源:spec.ts

示例2: it

    it('should be possible to control phone order via the drop-down menu', function() {
      let queryField = element(by.model('$ctrl.query'));
      let orderSelect = element(by.model('$ctrl.orderProp'));
      let nameOption = orderSelect.element(by.css('option[value="name"]'));
      let phoneNameColumn = element.all(by.repeater('phone in $ctrl.phones').column('phone.name'));

      function getNames() {
        return phoneNameColumn.map(function(elem: ElementFinder) {
          return elem.getText();
        });
      }

      queryField.sendKeys('tablet');   // Let's narrow the dataset to make the assertions shorter

      expect(getNames()).toEqual([
        'Motorola XOOM\u2122 with Wi-Fi',
        'MOTOROLA XOOM\u2122'
      ]);

      nameOption.click();

      expect(getNames()).toEqual([
        'MOTOROLA XOOM\u2122',
        'Motorola XOOM\u2122 with Wi-Fi'
      ]);
    });
開發者ID:AnthonyPAlicea,項目名稱:angular,代碼行數:26,代碼來源:e2e-spec.ts

示例3: login

export function login() {
    browser.get(env.baseUrl);
    browser.waitForAngular();
    element(by.model("vm.user.username")).sendKeys(USER.USERNAME)
    element(by.model("vm.user.password")).sendKeys(USER.PASSWORD);
    element(by.css(".loginButton")).click();
    browser.waitForAngular();
}
開發者ID:3drepo,項目名稱:3drepo.io,代碼行數:8,代碼來源:helpers.ts

示例4: constructor

    constructor()
    {
        this.firstTextBox=element(by.model("first"));
        this.secondTextBox = element(by.model("second"));
        this.goButton = element(by.id("gobutton"));
        this.result = element(by.repeater("result in memory")).element(by.css("td:nth-child(3)"));

    }
開發者ID:ashutoshchittora,項目名稱:TypeScriptCucumberProtractorVisualStudioCode,代碼行數:8,代碼來源:Calculator.ts

示例5: it

 it('can change the role of a member', () => {
   projectSettingsPage.membersTab.listFilter.sendKeys('dude');
   browser.wait(ExpectedConditions.visibilityOf(projectSettingsPage.membersTab.list.first()
     .element(by.model('user.role'))));
   Utils.clickDropdownByValue(projectSettingsPage.membersTab.list.first().element(by.model('user.role')), 'Manager');
   expect<any>(projectSettingsPage.membersTab.list.first().element(by.model('user.role'))
     .element(by.css('option:checked')).getText()).toEqual('Manager');
   projectSettingsPage.membersTab.listFilter.clear();
 });
開發者ID:,項目名稱:,代碼行數:9,代碼來源:

示例6: constructor

 constructor() {
   this.first_operand = element(by.model('first'));
   this.second_operand = element(by.model('second'));
   this.operator = (optor:string) => {
    return element(by.cssContainingText('option',optor));
   }
   this.go_button = element(by.id('gobutton'));
   this.result = element(by.binding('latest'));
 }
開發者ID:angular,項目名稱:protractor-cookbook,代碼行數:9,代碼來源:calcPage.ts

示例7: it

        it('when valid should not show validation error', () => {
            // whne
            const input = element(by.model('ctrl.user.email'));
            input.clear();
            input.sendKeys('c.c@gmail.com');

            // then
            const errorMsg = input.element(by.xpath('following-sibling::span'));
            expect(errorMsg.getAttribute('class')).toBe('ng-hide');
        });
開發者ID:ccrowhurstram,項目名稱:ram-protractor-training,代碼行數:10,代碼來源:exercise1.spec.ts

示例8: it

    it("should be navigated to HomePage when login with valid account", async function(){
        
        let username_ele = browser.element(by.model("Auth.user.name"))
        let password = browser.element(by.model("Auth.user.password"))
        let userDes = browser.element(by.model("model[options.key]"))
        let login_btn = browser.element(by.xpath("//button[contains(text(),'Login')]"))
        let home_title= browser.element(by.xpath("//h1[text()='Home']"))

        await browser.waitForAngularEnabled(true)
        await browser.get("http://www.way2automation.com/angularjs-protractor/registeration/#/login")
        await browser.manage().window().maximize()
        await username_ele.sendKeys("angular")
        await password.sendKeys("password")
        await userDes.sendKeys("ABC")
        await login_btn.click()
        
        await expect(home_title.isDisplayed()).toBe(true)
        await browser.sleep(5000)
    })
開發者ID:AnhPhamIT,項目名稱:Protractor,代碼行數:19,代碼來源:Login.ts


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