Web Sockets
See original GitHub issueCan’t run Protractor test on Angular2+ apps using Firrebase. Following up from https://github.com/angular/angularfire2/issues/779
Bug report
- Node Version:
v7.3.0
- Protractor Version:
5.1.2
- Angular Version:
4.1.2
- Browser(s):
chrome
- Operating System and Version
MacOS Sierra 10.12.4
- Your protractor configuration file
const { SpecReporter } = require('jasmine-spec-reporter');
exports.config = {
specs: [
'./e2e/**/*.e2e-spec.ts'
],
capabilities: {
'browserName': 'chrome'
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
print: function() {}
},
beforeLaunch: function() {
require('ts-node').register({
project: 'e2e/tsconfig.e2e.json'
});
},
onPrepare() {
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
}
};
- A relevant example test
import { browser, element, by } from 'protractor';
describe('test App', () => {
beforeEach(() => {
browser.get('/');
});
it('should display the home page', () => {
expect<any>(element(by.css('app-root h1')).getText()).toBe('Test App');
});
});
- Output from running the test
- Failed: Timed out waiting for asynchronous Angular tasks to finish after 11 seconds. This may be because the current page is not an Angular application. Please see the FAQ for more details: https://github.com/angular/protractor/blob/master/docs/timeouts.md#waiting-for-angular
While waiting for element with locator - Locator: By(css selector, app-root h1)
- Steps to reproduce the bug
Just including either
AngularFireAuth
orAngularFireDatabase
in an Angular4AppTestComponent
triggers the error.
import { Injectable } from '@angular/core';
import { AngularFireDatabase } from 'angularfire2/database';
import { AngularFireAuth } from 'angularfire2/auth';
import { Observable } from 'rxjs/Observable';
import * as firebase from 'firebase/app';
@Injectable()
export class FirebaseService {
constructor(
private afAuth: AngularFireAuth,
private db: AngularFireDatabase,
) { }
- The URL you are running your tests against (if relevant) https://onlineboard.sonnywebdesign.com/
Issue Analytics
- State:
- Created 6 years ago
- Reactions:16
- Comments:15 (1 by maintainers)
Top Results From Across the Web
The WebSocket API (WebSockets) - Web APIs - MDN Web Docs
desktop desktop
Chrome Edge
WebSocket Full support. Chrome4. Toggle history Full support. Edge12. Toggl...
WebSocket() constructor Full support. Chrome4. Toggle history Full support. Edge12. Toggl...
Read more >WebSocket - Wikipedia
WebSocket is a computer communications protocol, providing full-duplex communication channels over a single TCP connection. The WebSocket protocol was ...
Read more >What is web socket and how it is different from the HTTP?
WebSocket is a bidirectional communication protocol that can send the data from the client to the server or from the server to the...
Read more >What is WebSocket and How It Works? ⚙️ - Wallarm
WebSocket allows us to create “real-time” applications which are faster and require less overhead than traditional API protocols. Sometimes referred to as a ......
Read more >WebSockets - A Conceptual Deep Dive - Ably Realtime
In a nutshell, WebSockets are a thin transport layer built on top of a device's TCP/IP stack. The intent is to provide what...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For me worked this workaround:
In my project I solved it by disabling the synchronization. But this has a drawback: I had to insert some sleeps to wait “manually” for the page to get ready. Especially with Angular Material which I use in my project as it uses lots of animations. And there I often have to wait until the animation has finished. But for me this is not a big problem.