This repository has been archived by the owner on Jan 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #101 from aldryn/develop
Release 3.4.0
- Loading branch information
Showing
61 changed files
with
953 additions
and
397 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Browsers that we support | ||
|
||
last 2 versions | ||
ie >= 9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
******* | ||
General | ||
******* | ||
|
||
We use two kinds of tests: **unit** and **integration** tests. Unit tests are | ||
simple test cases, that test a single piece of functionality within a given | ||
JavaScript file in an isolated environment without the DOM. Integration tests | ||
test the users interaction following certain move, click and keyboard | ||
interactions. | ||
|
||
This testing infrastructure includes them both with `Jasmine | ||
<http://jasmine.github.io/>`_ as the test suite and `Karma | ||
<http://karma-runner.github.io/>`_ as the test runner for unit tests. | ||
`Protractor <http://www.protractortest.org>`_ serves as the integration tests framework. | ||
Both tests can be run separately as described in :ref:`testing_commands` below. | ||
|
||
All tests are located within ``/tests``. Each pull request is validated on | ||
`Travis <https://github.com/aldryn/aldryn-boilerplate-bootstrap3/blob | ||
/master/.travis.yml>`_, which runs the test executing the ``gulp tests`` | ||
command. You can also run this command locally, if you followed the | ||
:doc:`/general/installation` instructions. | ||
|
||
.. _testing_commands: | ||
|
||
Commands | ||
======== | ||
|
||
The following commands are available to you: | ||
|
||
- ``gulp tests`` runs the entire test suite | ||
- ``gulp tests:unit`` only runs the unit tests | ||
- ``gulp tests:integration`` only runs the integration tests | ||
- ``gulp tests:watch`` to start karma to watch unit tests | ||
|
||
|
||
Naming | ||
====== | ||
|
||
The naming for tests should adhere to the conventions established in | ||
:doc:`/guidelines/general` and :doc:`/guidelines/javascript`. | ||
|
||
**Unit tests** should be prefixed using ``test`` before the name file name and | ||
**integration tests** use ``spec``. For example: | ||
|
||
.. code-block:: text | ||
test.header.js | ||
test.footer.js | ||
test.content.typography.js | ||
test.content.wysiwyg.js | ||
... | ||
.. code-block:: text | ||
spec.header.js | ||
spec.footer.js | ||
spec.content.typography.js | ||
spec.content.wysiwyg.js | ||
... | ||
Structure | ||
========= | ||
|
||
Unit tests are located within ``/tests/unit`` and integration tests within | ||
``/tests/integration`` to create a clear separation. There are several | ||
configuration files available within the ``/tests`` directory described in | ||
:doc:`/testing/unit_tests` and :doc:`/testing/integration_tests` respectively. | ||
|
||
The starting structure looks like this: | ||
|
||
.. code-block:: text | ||
tests/ | ||
├─ fixtures/ | ||
├─ integration/ | ||
├─ unit/ | ||
├─ base.conf.js | ||
├─ karma.conf.js | ||
└─ protractor.conf.js | ||
Fixtures and coverage are described in more depth within | ||
:doc:`/testing/unit_tests`. | ||
|
||
|
||
Configuration | ||
============= | ||
|
||
The configuration files are located at the root of the ``/tests`` folder. | ||
``karma.conf.js`` defines the settings for the ``gulp tests:unit`` command and | ||
``protractor.conf.js`` for the ``gulp tests:integration`` command. | ||
|
||
The function of these configuration files is described in more depth within | ||
:doc:`/testing/unit_tests` or :doc:`/testing/integration_tests`. | ||
|
||
Browserslist | ||
============ | ||
|
||
`Browserslist <https://github.com/ai/browserslist>`_ enables us to provide a | ||
compiled and ready to use browser-list to services such as Sauce Labs, | ||
Autoprefixer and more. | ||
|
||
Simply add the required browser to the ``browserslist`` file. Our configuration | ||
includes the `last 2 versions` and `ie >= 9`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
***************** | ||
Integration Tests | ||
***************** | ||
|
||
|
||
Configuration | ||
============= | ||
|
||
The main configuration file to look at is ``/tests/protractor.conf.js``. | ||
It configures our ``browserName``. | ||
|
||
In ``browserName`` we specify the browser that will be used to launch the tests. | ||
It can be set to ``phantomjs``, ``firefox`` or ``chrome``. | ||
|
||
You can find more information about this in the | ||
`protractor referenceConf.js | ||
<https://github.com/angular/protractor/blob/master/docs/referenceConf.js>`_ documentation. | ||
|
||
All spec files should be placed in ``/tests/integration/specs`` and all page | ||
object files should be in ``/tests/integration/pages``. So, the file organisation | ||
structure is: | ||
|
||
.. code-block:: text | ||
tests/ | ||
└─ integration/ | ||
├─ specs/ | ||
│ ├─ spec.name.js | ||
│ └─ spec.another.name.js | ||
└─ pages/ | ||
├─ page.name.js | ||
└─ page.another.name.js | ||
The specs that will be launched are defined in the ``gulpfile.js``. They can be | ||
specified using patterns: | ||
|
||
.. code-block:: javascript | ||
return gulp.src([PROJECT_PATH.tests + '/integration/specs/*.js']) | ||
By default all specs inside ``/tests/integration/specs`` folder will be launched. | ||
|
||
|
||
Coverage | ||
======== | ||
|
||
Integration coverage is measured by the number of critical path or regression | ||
test cases that were automated. Keep in mind that the success of your project | ||
does not depend on the tests or the percentage of your code coverage, but it | ||
will improve maintenance and give you and other contributors more confidence in | ||
the quality of the product you produce. We should aim for the highest possible | ||
coverage and quality. |
Oops, something went wrong.