@@ -124,17 +124,13 @@ dj-database-url compatible value.
124
124
Running Frontend Tests
125
125
**********************
126
126
127
- We have two types of frontend tests: unit tests and integration tests.
128
127
For unit tests we are using `Karma <http://karma-runner.github.io/ >`_ as a
129
128
test runner and `Jasmine <http://jasmine.github.io/ >`_ as a test framework.
130
129
131
- Integration tests run on `PhantomJS <http://phantomjs.org/ >`_ and are
132
- built using `CasperJS <http://casperjs.org/ >`_.
133
-
134
130
In order to be able to run them you need to install necessary dependencies as
135
131
outlined in :ref: `frontend tooling installation instructions <contributing_frontend >`.
136
132
137
- Linting runs against the test files as well with ``gulp tests: lint ``. In order
133
+ Linting runs against the test files as well with ``gulp lint ``. In order
138
134
to run linting continuously, do::
139
135
140
136
gulp watch
@@ -145,16 +141,16 @@ Unit tests
145
141
146
142
Unit tests can be run like this::
147
143
148
- gulp tests:unit
144
+ gulp unitTest
149
145
150
146
If your code is failing and you want to run only specific files, you can provide
151
147
the ``--tests `` parameter with comma separated file names, like this::
152
148
153
- gulp tests:unit --tests=cms.base,cms.modal
149
+ gulp unitTest --tests=cms.base,cms.modal
154
150
155
151
If you want to run tests continuously you can use the watch command::
156
152
157
- gulp tests:unit: watch
153
+ gulp unitTest -- watch
158
154
159
155
This will rerun the suite whenever source or test file is changed.
160
156
By default the tests are running on `PhantomJS <http://phantomjs.org/ >`_, but
@@ -171,56 +167,6 @@ the build entirely using ``[skip ci]``.
171
167
We're using Jasmine as a test framework and Istanbul as a code coverage tool.
172
168
173
169
174
- Integration tests
175
- =================
176
-
177
- In order to run integration tests you'll have to install at least the version
178
- of django CMS from the current directory and django-app-helper into into your virtualenv.
179
- All commands should be run from the root of the repository. If you do not have
180
- virtualenv yet, create and activate it first::
181
-
182
- virtualenv env
183
- . env/bin/activate
184
-
185
- Then install minimum required dependencies::
186
-
187
- pip install -r test_requirements/django-1.8.txt
188
- pip install -e .
189
-
190
- Now you'll be able to run a tests with this command::
191
-
192
- gulp tests:integration
193
-
194
- The command will start a server, wait for a minute for the migrations to run
195
- and will run integration tests against it. It will use ``testdb.sqlite `` as the
196
- database. If you want to start with a clean state you could use ``--clean ``
197
- argument.
198
-
199
- Some tests require different server configuration, so it is possible that the
200
- server will stop, and another variation will start with different arguments.
201
- Take a look inside `testserver.py ` if you need to customise the test server
202
- settings.
203
-
204
- While debugging you can use the ``--tests `` parameter as well in order to run test
205
- suites separately.::
206
-
207
- gulp tests:integration --tests=pagetree
208
- gulp tests:integration --tests=loginAdmin,toolbar
209
-
210
- If specified tests require different servers they will be grouped to speed
211
- things up, so the order might not be the same as you specify in the argument.
212
-
213
- When running locally, it sometimes helps to visualise the tests output. For that
214
- you can install `casperjs visual debugging utility <https://github.com/vxsx/casperjs-visual-debugging >`_,
215
- and run the tests with additional ``--visual `` argument. It will try to
216
- communicate with the server and display the progress of the test, which you then
217
- can also rewind.
218
-
219
- It might sometimes be useful not to restart the server when creating the tests,
220
- for that you can run ``python testserver.py `` with necessary arguments in one
221
- shell and ``gulp tests:integration --no-server `` in another. However you would
222
- need to clean the state yourself if the test you've been writing fails.
223
-
224
170
*************
225
171
Writing tests
226
172
*************
0 commit comments