本文整理汇总了TypeScript中protractor.protractor.ExpectedConditions.invisibilityOf方法的典型用法代码示例。如果您正苦于以下问题:TypeScript protractor.ExpectedConditions.invisibilityOf方法的具体用法?TypeScript protractor.ExpectedConditions.invisibilityOf怎么用?TypeScript protractor.ExpectedConditions.invisibilityOf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类protractor.protractor.ExpectedConditions
的用法示例。
在下文中一共展示了protractor.ExpectedConditions.invisibilityOf方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('saving a file should work', async () => {
let saveBtn = element(by.css('sd-device-toolbar .save')),
filesLink = element(by.css('.primary-sidebar a.files'));
saveBtn.click();
browser.wait(protractor.ExpectedConditions.visibilityOf(element(by.css('.save-modal'))), 1000);
// No filename is there by default if the tab is pristine
expect(await element(by.css('.save-modal input[name="filename"]')).getAttribute('value')).toBe('');
// Cancel
element(by.css('.save-modal .modal-footer button[data-dismiss="modal"]')).click();
browser.wait(protractor.ExpectedConditions.stalenessOf(element(by.css('.modal-backdrop'))), 1000);
// Let's rename the tab
browser.executeScript('arguments[0].click()', element(by.css('.edit-tab')));
browser.wait(protractor.ExpectedConditions.visibilityOf(element(by.css('.tab-title-editor'))), 1000);
element(by.css('.tab-title-editor')).sendKeys('New title');
element(by.css('.tab-title-editor')).sendKeys(protractor.Key.ENTER);
browser.wait(protractor.ExpectedConditions.invisibilityOf(element(by.css('.tab-title-editor'))), 1000);
// Now we click the save button again
saveBtn.click();
browser.wait(protractor.ExpectedConditions.visibilityOf(element(by.css('.save-modal'))), 1000);
// The title is there as a default for the filename
expect(await element(by.css('.save-modal input[name="filename"]')).getAttribute('value')).toBe('New title');
// Save
element(by.css('.save-modal .modal-footer .btn-primary')).click();
browser.wait(protractor.ExpectedConditions.stalenessOf(element(by.css('.modal-backdrop'))), 1000);
filesLink.click();
expect(await element.all(by.css('.secondary-sidebar .files li')).count()).toBe(1);
expect(await element(by.css('.secondary-sidebar .files .filename')).getText()).toMatch('New title');
expect(await element(by.css('.secondary-sidebar .files .size')).getText()).toBe('0 bytes');
browser.executeScript('localStorage.removeItem("zephyrjs-ide.FILES.New title");');
filesLink.click();
let closeTabBtn = element(by.css('#tab-bar .nav-item.active .close-tab'));
closeTabBtn.click();
});
示例2: element
return element.all(by.css('.e2e-language-modal .button')).first().click().then(() => {
const el = element(by.css('.e2e-language-modal'));
return browser.wait(protractor.ExpectedConditions.invisibilityOf(el), 5000).then(() => true);
});