當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript protractor.ExpectedConditions.invisibilityOf方法代碼示例

本文整理匯總了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();
    });
開發者ID:baleboy,項目名稱:zephyrjs-ide,代碼行數:37,代碼來源:editor.component.e2e-spec.ts

示例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);
      });
開發者ID:skycoin,項目名稱:skycoin,代碼行數:5,代碼來源:onboarding.po.ts


注:本文中的protractor.protractor.ExpectedConditions.invisibilityOf方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。