當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。