How to use the protractor.ExpectedConditions.presenceOf function in protractor

To help you get started, we’ve selected a few protractor examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github openshift / console / frontend / integration-tests / views / secrets.view.ts View on Github external
export const clickRevealValues = async () => {
  await browser.wait(until.presenceOf(revealValuesButton));
  await revealValuesButton.click();
};
github openshift / console / frontend / integration-tests / views / crud.view.ts View on Github external
export const clickListPageCreateYAMLButton = async () => {
  const createDropdownIsPresent = await createItemButton.isPresent();
  if (createDropdownIsPresent) {
    await createItemButton.click();
    await createYAMLLink.click();
  } else {
    await browser.wait(until.presenceOf(createYAMLButton));
    await createYAMLButton.click();
  }
  await browser.wait(
    until.and(
      untilNoLoadersPresent,
      until.presenceOf(element(by.cssContainingText('h1', 'Create'))),
    ),
  );
};
github openshift / console / frontend / packages / dev-console / integration-tests / views / git-import-flow.view.ts View on Github external
export const addApplicationWithExistingApps = async function(name: string, nodeName: string) {
  await applicationSelector.click();
  await browser.wait(until.presenceOf(applicationDropdown));
  await createApplication.click();
  await applicationNameField.click();
  await safeSendKeys(applicationName, 'applicationName', name);
  await safeSendKeys(appName, 'appName', nodeName);
};
github pazznetwork / ngx-chat / e2e / src / app.e2e-spec.ts View on Github external
it('should be able to log in and log out', async () => {
        await page.navigateTo();
        await page.logInWithDefaultCredentials();
        await browser.wait(ExpectedConditions.presenceOf(element(by.css('.roster-list[data-ngx-chat-state="online"]'))), 5000);
        await page.logOut();
        await browser.wait(ExpectedConditions.not(ExpectedConditions.presenceOf(element(by.css('.roster-list')))), 5000);
    });
});
github Alfresco / alfresco-content-app / e2e / components / menu / menu.ts View on Github external
async waitForMenuToOpen() {
    await browser.wait(EC.presenceOf(browser.element(by.css('.cdk-overlay-container .mat-menu-panel'))), BROWSER_WAIT_TIMEOUT);
    await browser.wait(EC.visibilityOf(this.items.get(0)), BROWSER_WAIT_TIMEOUT);
  }
github ionic-team / ionic-conference-app / e2e / src / app.po.ts View on Github external
async waitForSelector(el: ElementFinder) {
    return browser.wait(ExpectedConditions.presenceOf(el), 3000);
  }
github rdkmaster / jigsaw / e2e / components / time.e2e-spec.ts View on Github external
it('test second hour week gr', async () => {
            const grEl = element.all(by.tagName('jigsaw-tile-option')),
                clockEl = element(by.css('.list-unstyled .accordion-toggle .glyphicon-time')),
                activeWeekEl = element(by.css('.datepicker-days .table-condensed .active'));
            grEl.get(0).click();
            clockEl.click();
            await browser.wait(ExpectedConditions.presenceOf(element(by.css('.timepicker-hour'))));
            expect(element(by.css('.timepicker-second')).getAttribute('TITLE')).toBe('Pick Second');
            grEl.get(2).click();
            clockEl.click();
            await browser.wait(ExpectedConditions.presenceOf(element(by.css('.timepicker-hour'))));
            expect(element(by.css('.timepicker-hour')).getAttribute('TITLE')).toBe('Pick Hour');
            grEl.get(4).click();
            expect(activeWeekEl.all(by.tagName('TD')).get(0).getCssValue('background-color')).toBe('rgba(65, 173, 220, 1)');
            expect(activeWeekEl.all(by.tagName('TD')).get(6).getCssValue('background-color')).toBe('rgba(65, 173, 220, 1)');
        })
    });
github JavierPDev / Meangular / e2e / admin / admin-blog-list.component.e2e-spec.ts View on Github external
it('has working blog delete', (done) => {
      browser.wait(
        ExpectedConditions.presenceOf(element(by.css('.fa-trash'))),
        5000
      );
      element.all(by.css('.fa-trash'))
        .then(items => {
          const deleteBtn: ElementFinder = items[6];
          expect(deleteBtn.isDisplayed()).toBe(true);
          deleteBtn.click();
          browser.wait(
            ExpectedConditions.invisibilityOf(deleteBtn),
            5000
          );
          expect(deleteBtn.isPresent()).toBe(false);
          done();
        });
    });
  });
github Wykks / ngx-mapbox-gl / projects / showcase-e2e / src / language-switch.e2e-spec.ts View on Github external
it('should change language', async () => {
    await browser.get('/demo/language-switch');
    const elm = element(by.tagName('canvas'));
    await browser.wait(EC.presenceOf(elm), 2000);
    const buttons = element.all(by.className('lang-button'));
    await browser.sleep(4000);
    await buttons.get(0).click();
    await browser.sleep(2000);
    const screen1 = await browser.takeScreenshot();
    await buttons.get(1).click();
    await browser.sleep(2000);
    const screen2 = await browser.takeScreenshot();
    const result = new PixelDiff({
      imageA: Buffer.from(screen1, 'base64'),
      imageB: Buffer.from(screen2, 'base64')
    }).runSync();
    expect(result.differences).toBeGreaterThan(0);
    await buttons.get(0).click();
    await browser.sleep(2000);
    const screen1bis = await browser.takeScreenshot();
github AdaptiveConsulting / ReactiveTraderCloud / src / e2e / src / utils / browser.utils.ts View on Github external
export const waitForElementToBePresent = createBrowserExpectationAwaiter(EC.presenceOf.name, finder =>
  EC.presenceOf(finder),
)