title: "Failed: Cannot read property 'isPresent' of undefined"
body: <pre><code>it('should be able to create a task for a product as a CTA', function () {
    browser.sleep(6222);browser.sleep(6222);console.log("ss");
    productPage.productsTab.click();
    expect(productPage.myProductsTab.isDisplayed()).toBeTruthy();
  
    //select checkbox
    productPage.selectProduct.click();
    browser.sleep(2222);
    var elm = productDialogPage.createTaskButton;
  
    var EC = protractor.ExpectedConditions;
  
    //get count of checked checkboxes, count must 1 be because it selected one product
    var checkedCount = productPage.selectedProducts.count();
    expect(checkedCount).toBe(1);
    browser.sleep(2222);
  
    browser.wait(EC.elementToBeClickable(elm, 6222));
  
    //click task create and expect confirm dialog to be displyed
    productDialogPage.createTaskButton.click();
    expect(ProductDialogPage.confirmDialog.isDisplayed()).toBe(true);
    browser.sleep(2222);
  
    //click yes to confirm creating task and expext dialog to displayed
    productDialogPage.yesBtnForConfirmDialog.click();
    //expect(taskPageObject.taskDialog.isDisplayed()).toBe(true);
    browser.sleep(6222);
  
    //put input areas to task create dialog
    this.createTask();
    browser.sleep(2222);
  </code></pre>
  
  <p>this is my test</p>
  
  <pre><code>var elm = productDialogPage.createTaskButton;
  
  var EC = protractor.ExpectedConditions;
  
  //get count of checked checkboxes, count must 1 be because it selected one product
  var checkedCount = productPage.selectedProducts.count();
  expect(checkedCount).toBe(1);
  browser.sleep(2222);
  
  browser.wait(EC.elementToBeClickable(elm, 6222));
  
  //click task create and expect confirm dialog to be displyed
  productDialogPage.createTaskButton.click();
  expect(ProductDialogPage.confirmDialog.isDisplayed()).toBe(true);
  browser.sleep(2222);
  </code></pre>
  
  <p>here the part</p>
  
  <p>after count is 1, it means i selected only one product (md-checbox), it means product is selected so that button is active now. Before it was disabled</p>
  
  <pre><code> disabled="disabled"
  </code></pre>
  
  <p>it has that. when i select, this is gone.</p>
  
  <p>But as soon as it enters my test or my class page, it gives error. it does not run code because it does not wait.</p>
  
  <p>it gives failure.</p>
  
  <p>i used isvisible ispresentof but still same</p>
  
  <p>error is for this code, "Failed: Cannot read property 'isPresent' of undefined"</p>
  
  <p>but i dont have ispresent</p>
  
  <p>before i had 2 classes only, now i separated classes according to dialog and tabs, this error started now.</p>
  
  <p>i can see "ss" as output but</p>
  
  <pre><code>browser.sleep(6222);console.log("ss");
  </code></pre>
  
  <p>there is sleeping 6 seconds. İt does not go there. it checks i think all variables before.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>ınstead productdialog.confirmdialog</p>
  
  <p>i put real value</p>
  
  <pre><code>element.all(by.buttonText('Görev Oluştur')).first()element.all(by.buttonText('Görev Oluştur')).first()
  </code></pre>
  
  <p>and it works.</p>
  
  <p>Why?</p>
  
  <p>it was here, still here but no usage now</p>
  
  <pre><code>var ProductDialogPage = function () {
    //confirm dialog for task creating, use with isDisplayed
    this.confirmDialog = element.all(by.css('._md.md-default-theme._md-transition-in')).first();
  
    this.yesBtnForConfirmDialog = element.all(by.buttonText('Evet')).first();
  };
  </code></pre>