You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically the bundle covered by functional selenium tests
38
+
Basically the bundle covered by unit jest's test and e2e cypress test.
44
39
The main test case is placed in ```Tests/Functional/MainFunctionalTest.php```
45
-
It calls pages which are defined in ```Tests/TestBundles/DefaultTestBundle```
46
-
47
-
The main idea of most tests is:
48
-
1) create an action ```mytestAction``` in ```Tests/TestBundles/DefaultTestBundle/Controller/FunctionalTestsController.php``` with a form that has specified list of validation rules
49
-
1.1) use a general route to call this action ```test/{controller}/{type}/{js}```
50
-
1.2) so, in your action you can get the ```$type``` and ```$js``` parameters
51
-
1.3) ```type``` variable can be used to check if the form should be filled out with valid or invalid data (1/0)
52
-
1.4) ```js``` variable - to check if JS should be enabled or disabled (1/0)
53
-
2) bind valid values to the form (call with ```type = 1```)
54
-
3) call this form with disabled JS (native Symfony validation) and get the list of errors ```test/mytest/1/0``` (1 - form is valid, 0 - js is disabled)
55
-
4) call the form with enabled JS (here works our bundle) and get list of errors ```test/mytest/1/1``` (1 - form is valid, 1- js is enabled)
56
-
5) compare errors from #3 and #4 steps - they should be equal
57
-
6) bind invalid values to the form (call with ```type = 0```)
58
-
7) repeat steps #3, #4, #5 (```test/mytest/0/0``` and ```test/mytest/0/0```)
40
+
Unit tests are placed in main resource folder with suffix ```.test.js```
41
+
e2e test is placed in cypress folder in project root ```cypress/integration/form_spec.js```
59
42
60
-
[How to run tests on a real project](Resources/doc/4.md)
43
+
The main idea of unit tests is covered constrain logic.
44
+
The main idea of e2e test is visit route with example form with all symfony constraint and find used error messages.
61
45
62
46
## Javascripts
63
47
64
48
All the javascripts placed in the ```Resources/pulic/js``` folder
65
-
All of them are merged and included by assetic bundle for the dev/test environments.
66
-
The ```/Resources/public/js/fp_js_validator.js``` file is a merged library that uses as main included file.
67
-
Thera no reason to edit this file becauset it is updated automatically each time when you run dev/test
49
+
All of them are merged and included by assets command to the dev/test environments.
0 commit comments