We are unable to test the Time Picker component with Protractor, in fact, we are unable to access the mobiscroll ‘modal’ itself and acknowledge that it is ‘displayed’ (with protractor)…
Here is the code we use:
public getTimesheetScrollModal() {
return this.getElementByCss('.mbsc-mobiscroll');
}
Protractor always says that it is undefined… (the selector is not working)
Upon verification and research, we noticed that mobiscroll “popup/modal” code, in the DOM, is generated outside the angular app <app-root> and some stackoverflow post state that Protractor cannot access elements outside Angular app…
Your example is Jasmine code, not protractor…
Protractor cannot use any query selector to manipulate the elements in the modal because the modal itself cannot be reached, it “looks” like this is due to the fact that the Mobiscroll modal is generated outside the Angular app app root.
So your code would not work with Protractor.
Here is a screenshot where mobiscroll modal is generated:
I don’t understand why other user never had this problem before, protractor is popular among Angular developers…
We really need a fix to be able to test with Protractor.
Sorry about the mixup. I tried this with Protractor, but the modal being outside of app-root does not seem to be an issue for me. Here’s the code I used:
Thank you very much for your reply. I was able to successfully execute the code and see if the mobiscroll is displayed using Ionic by setting the browser.waitForAngularEnabled(false);. It seems like protractor cannot read the element once outside the app-root of the angular component. However, is it possible to set the value or tick the value of mobiscroll timepicker using protractor? We are using the time picker