This repository was archived by the owner on Jul 29, 2024. It is now read-only.
This repository was archived by the owner on Jul 29, 2024. It is now read-only.
Angular dependency to be removed #2460
Closed
Description
As Protractor is not meant to be used exclusively with Angular it would be nice to avoid any 'Angular' dependency and rather let angular implement a Protractor API to become properly Protractor testable and utilize the waitStable testability feature.
We have been successfully using Protractor to test a ReactJS application which implements the necessary stuff from the window.angular for Protractor to work. The following code is the one that works and simulates the whenStable() functionality:
window.angular = {
// dummy for Protractor boot
resumeBootstrap: function() {},
// dummy for Protractor boot
module: function() {
var module = {
config: function() {
return module;
}
}
return module;
},
// hook for `github.com/angular/protractor/lib/clientsidescripts.js: waitForAngular`
getTestability: function() {
return {
whenStable: function(fn) {
...
}
}
}
};
The Protractor specific API could look something like (not completely accurate but should be enough to get what I mean):
window.protractor = {
// ...
resumeBootstrap: function() {},
// Simplified config to avoid any proractor -> angular dependency
config: function(opts) {
},
getTestability: function() {
return {
whenStable: function(fn) {
...
}
}
}
}