0

I am testing a checkbox, and i want to know if there is any expected condition to wait for the item to be selected. Right now on my tests i am using browser.sleep with 10 seconds(the checkbox takes to much time to load) but that doesnt seems the good.

Can anyone help me?

I have this:


 it('the tick of element is selected should be visible', () => {
    browser.sleep(5000);
    //  browser.wait(EC.elementToBeClickable(locator.lateCancelCheckbox),5000);
      browser.wait(EC.elementToBeClickable(locator.lateCancelCheckbox1),7000);
      locator.lateCancelCheckbox1.click();
      browser.sleep(10000);
      expect(locator.lateCancelCheckbox.getAttribute('class')).toEqual('checkbox checkbox-md ng-valid ng-touched ng-dirty');
  }); 

Fábio Heitor
  • 105
  • 2
  • 12

1 Answers1

1

have you even checked the docs? the info is literally there:

https://www.protractortest.org/#/api?view=ProtractorExpectedConditions.prototype.elementToBeSelected

Joaquin Casco
  • 704
  • 5
  • 14