本文整理匯總了TypeScript中protractor.ElementFinder.click方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript ElementFinder.click方法的具體用法?TypeScript ElementFinder.click怎麽用?TypeScript ElementFinder.click使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類protractor.ElementFinder
的用法示例。
在下文中一共展示了ElementFinder.click方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('should add a new hero when clicking the "add" button', () => {
showHideBtn.click();
ng2HeroesAddBtn.click();
expectHeroes(true, 4, 'Added hero Kamala Khan');
expect(ng1Heroes.last()).toHaveName('Kamala Khan');
});
示例2: expect
const commonDayCalendar = (menu: ElementFinder, input: ElementFinder) => {
menu.click();
page.showGoToCurrentRadio.click();
input.click();
expect(page.currentLocationBtn.isPresent()).toBe(true);
expect(page.dayCalendarNavHeaderBtn.getText()).toEqual(currentMonth);
page.dayCalendarLeftNavBtn.click();
expect(page.dayCalendarNavHeaderBtn.getText()).toEqual(prevMonth);
page.currentLocationBtn.click();
expect(page.dayCalendarNavHeaderBtn.getText()).toEqual(currentMonth);
page.dayCalendarNavHeaderBtn.click();
expect(page.dayCalendarNavMonthHeaderBtn.getText()).toEqual(currentYear);
page.monthCalendarLeftNavBtn.click();
expect(page.dayCalendarNavMonthHeaderBtn.getText()).toEqual(prevYear);
page.dayCalendarNavMonthHeaderBtn.click();
page.currentLocationBtn.click();
expect(page.dayCalendarNavHeaderBtn.getText()).toEqual(currentMonth);
page.hideGoToCurrentRadio.click();
input.click();
expect(page.currentLocationBtn.isPresent()).toBe(false);
page.dayCalendarNavHeaderBtn.click();
expect(page.currentLocationBtn.isPresent()).toBe(false);
};
示例3: it
it('should toggle content on show', () => {
expect(rxToggleContent.isDisplayed()).to.eventually.be.false;
rxToggle.click();
expect(rxToggleContent.isDisplayed()).to.eventually.be.true;
rxToggle.click();
expect(rxToggleContent.isDisplayed()).to.eventually.be.false;
});
示例4: it
it('should show the error when the form is invalid', () => {
firstInput.click();
firstInput.clear();
firstInput.sendKeys('a');
expect(element(by.css('div')).getText()).toEqual('Name is too short.');
});
示例5: it
it('clicking on an example should open it', async () => {
let examplesLink = element(by.css('.primary-sidebar a.examples')),
secondarySidebar = element(by.css('.secondary-sidebar aside')),
filename: ElementFinder = null;
// Open sidebar
examplesLink.click();
element(by.css('.secondary-sidebar aside ul li:first-child a.example')).click();
// The secondary sidebar closes.
expect(await secondarySidebar.getCssValue('transform')).not.toBe('none');
// The tab count is now 2.
let tablist = element.all(by.css('#tab-bar .nav-item'));
expect(await tablist.count()).toBe(2);
// Opening the same file again should direct to the same tab again
examplesLink.click();
filename = element(by.css('.secondary-sidebar aside ul li:first-child a.example'));
filename.click();
// The tab count is still 2.
expect(await tablist.count()).toBe(2);
let closeTabBtn = element(by.css('#tab-bar .nav-item.active .close-tab'));
closeTabBtn.click();
});
示例6:
dirtyGroups.forEach((dirtyGroup) => {
let dirtyGroupHeader: ElementFinder = siteLogPage.getGroupHeader(dirtyGroup);
dirtyGroupHeader.click();
dirtyGroupHeader.getText().then((groupName) => {
console.log(' Modified group: ', groupName);
browser.waitForAngular();
siteLogPage.getDirtyItems(groupName).then((dirtyItems) => {
dirtyItems.forEach((dirtyItem) => {
let dirtyItemHeader: ElementFinder = siteLogPage.getItemHeader(dirtyItem);
dirtyItemHeader.click();
dirtyItemHeader.getText().then((itemName) => {
console.log(' Modified item: ', itemName);
});
browser.waitForAngular();
siteLogPage.getDirtyFields(dirtyItem).then((dirtyFields) => {
dirtyFields.forEach((dirtyField) => {
siteLogPage.getDirtyFieldInput(dirtyField).isPresent().then((isModified: boolean) => {
if (isModified) {
siteLogPage.getDirtyFieldLabel(dirtyField).getText().then((fieldName) => {
console.log(' Modified field: ', fieldName);
});
}
});
});
});
});
});
});
});
示例7: it
it('should query view child', () => {
expect(result.getText()).toEqual('Selected: 1');
button.click();
expect(result.getText()).toEqual('Selected: 2');
});
示例8: it
it('should query nested content children', () => {
expect(resultNested.getText()).toEqual('Arbitrary nested panes: 1, 2');
button.click();
expect(resultNested.getText()).toEqual('Arbitrary nested panes: 1, 2, 3, 3_1, 3_2');
});