Browse Source

Added test execution in Firefox.

This adds capturing and executing tests in the Firefox browser. It also
adds the use of the jasmine-jquery framework to permit easier detection
of DOM elements in a rendered directive, as the present method does not
play well with Firefox' tendency to randomly reorder attribute positions.

Testing with Firefox is already supported in infra.

Change-Id: Ifc81e1b243975536ee40e627c1e4a164855fe85c
changes/66/192366/3
Michael Krotscheck 3 years ago
parent
commit
4beaf29f6e
3 changed files with 13 additions and 9 deletions
  1. 5
    3
      karma-unit.conf.js
  2. 1
    1
      merlin/test/js/directivesSpec.js
  3. 7
    5
      package.json

+ 5
- 3
karma-unit.conf.js View File

@@ -23,15 +23,17 @@ module.exports = function (config) {
23 23
 
24 24
     basePath: '',
25 25
 
26
-    frameworks: ['jasmine'],
26
+    frameworks: ['jasmine-jquery','jasmine'],
27 27
 
28
-    browsers: [ 'PhantomJS', 'Chrome'],
28
+    browsers: [ 'PhantomJS', 'Chrome', 'Firefox'],
29 29
 
30 30
     plugins: [
31 31
       'karma-jasmine',
32 32
       'karma-phantomjs-launcher',
33 33
       'karma-chrome-launcher',
34
-      'karma-ng-html2js-preprocessor'
34
+      'karma-firefox-launcher',
35
+      'karma-ng-html2js-preprocessor',
36
+      'karma-jasmine-jquery'
35 37
     ],
36 38
 
37 39
     files: [

+ 1
- 1
merlin/test/js/directivesSpec.js View File

@@ -245,7 +245,7 @@ describe('merlin directives', function() {
245 245
       $scope.$digest();
246 246
 
247 247
       expect(element1.html()).toContain('<textarea');
248
-      expect(element2.html()).toContain('<input type="number"');
248
+      expect(element2).toContainElement('input[type=number]');
249 249
     });
250 250
 
251 251
     it('field is not rendered until the corresponding template has been served', function() {

+ 7
- 5
package.json View File

@@ -9,6 +9,8 @@
9 9
     "grunt-cli": "0.1.13",
10 10
     "grunt-connect-proxy": "0.1.11",
11 11
     "grunt-contrib-clean": "0.6.0",
12
+    "grunt-contrib-concat": "0.5.1",
13
+    "grunt-contrib-uglify": "0.8.1",
12 14
     "grunt-contrib-watch": "0.6.1",
13 15
     "grunt-env": "0.4.1",
14 16
     "grunt-eslint": "7.0.1",
@@ -19,16 +21,16 @@
19 21
     "grunt-shell": "1.1.1",
20 22
     "grunt-usemin": "2.4.0",
21 23
     "grunt-webfont": "0.4.8",
22
-    "grunt-contrib-concat": "0.5.1",
23
-    "grunt-contrib-uglify": "0.8.1",
24
-    "grunt-karma": "0.10.1",
25 24
     "jasmine-core": "^2.2.0",
25
+    "jasmine-jquery": "2.1.0",
26 26
     "karma": "0.12.31",
27 27
     "karma-chrome-launcher": "0.1.12",
28 28
     "karma-cli": "0.0.4",
29
+    "karma-firefox-launcher": "^0.1.6",
29 30
     "karma-jasmine": "0.3.5",
30
-    "karma-phantomjs-launcher": "0.1.4",
31
-    "karma-ng-html2js-preprocessor": "0.1"
31
+    "karma-jasmine-jquery": "0.1.1",
32
+    "karma-ng-html2js-preprocessor": "0.1",
33
+    "karma-phantomjs-launcher": "0.1.4"
32 34
   },
33 35
   "main": "Gruntfile.js",
34 36
   "dependencies": {

Loading…
Cancel
Save