当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript by.xpath方法代码示例

本文整理汇总了TypeScript中protractor.by.xpath方法的典型用法代码示例。如果您正苦于以下问题:TypeScript by.xpath方法的具体用法?TypeScript by.xpath怎么用?TypeScript by.xpath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在protractor.by的用法示例。


在下文中一共展示了by.xpath方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: it

		it('Changing "Label" dropdown to "none" should remove all chart labels', () => {
			// Click "none"
			element.all(by.xpath('//graph-demo/div[1]/div[2]/div[1]/select/option')).get(0).click();
			// Both "minmax" and "all" will place a label on the first rect (0)
			const rect = element.all(by.tagName('text'))
				.get(0)
				.getText()
				.then((text) => {
					expect(text.length).toEqual(0);
				});
		});
开发者ID:PaulGilchrist,项目名称:Angular2NodeTemplate,代码行数:11,代码来源:graph-demo.component.e2e-spec.ts

示例2: clickOnRow

 clickOnRow(id: string) {
   let idElement = element(by.css('a[title="' + id +'"]'));
   let td = idElement.element(by.xpath('../..')).all(by.css('td')).get(9);
   let detailsPane = element(by.css('.metron-slider-pane-details'));
   return waitForElementPresence(idElement)
   .then(() => browser.actions().mouseMove(idElement).perform())
   .then(() => browser.actions().mouseMove(td).perform())
   .then(() => browser.actions().click().perform())
   .then(() => waitForElementVisibility(detailsPane))
   .then(() => browser.sleep(2000));
 }
开发者ID:JonZeolla,项目名称:incubator-metron,代码行数:11,代码来源:tree-view.po.ts

示例3: ElementLocator

 ElementLocator(obj) {
    switch (obj.type) {
        case IdentificationType[IdentificationType.Xpath]:
            return element(by.xpath(obj.value));
        case IdentificationType[IdentificationType.ClassName]:
            return element(by.className(obj.value));
        case IdentificationType[IdentificationType.Id]:
            return element(by.id(obj.value));
        case IdentificationType[IdentificationType.Js]:
            return element(by.js(obj.value));
        case IdentificationType[IdentificationType.Css]:
            return element(by.css(obj.value));
        case IdentificationType[IdentificationType.Name]:
            return element(by.name(obj.value));
        default:
            break;
    }
 }
开发者ID:winedarksea1,项目名称:ProtractorProject,代码行数:18,代码来源:basepage.ts

示例4: element

export function inputElement<T>(locator: Locator): InputElementFinder<T> {
    let elem = element(locator) as any as InputElementFinder<T>;
    elem.setValue = setValue;
    elem.getValue = getValue;
    elem.validationElem = elem.element(by.xpath('following-sibling::span'));

    return elem;

    function getValue() {
        return elem.getAttribute('value');
    }

    function setValue(arg: T) {
        let val: string;
        if (typeof arg === 'number') {
            val = arg.toString();
        } else {
            val = (arg || '').toString();
        }

        elem.clear();
        return elem.sendKeys(val);
    }
}
开发者ID:ccrowhurstram,项目名称:ram-protractor-training,代码行数:24,代码来源:input-element.ts

示例5: getAlertStatusById

 getAlertStatusById(id: string) {
   return element(by.css('a[title="' + id + '"]'))
         .element(by.xpath('../..')).all(by.css('td a')).get(8).getText();
 }
开发者ID:iraghumitra,项目名称:incubator-metron,代码行数:4,代码来源:alerts-list.po.ts

示例6: playerKnown

 async playerKnown(name: string): Promise<boolean> {
   return await element.all(by.xpath(`//td[normalize-space(text())="${name}"]`)).count() > 0;
 }
开发者ID:lrem,项目名称:ladders,代码行数:3,代码来源:app.po.ts

示例7: getDefaultSavedSearchValue

 getDefaultSavedSearchValue() {
   browser.sleep(1000);
   return element(by.linkText('Saved Searches')).element(by.xpath('..')).all(by.css('i')).getText();
 }
开发者ID:iraghumitra,项目名称:incubator-metron,代码行数:4,代码来源:alerts-list.po.ts

示例8: it

 it('should render Hero Bios', function () {
   let heroBios = element.all(by.xpath('//h3[text()="Hero Bios"]')).get(0);
   expect(heroBios).toBeDefined();
 });
开发者ID:JohnnyQQQQ,项目名称:angular,代码行数:4,代码来源:e2e-spec.ts


注:本文中的protractor.by.xpath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。