2017-09-05 2 views
0

Ich habe vagrant virtualmachine, ich kann einige Endpunkte von dort zugreifen (via curl). Ich habe Knoten (v 8.4.0) und npm (v 5.3.0) installiert. Ich betreibe es über Sudo. Ich benutze nightmareJS und kann keine Verbindung zum Endpunkt herstellen. Ich betreibe die gleichen Tests Fall auf einer anderen Maschine und es funktioniert ohne Timeout:nightmareJS Timeout auf Landstreicher

Test/test_simple.js

const Nightmare = require('nightmare') 

describe('UI Flow Tests', function() { 
    this.timeout('60s') 

    let nightmare = null 
    beforeEach(() => { 
    nightmare = new Nightmare() 
    }) 



    describe('Using the App', function() { 
    describe('customize',() => { 
     it('should work without timing out', done => { 
     nightmare 
     .goto('http://simple-form-bootstrap.plataformatec.com.br/documentation') 
     .end() 
     .then(result => { done() }) 
     .catch(done) 
     }) 
    }) 
    }) 
}) 

wenn ich laufe:

sudo npm test 

dann gibt es ein Timeout:

> [email protected] test /home/vagrant/project/codecept 
> mocha 



    UI Flow Tests 
    Using the App 
     customize 
     1) should work without timing out 


    0 passing (1m) 
    1 failing 

    1) UI Flow Tests Using the App customize should work without timing out: 
    Error: Timeout of 60000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. 




npm ERR! Test failed. See above for more details. 

Bearbeiten

Ich versuchte Knoten V8.3.0 und Albtraum 2.8 und 2.4.1 aber den gleichen Fehler. Sieht aus wie vagrant blockiert Anfrage

EDIT2 Ich lief Alptraum im Debug-Knoten und ich erhalte Fehler mit Elektron (?): DEBUG=nightmare npm test

nightmare electron child process exited with code 127: command not found - you may not have electron installed correctly +0ms nightmare queueing action "goto" for http://simple-form-bootstrap.plataformatec.com.br/documentation +3ms nightmare running +2ms

Edit3 deguggin Elektron gibt: electron:stderr /home/vagrant/te/node_modules/electron/dist/electron: error while loading shared libraries: libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory

+0

Ich kann das Problem auch an ihrem Beispiel reproduzieren, also wahrscheinlich ein Bug mit der neuesten Version? –

+0

@TarunLalwani Ich aktualisiere Frage, Downgrade hat nicht geholfen –

+0

Ich habe versucht, mac, vm, docker und nichts hat funktioniert. Irgendwas mit der Elektroneneinstellung zu tun, denke ich –

Antwort

0

Ich musste libxss1 libnspr4-0d libcurl installieren 3, libx11-xcb-dev. Vielleicht sind nicht alle Bibliotheken erforderlich.