I have a question, I need to simulate slow network on my e2e tests with Protractor. I'm using anuglar-cli and angular5.
I have tried to find a way to simulate slow network without success, using setNetworkConnection
But it's fails to work and throws an exception.
The issue is only on slow network my typeahead is creating an extra call, because the before call haven't completed yet, I'm using this function to do it:
this.modelChanged
.debounceTime(400)
.distinctUntilChanged()
.subscribe((model: FilterModel) => {
this.filters.set(model.filterName, model.filterVal);
const filters = {};
this.filters.forEach((value: any, key: string) => {
filters[key] = value;
});
this.ds.changeData({
filters: filters
});
});
Maybe you will have a better suggestion to fix it too. Will gladly accept any suggestion.
Now I need to test it, to prevent the regression, when I will fix it with a better solution.
Thanks in advance.
If you use Chrome, take a look at this page https://peter.sh/experiments/chromium-command-line-switches/
When you start the browser you may pass arguments to it to specify the desired behavior. Especially pay attention to these args:
--shill-stub
- 'cellular=1' - Cellular is initially connected 'cellular=LTE' - Cellular is initially connected--enabled-3g
--force-effective-connection-type
************* E D I T *************
You specify args in config file. It should have capabilities object that looks like this
and
args
is what you are looking for to pass arguments