mirror of https://github.com/zulip/zulip.git
Move frontend tests out of zerver/tests/.
This fixes an unfortunate bug where the backend tests in zerver/tests.py were not being run automatically, and also makes these a bit easier to find.
This commit is contained in:
parent
a36ac151ef
commit
f1074aa491
|
@ -15,6 +15,6 @@
|
||||||
/zproject/test_settings.py export-ignore
|
/zproject/test_settings.py export-ignore
|
||||||
/zerver/fixtures export-ignore
|
/zerver/fixtures export-ignore
|
||||||
/zerver/tests.py export-ignore
|
/zerver/tests.py export-ignore
|
||||||
/zerver/tests export-ignore
|
/frontend_tests export-ignore
|
||||||
/node_modules export-ignore
|
/node_modules export-ignore
|
||||||
/humbug export-ignore
|
/humbug export-ignore
|
||||||
|
|
|
@ -13,7 +13,7 @@ stats/
|
||||||
zerver/fixtures/available-migrations
|
zerver/fixtures/available-migrations
|
||||||
zerver/fixtures/migration-status
|
zerver/fixtures/migration-status
|
||||||
zerver/fixtures/test_data1.json
|
zerver/fixtures/test_data1.json
|
||||||
zerver/tests/frontend/test_credentials.js
|
frontend_tests/test_credentials.js
|
||||||
.kdev4
|
.kdev4
|
||||||
zulip.kdev4
|
zulip.kdev4
|
||||||
memcached_prefix
|
memcached_prefix
|
||||||
|
|
|
@ -254,12 +254,12 @@ Files: zerver/lib/ccache.py
|
||||||
Copyright: 2013 David Benjamin and Alan Huang
|
Copyright: 2013 David Benjamin and Alan Huang
|
||||||
License: Expat
|
License: Expat
|
||||||
|
|
||||||
Files: zerver/tests/frontend/casperjs/*
|
Files: frontend_tests/casperjs/*
|
||||||
Copyright: 2011-2012 Nicolas Perriault
|
Copyright: 2011-2012 Nicolas Perriault
|
||||||
Joyent, Inc. and other Node contributors
|
Joyent, Inc. and other Node contributors
|
||||||
License: Expat
|
License: Expat
|
||||||
|
|
||||||
Files: zerver/tests/frontend/casperjs/modules/vendors/*
|
Files: frontend_tests/casperjs/modules/vendors/*
|
||||||
Copyright: 2011, Jeremy Ashkenas
|
Copyright: 2011, Jeremy Ashkenas
|
||||||
License: Expat
|
License: Expat
|
||||||
|
|
||||||
|
|
|
@ -76,11 +76,11 @@ Tests
|
||||||
=====
|
=====
|
||||||
|
|
||||||
+------------------------+-----------------------------------+
|
+------------------------+-----------------------------------+
|
||||||
| ``zerver/test*.py`` | Backend tests | |
|
| ``zerver/test*.py`` | Backend tests |
|
||||||
+------------------------+-----------------------------------+
|
+------------------------+-----------------------------------+
|
||||||
| ``zerver/tests/frontend/node`` | Node Frontend unit tests |
|
| ``frontend_tests/node`` | Node Frontend unit tests |
|
||||||
+------------------------+-----------------------------------+
|
+------------------------+-----------------------------------+
|
||||||
| ``zerver/tests/frontend/tests`` | Casper frontend tests |
|
| ``frontend_tests/tests`` | Casper frontend tests |
|
||||||
+------------------------+-----------------------------------+
|
+------------------------+-----------------------------------+
|
||||||
|
|
||||||
Documentation
|
Documentation
|
||||||
|
|
|
@ -59,7 +59,7 @@ with ``tools/test-backend``.
|
||||||
Web frontend black-box tests
|
Web frontend black-box tests
|
||||||
----------------------------
|
----------------------------
|
||||||
|
|
||||||
These live in ``zerver/tests/frontend/tests/``. This is a "black box"
|
These live in ``frontend_tests/tests/``. This is a "black box"
|
||||||
test; we load the frontend in a real (headless) browser, from a real dev
|
test; we load the frontend in a real (headless) browser, from a real dev
|
||||||
server, and simulate UI interactions like sending messages, narrowing,
|
server, and simulate UI interactions like sending messages, narrowing,
|
||||||
etc.
|
etc.
|
||||||
|
@ -67,7 +67,7 @@ etc.
|
||||||
Since this is interacting with a real dev server, it can catch backend
|
Since this is interacting with a real dev server, it can catch backend
|
||||||
bugs as well.
|
bugs as well.
|
||||||
|
|
||||||
You can run this with ``./zerver/tests/frontend/run``. You will need
|
You can run this with ``./frontend_tests/run``. You will need
|
||||||
`PhantomJS <http://phantomjs.org/>`__ 1.7.0 or later.
|
`PhantomJS <http://phantomjs.org/>`__ 1.7.0 or later.
|
||||||
|
|
||||||
Debugging Casper.JS
|
Debugging Casper.JS
|
||||||
|
@ -78,7 +78,7 @@ is not perfect. Here are some steps for using it and gotchas you might
|
||||||
want to know.
|
want to know.
|
||||||
|
|
||||||
To turn on remote debugging, pass ``--remote-debug`` to the
|
To turn on remote debugging, pass ``--remote-debug`` to the
|
||||||
``./zerver/frontend/tests/run`` script. This will run the tests with
|
``./frontend_tests/tests/run`` script. This will run the tests with
|
||||||
port ``7777`` open for remote debugging. You can now connect to
|
port ``7777`` open for remote debugging. You can now connect to
|
||||||
``localhost:7777`` in a Webkit browser. Somewhat recent versions of
|
``localhost:7777`` in a Webkit browser. Somewhat recent versions of
|
||||||
Chrome or Safari might be required.
|
Chrome or Safari might be required.
|
||||||
|
@ -114,7 +114,7 @@ bottom of ``foobar.js``:
|
||||||
This makes ``foobar.js`` follow the CommonJS module pattern, so it can
|
This makes ``foobar.js`` follow the CommonJS module pattern, so it can
|
||||||
be required in Node.js, which runs our tests.
|
be required in Node.js, which runs our tests.
|
||||||
|
|
||||||
Now create ``zerver/tests/frontend/node/foobar.js``. At the top, require
|
Now create ``frontend_tests/node/foobar.js``. At the top, require
|
||||||
the `Node.js assert module <http://nodejs.org/api/assert.html>`__, and
|
the `Node.js assert module <http://nodejs.org/api/assert.html>`__, and
|
||||||
the module you're testing, like so:
|
the module you're testing, like so:
|
||||||
|
|
||||||
|
@ -140,7 +140,7 @@ asserts, the *actual* value comes first, the *expected* value second.
|
||||||
}());
|
}());
|
||||||
|
|
||||||
The test runner (index.js) automatically runs all .js files in the
|
The test runner (index.js) automatically runs all .js files in the
|
||||||
zerver/tests/frontend/node directory.
|
frontend_tests/node directory.
|
||||||
|
|
||||||
.. _handling-dependencies:
|
.. _handling-dependencies:
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue