gratipay / grtp.co

Gratipay Widgets + API
https://grtp.co/
MIT License
26 stars 19 forks source link

Dalek tests fail with command line runner #170

Closed techtonik closed 7 years ago

techtonik commented 7 years ago
>npm install dalek-cli
>node_modules\.bin\dalek.cmd -- "test/v2/test_custom-widget.js"

> grtp.co@0.1.5 dalek E:\p\gratipay\grtp.co
> dalek "test/v2/test_custom-widget.js"

Running tests
Running Browser: PhantomJS
OS: windows Vista 32bit
Browser Version: 1.9.8

RUNNING TEST - "v2 custom-widget: readystatus should be ready"
> OPEN http://localhost:9537/test/v2/custom-widget.html
> WAITFOR Interrupted by timeout
x ATTRIBUTE
0 EXPECTED: ready
0 FOUND: Element does not exist in cache
0 MESSAGE: readystatus should be ready
x TEST - "v2 custom-widget: readystatus should be ready" FAILED

RUNNING TEST - "v2 custom-widget: it should fill the standard values"
> OPEN http://localhost:9537/test/v2/custom-widget.html
> WAITFOR Interrupted by timeout
* TEXT teamslug should not be empty
* TEXT receiving should not be empty
* 2 Assertions run
* TEST - "v2 custom-widget: it should fill the standard values" SUCCEEDED

 2/3 assertions passed. Elapsed Time: 15.51 sec
>> ERROR: Error: read ECONNRESET
>> ERROR: Error: read ECONNRESET
>> ERROR: Error: socket hang up
>> ERROR: Error: socket hang up
techtonik commented 7 years ago

The difference with "grunt test" here is that grunt spins up http://localhost:9537 independently before running tests:

grunt.registerTask('test', ['jshint', 'connect', 'dalek']);

If web server is up beforehand, tests pass ok.

Things I don't like about DalekJS:

  1. is that location of test server is hardcoded into test itself
  2. there is no test discovery - every test suite (.js file) should be passed to dalek-cli explicitly
techtonik commented 7 years ago

We need to get rid of Dalek. Moved to #176.