本文整理汇总了TypeScript中protractor/globals.browser.driver.findElements方法的典型用法代码示例。如果您正苦于以下问题:TypeScript browser.driver.findElements方法的具体用法?TypeScript browser.driver.findElements怎么用?TypeScript browser.driver.findElements使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类protractor/globals.browser.driver
的用法示例。
在下文中一共展示了browser.driver.findElements方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should allow adding new entries to the forum', () => {
expect(browser.driver.getCurrentUrl()).toMatch(/\/courses\/[0-9]+\/1/);
// Get all tab buttos
browser.driver.findElements(by.css('.md-tab-label-aux')).then(function(tabButtons) {
expect(tabButtons.length === 5).toBeTruthy();
tabButtons[2].click().then(function() {
expect(browser.driver.getCurrentUrl()).toMatch(/\/courses\/[0-9]+\/2/);
element(by.css('.card-panel.warning')).isPresent().then(function(pres) {
if (pres) {
element(by.css('#edit-forum-icon')).click().then(function() {
page.waitForAnimation();
// Get and click the checkbox to allow the forum's activation
browser.driver.findElement(by.css('label[for=delete-checkbox]')).then(function(activationAllowed) {
activationAllowed.click();
// Get and click the button to activate the forum
browser.driver.findElement(by.css('#put-modal-btn')).then(function(activateButton) {
activateButton.click().then(function() {
browser.waitForAngular();
page.waitForAnimation();
page.waitUntilElementPresent('#add-entry-icon');
});
});
});
});
}
browser.driver.findElement(by.css('#add-entry-icon')).then(function(btn) {
btn.click().then(function() {
page.waitUntilElementPresent('#course-details-modal');
// Find form elements
var entryTitleField = browser.driver.findElement(by.css('input#inputTitle'));
var entryCommentField = browser.driver.findElement(by.css('textarea#inputComment'));
// Fill input fields
entryTitleField.sendKeys('New testing entry title');
entryCommentField.sendKeys('New testing entry comment');
// Ensure fields contain what has been entered
expect(entryTitleField.getAttribute('value')).toEqual('New testing entry title');
expect(entryCommentField.getAttribute('value')).toEqual('New testing entry comment');
// Send new entry
browser.driver.findElement(by.css('#post-modal-btn')).then(function(sendButton) {
sendButton.click().then(function() {
browser.waitForAngular();
page.waitUntilElementNotVisible('#course-details-modal');
// Get and check the title of last entry
var entries = element.all(by.css('li.entry-title div div a'));
expect(entries.last().getText()).toContain('New testing entry title');
});
});
});
});
});
});
});
});