Skip to content

Commit 6310a9b

Browse files
authored
Update docs for frontend testing (#7726)
1 parent 63b614d commit 6310a9b

File tree

2 files changed

+5
-59
lines changed

2 files changed

+5
-59
lines changed

docs/contributing/code.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ Frontend
127127
In order to be able to work with the frontend tooling contributing to the
128128
django CMS you need to have the following dependencies installed:
129129

130-
1. `Node <https://nodejs.org/>`_ version 6.10.1 (will install npm 3.10.10 as well).
130+
1. `Node <https://nodejs.org/>`_ version 18.19.0 (will install npm 10.2.3 as well).
131131
We recommend using `NVM <https://github.com/creationix/nvm>`_ to get
132132
the correct version of Node.
133133
2. gulp - see `Gulp's Getting Started notes <https://github.com/gulpjs/gulp/blob/master/docs/getting-started.md>`_

docs/contributing/testing.rst

Lines changed: 4 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -124,17 +124,13 @@ dj-database-url compatible value.
124124
Running Frontend Tests
125125
**********************
126126

127-
We have two types of frontend tests: unit tests and integration tests.
128127
For unit tests we are using `Karma <http://karma-runner.github.io/>`_ as a
129128
test runner and `Jasmine <http://jasmine.github.io/>`_ as a test framework.
130129

131-
Integration tests run on `PhantomJS <http://phantomjs.org/>`_ and are
132-
built using `CasperJS <http://casperjs.org/>`_.
133-
134130
In order to be able to run them you need to install necessary dependencies as
135131
outlined in :ref:`frontend tooling installation instructions <contributing_frontend>`.
136132

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
138134
to run linting continuously, do::
139135

140136
gulp watch
@@ -145,16 +141,16 @@ Unit tests
145141

146142
Unit tests can be run like this::
147143

148-
gulp tests:unit
144+
gulp unitTest
149145

150146
If your code is failing and you want to run only specific files, you can provide
151147
the ``--tests`` parameter with comma separated file names, like this::
152148

153-
gulp tests:unit --tests=cms.base,cms.modal
149+
gulp unitTest --tests=cms.base,cms.modal
154150

155151
If you want to run tests continuously you can use the watch command::
156152

157-
gulp tests:unit:watch
153+
gulp unitTest --watch
158154

159155
This will rerun the suite whenever source or test file is changed.
160156
By default the tests are running on `PhantomJS <http://phantomjs.org/>`_, but
@@ -171,56 +167,6 @@ the build entirely using ``[skip ci]``.
171167
We're using Jasmine as a test framework and Istanbul as a code coverage tool.
172168

173169

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-
224170
*************
225171
Writing tests
226172
*************

0 commit comments

Comments
 (0)