openatc-components 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/.babelrc +18 -18
  2. package/.editorconfig +9 -9
  3. package/.eslintignore +5 -5
  4. package/.eslintrc.js +29 -29
  5. package/.postcssrc.js +10 -10
  6. package/README.md +30 -30
  7. package/build/build.js +41 -41
  8. package/build/check-versions.js +54 -54
  9. package/build/package.config.js +58 -58
  10. package/build/package.dev.config.js +25 -25
  11. package/build/package.prod.config.js +60 -60
  12. package/build/utils.js +101 -101
  13. package/build/vue-loader.conf.js +22 -22
  14. package/build/webpack.base.conf.js +109 -109
  15. package/build/webpack.dev.conf.js +95 -95
  16. package/build/webpack.prod.conf.js +149 -149
  17. package/config/dev.env.js +7 -7
  18. package/config/index.js +76 -76
  19. package/config/prod.env.js +4 -4
  20. package/config/test.env.js +7 -7
  21. package/index.html +12 -12
  22. package/package/kisscomps/components/CircleMenu/KissCircleMenu.vue +398 -398
  23. package/package/kisscomps/components/CircleMenu/index.js +2 -2
  24. package/package/kisscomps/components/DashBoard/MakeGradientColor.js +84 -84
  25. package/package/kisscomps/components/DashBoard/dashboard.js +471 -471
  26. package/package/kisscomps/components/DashBoard/dashboard.vue +57 -57
  27. package/package/kisscomps/components/DashBoard/index.js +2 -2
  28. package/package/kisscomps/components/Horizontal/KissHorizontal.vue +146 -146
  29. package/package/kisscomps/components/Horizontal/index.js +2 -2
  30. package/package/kisscomps/components/HorizontalChildren/KissHorizontalChildren.vue +196 -196
  31. package/package/kisscomps/components/HorizontalChildren/index.js +2 -2
  32. package/package/kisscomps/components/KissCircleMenu/CircleMenu.vue +113 -113
  33. package/package/kisscomps/components/KissCircleMenu/index.js +2 -2
  34. package/package/kisscomps/components/KissCircleMenu/style/index.less +1 -1
  35. package/package/kisscomps/components/KissCircleMenu/style/main/core.less +161 -161
  36. package/package/kisscomps/components/KissCircleMenu/style/main/other.less +94 -94
  37. package/package/kisscomps/components/KissCircleMenu/style/mixin/mixin.less +36 -36
  38. package/package/kisscomps/components/KissCircleMenu/style/var/var.less +21 -21
  39. package/package/kisscomps/components/KissCircleMenu/utils/colorRE.js +5 -5
  40. package/package/kisscomps/components/KissMessageBox/KissMessageBox.vue +108 -108
  41. package/package/kisscomps/components/KissMessageBox/index.js +2 -2
  42. package/package/kisscomps/components/KissSearchInput/index.js +2 -2
  43. package/package/kisscomps/components/KissSearchInput/kisssearchinput.vue +77 -77
  44. package/package/kisscomps/components/KissSimulationProgress/KissSimulationProgress.vue +294 -294
  45. package/package/kisscomps/components/KissSimulationProgress/index.js +2 -2
  46. package/package/kisscomps/components/StatusBar/StatusBar.vue +222 -222
  47. package/package/kisscomps/components/StatusBar/index.js +2 -2
  48. package/package/kisscomps/components/TragResize/index.js +2 -2
  49. package/package/kisscomps/components/TragResize/kissdragresize.vue +536 -536
  50. package/package/kisscomps/components/TragResize/util/dom.js +23 -23
  51. package/package/kisscomps/components/TragResize/util/fns.js +3 -3
  52. package/package/kisscomps/components/XRDDirSelector/XRDDirSelector.1.vue +320 -320
  53. package/package/kisscomps/components/XRDDirSelector/XRDDirSelector.vue +345 -345
  54. package/package/kisscomps/components/XRDDirSelector/index.js +2 -2
  55. package/package/kisscomps/components/button/index.js +2 -2
  56. package/package/kisscomps/components/button/kissbutton.vue +168 -168
  57. package/package/kisscomps/components/compass3D/compass.vue +180 -180
  58. package/package/kisscomps/components/compass3D/index.js +2 -2
  59. package/package/kisscomps/components/header/index.js +2 -2
  60. package/package/kisscomps/components/header/kissHead.vue +83 -83
  61. package/package/kisscomps/components/horizontalMenu/index.js +2 -2
  62. package/package/kisscomps/components/horizontalMenu/kissHorizontalMenu.vue +254 -254
  63. package/package/kisscomps/components/input/index.js +2 -2
  64. package/package/kisscomps/components/input/kissinput.vue +57 -57
  65. package/package/kisscomps/components/menu/index.js +2 -2
  66. package/package/kisscomps/components/menu/kissmenu.vue +324 -324
  67. package/package/kisscomps/components/mutipletips/Tdrag.js +585 -585
  68. package/package/kisscomps/components/mutipletips/index.js +2 -2
  69. package/package/kisscomps/components/mutipletips/kissmutipletips.vue +192 -192
  70. package/package/kisscomps/components/panel/index.js +2 -2
  71. package/package/kisscomps/components/panel/kissPanel.vue +151 -151
  72. package/package/kisscomps/components/select/chosen.jquery.min.js +3 -3
  73. package/package/kisscomps/components/select/index.js +2 -2
  74. package/package/kisscomps/components/select/kissselect.vue +527 -527
  75. package/package/kisscomps/components/tablebutton/index.js +2 -2
  76. package/package/kisscomps/components/tablebutton/tablebutton.vue +97 -97
  77. package/package/kisscomps/components/timectrl/KissTimeCtrl.vue +67 -67
  78. package/package/kisscomps/components/timectrl/index.js +2 -2
  79. package/package/kisscomps/components/timectrl/timectrl.css +851 -851
  80. package/package/kisscomps/components/tip/Tdrag.js +585 -585
  81. package/package/kisscomps/components/tip/index.js +2 -2
  82. package/package/kisscomps/components/tip/kisstips.1.vue +154 -154
  83. package/package/kisscomps/components/tip/kisstips.vue +154 -154
  84. package/package/kisscomps/components/tip/kisstips.vue.bak +211 -211
  85. package/package/kisscomps/index.js +71 -71
  86. package/package/kissui.js +203 -203
  87. package/package/kissui.min.js +203 -203
  88. package/package.json +1 -1
  89. package/src/App.vue +25 -25
  90. package/src/kisscomps/components/CircleMenu/KissCircleMenu.vue +398 -398
  91. package/src/kisscomps/components/CircleMenu/index.js +2 -2
  92. package/src/kisscomps/components/DashBoard/MakeGradientColor.js +84 -84
  93. package/src/kisscomps/components/DashBoard/dashboard.js +471 -471
  94. package/src/kisscomps/components/DashBoard/dashboard.vue +57 -57
  95. package/src/kisscomps/components/DashBoard/index.js +2 -2
  96. package/src/kisscomps/components/KissCircleMenu/CircleMenu.vue +113 -113
  97. package/src/kisscomps/components/KissCircleMenu/index.js +2 -2
  98. package/src/kisscomps/components/KissCircleMenu/style/index.less +1 -1
  99. package/src/kisscomps/components/KissCircleMenu/style/main/core.less +161 -161
  100. package/src/kisscomps/components/KissCircleMenu/style/main/other.less +94 -94
  101. package/src/kisscomps/components/KissCircleMenu/style/mixin/mixin.less +36 -36
  102. package/src/kisscomps/components/KissCircleMenu/style/var/var.less +21 -21
  103. package/src/kisscomps/components/KissCircleMenu/utils/colorRE.js +5 -5
  104. package/src/kisscomps/components/KissSearchInput/index.js +2 -2
  105. package/src/kisscomps/components/KissSearchInput/kisssearchinput.vue +77 -77
  106. package/src/kisscomps/components/SchemeConfig/closePhaselControlModal/index.vue +193 -0
  107. package/src/kisscomps/components/SchemeConfig/index.js +2 -0
  108. package/src/kisscomps/components/SchemeConfig/lockingPhaselControlModal/index.vue +214 -0
  109. package/src/kisscomps/components/SchemeConfig/manualControlModal/index.vue +176 -0
  110. package/src/kisscomps/components/SchemeConfig/realtimeStatusModal/index.vue +294 -0
  111. package/src/kisscomps/components/SchemeConfig/schemeconfig.vue +711 -0
  112. package/src/kisscomps/components/StatusBar/StatusBar.vue +222 -222
  113. package/src/kisscomps/components/StatusBar/index.js +2 -2
  114. package/src/kisscomps/components/TragResize/index.js +2 -2
  115. package/src/kisscomps/components/TragResize/kissdragresize.vue +536 -536
  116. package/src/kisscomps/components/XRDDirSelector/XRDDirSelector.1.vue +320 -320
  117. package/src/kisscomps/components/XRDDirSelector/XRDDirSelector.vue +345 -345
  118. package/src/kisscomps/components/XRDDirSelector/index.js +2 -2
  119. package/src/kisscomps/components/button/index.js +2 -2
  120. package/src/kisscomps/components/button/kissbutton.vue +168 -168
  121. package/src/kisscomps/components/compass3D/compass.vue +180 -180
  122. package/src/kisscomps/components/compass3D/index.js +2 -2
  123. package/src/kisscomps/components/horizontalMenu/index.js +2 -2
  124. package/src/kisscomps/components/horizontalMenu/kissHorizontalMenu.vue +254 -254
  125. package/src/kisscomps/components/input/index.js +2 -2
  126. package/src/kisscomps/components/input/kissinput.vue +57 -57
  127. package/src/kisscomps/components/menu/index.js +2 -2
  128. package/src/kisscomps/components/menu/kissmenu.vue +324 -324
  129. package/src/kisscomps/components/mutipletips/Tdrag.js +585 -585
  130. package/src/kisscomps/components/mutipletips/index.js +2 -2
  131. package/src/kisscomps/components/mutipletips/kissmutipletips.vue +192 -192
  132. package/src/kisscomps/components/select/chosen.jquery.min.js +3 -3
  133. package/src/kisscomps/components/select/index.js +2 -2
  134. package/src/kisscomps/components/select/kissselect.vue +527 -527
  135. package/src/kisscomps/components/timectrl/KissTimeCtrl.vue +67 -67
  136. package/src/kisscomps/components/timectrl/index.js +2 -2
  137. package/src/kisscomps/components/tip/Tdrag.js +585 -585
  138. package/src/kisscomps/components/tip/index.js +2 -2
  139. package/src/kisscomps/components/tip/kisstips.1.vue +154 -154
  140. package/src/kisscomps/components/tip/kisstips.vue +154 -154
  141. package/src/kisscomps/components/tip/kisstips.vue.bak +211 -211
  142. package/src/kisscomps/index.js +73 -71
  143. package/src/main.js +23 -23
  144. package/src/router/index.js +15 -15
  145. package/src/views/home.1.vue +479 -479
  146. package/src/views/home.vue +196 -196
  147. package/test/e2e/custom-assertions/elementCount.js +27 -27
  148. package/test/e2e/nightwatch.conf.js +46 -46
  149. package/test/e2e/runner.js +48 -48
  150. package/test/e2e/specs/test.js +19 -19
  151. package/test/unit/.eslintrc +7 -7
  152. package/test/unit/jest.conf.js +30 -30
  153. package/test/unit/setup.js +3 -3
  154. package/test/unit/specs/HelloWorld.spec.js +11 -11
@@ -1,196 +1,196 @@
1
- <template>
2
- <div class="wrap">
3
- <kiss-button></kiss-button>
4
- <xdr-dir-selector Width="300px"
5
- Height="300px"
6
- :showlist="dirshow"></xdr-dir-selector>
7
-
8
- <div style="height:100px">
9
- <kiss-horizontal :datalist="datalist"
10
- :mainwidth="mainwidth1"
11
- :mainheight="mainheight1"
12
- :display="display"
13
- horizontalDistance="3px">
14
- <div class="phase-description"
15
- slot="fatherslot">
16
- <xdr-dir-selector Width="23px"
17
- Height="23px"
18
- :showlist="dirshow"></xdr-dir-selector>
19
- </div>
20
- </kiss-horizontal>
21
- </div>
22
- <div style="height:100%">
23
- <kiss-horizontalchildren
24
- :name="name[2]"
25
- :dataList="list1"
26
- :display="display"
27
- mainheight="50px"
28
- backColor="#366069"
29
- horizontalDistance="3px">
30
- <div class="phase-description"
31
- slot="leftslot">
32
- <xdr-dir-selector Width="23px"
33
- Height="23px"
34
- :showlist="dirshow"></xdr-dir-selector>
35
- </div>
36
- <!-- <div slot="leftslot" style="color: #fff; text-align:center; background: #0a4958; width: 25px; height: 23px;">55</div> -->
37
- </kiss-horizontalchildren>
38
- <kiss-horizontalchildren :name="name[0]"
39
- :dataList="list2"
40
- :display="display"
41
- mainheight="50px"
42
- backColor="rgba(87, 108, 113, 0.2)"
43
- horizontalDistance="3px">
44
- <div class="phase-description"
45
- slot="leftslot">
46
- <xdr-dir-selector Width="23px"
47
- Height="23px"
48
- :showlist="dirshow"></xdr-dir-selector>
49
- </div>
50
- <!-- <div slot="leftslot" style="color: #fff; text-align:center; background: #0a4958; width: 25px; height: 23px;">55</div> -->
51
- </kiss-horizontalchildren>
52
- <kiss-horizontalchildren :name="name[1]"
53
- :dataList="list3"
54
- :display="display"
55
- mainheight="50px"
56
- horizontalDistance="10px">
57
- <div style="position: relative" slot="leftslot">
58
- <div class="phase-description">
59
- <xdr-dir-selector Width="23px"
60
- Height="23px"
61
- :showlist="dirshow"></xdr-dir-selector>
62
- </div>
63
- </div>
64
- </kiss-horizontalchildren>
65
- <kiss-simulation-progress :curseconds="curseconds" :totalseconds="totalseconds" :starttime="starttime" :endtime="endtime"></kiss-simulation-progress>
66
- </div>
67
- </div>
68
- </template>
69
-
70
- <script>
71
- export default {
72
- data () {
73
- return {
74
- dirshow: [
75
- {
76
- id: 1,
77
- color: '#77FB65'
78
- }, {
79
- id: 2,
80
- color: '#E24B4B'
81
- }
82
- ],
83
- datalist: [
84
- {
85
- value: 5,
86
- name: '测试',
87
- color: '#77FB65'
88
- },
89
- {
90
- value: 1,
91
- name: '吃饭'
92
- }
93
- ],
94
- mainwidth1: '400px',
95
- mainheight1: '25px',
96
- mainwidth: '400px',
97
- mainheight: '25px',
98
- display: true,
99
- name: ['曹操', '刘备', '孙权'],
100
- list1: [{value: 39, maxNum: 50}],
101
- list2: [{value: 55, maxNum: 50}],
102
- list3: [{value: 7, maxNum: 10, color: 'red'}, {value: 80, maxNum: 100}],
103
- progressPercentage: 0,
104
- curseconds: 0,
105
- totalseconds: 86400,
106
- starttime: '2019-04-25 00:00:00',
107
- endtime: '2019-04-26 00:00:00'
108
- }
109
- },
110
- methods: {
111
- },
112
- watch: {
113
- },
114
- mounted () {
115
- }
116
- }
117
- </script>
118
- <style scoped>
119
- .wrap {
120
- /* background: #333333; */
121
- width: 100%;
122
- height: 100%;
123
- }
124
- .zindex {
125
- position: absolute;
126
- z-index: -1;
127
- }
128
- .select-containaer {
129
- float: left;
130
- margin: 0;
131
- padding: 0;
132
- width: 200px;
133
- height: 300px;
134
- }
135
-
136
- .functionLayout {
137
- position: fixed;
138
- top: 100px;
139
- width: 80px;
140
- height: 550px;
141
- }
142
- .test {
143
- width: 100px;
144
- height: 100px;
145
- left: 300px;
146
- top: 300xp;
147
- margin-left: 300px;
148
- }
149
- .leftpart > div {
150
- float: left;
151
- line-height: 50px;
152
- }
153
- .phase-description {
154
- /* background: #43b4cf;
155
- width: 25px;
156
- height: 23px; */
157
-
158
- /* width: 18px;
159
- height: 30px;
160
- background: yellow;
161
- position: absolute;
162
- top: 0;
163
- left: 9px; */
164
- width: 34px;
165
- height: 30px;
166
- background: url('../kisscomps/components/image/phaseHexagon/phasebg.png');
167
- background-size: 34px 30px;
168
- box-sizing: border-box;
169
- padding-left: 5px;
170
- padding-top: 4px;
171
- }
172
- /* .phase-description::before {
173
- content: "";
174
- width: 0;
175
- height: 0;
176
- border-right: 9px yellow solid;
177
- border-left: none;
178
- border-top: 15px solid transparent;
179
- border-bottom: 15px solid transparent;
180
- position: absolute;
181
- top: 0;
182
- left: -9px;
183
- }
184
- .phase-description::after {
185
- content: "";
186
- width: 0;
187
- height: 0;
188
- border-left: 9px yellow solid;
189
- border-right: none;
190
- border-top: 15px solid transparent;
191
- border-bottom: 15px solid transparent;
192
- position: absolute;
193
- top: 0;
194
- right: -9px;
195
- } */
196
- </style>
1
+ <template>
2
+ <div class="wrap">
3
+ <kiss-button></kiss-button>
4
+ <xdr-dir-selector Width="300px"
5
+ Height="300px"
6
+ :showlist="dirshow"></xdr-dir-selector>
7
+
8
+ <div style="height:100px">
9
+ <kiss-horizontal :datalist="datalist"
10
+ :mainwidth="mainwidth1"
11
+ :mainheight="mainheight1"
12
+ :display="display"
13
+ horizontalDistance="3px">
14
+ <div class="phase-description"
15
+ slot="fatherslot">
16
+ <xdr-dir-selector Width="23px"
17
+ Height="23px"
18
+ :showlist="dirshow"></xdr-dir-selector>
19
+ </div>
20
+ </kiss-horizontal>
21
+ </div>
22
+ <div style="height:100%">
23
+ <kiss-horizontalchildren
24
+ :name="name[2]"
25
+ :dataList="list1"
26
+ :display="display"
27
+ mainheight="50px"
28
+ backColor="#366069"
29
+ horizontalDistance="3px">
30
+ <div class="phase-description"
31
+ slot="leftslot">
32
+ <xdr-dir-selector Width="23px"
33
+ Height="23px"
34
+ :showlist="dirshow"></xdr-dir-selector>
35
+ </div>
36
+ <!-- <div slot="leftslot" style="color: #fff; text-align:center; background: #0a4958; width: 25px; height: 23px;">55</div> -->
37
+ </kiss-horizontalchildren>
38
+ <kiss-horizontalchildren :name="name[0]"
39
+ :dataList="list2"
40
+ :display="display"
41
+ mainheight="50px"
42
+ backColor="rgba(87, 108, 113, 0.2)"
43
+ horizontalDistance="3px">
44
+ <div class="phase-description"
45
+ slot="leftslot">
46
+ <xdr-dir-selector Width="23px"
47
+ Height="23px"
48
+ :showlist="dirshow"></xdr-dir-selector>
49
+ </div>
50
+ <!-- <div slot="leftslot" style="color: #fff; text-align:center; background: #0a4958; width: 25px; height: 23px;">55</div> -->
51
+ </kiss-horizontalchildren>
52
+ <kiss-horizontalchildren :name="name[1]"
53
+ :dataList="list3"
54
+ :display="display"
55
+ mainheight="50px"
56
+ horizontalDistance="10px">
57
+ <div style="position: relative" slot="leftslot">
58
+ <div class="phase-description">
59
+ <xdr-dir-selector Width="23px"
60
+ Height="23px"
61
+ :showlist="dirshow"></xdr-dir-selector>
62
+ </div>
63
+ </div>
64
+ </kiss-horizontalchildren>
65
+ <kiss-simulation-progress :curseconds="curseconds" :totalseconds="totalseconds" :starttime="starttime" :endtime="endtime"></kiss-simulation-progress>
66
+ </div>
67
+ </div>
68
+ </template>
69
+
70
+ <script>
71
+ export default {
72
+ data () {
73
+ return {
74
+ dirshow: [
75
+ {
76
+ id: 1,
77
+ color: '#77FB65'
78
+ }, {
79
+ id: 2,
80
+ color: '#E24B4B'
81
+ }
82
+ ],
83
+ datalist: [
84
+ {
85
+ value: 5,
86
+ name: '测试',
87
+ color: '#77FB65'
88
+ },
89
+ {
90
+ value: 1,
91
+ name: '吃饭'
92
+ }
93
+ ],
94
+ mainwidth1: '400px',
95
+ mainheight1: '25px',
96
+ mainwidth: '400px',
97
+ mainheight: '25px',
98
+ display: true,
99
+ name: ['曹操', '刘备', '孙权'],
100
+ list1: [{value: 39, maxNum: 50}],
101
+ list2: [{value: 55, maxNum: 50}],
102
+ list3: [{value: 7, maxNum: 10, color: 'red'}, {value: 80, maxNum: 100}],
103
+ progressPercentage: 0,
104
+ curseconds: 0,
105
+ totalseconds: 86400,
106
+ starttime: '2019-04-25 00:00:00',
107
+ endtime: '2019-04-26 00:00:00'
108
+ }
109
+ },
110
+ methods: {
111
+ },
112
+ watch: {
113
+ },
114
+ mounted () {
115
+ }
116
+ }
117
+ </script>
118
+ <style scoped>
119
+ .wrap {
120
+ /* background: #333333; */
121
+ width: 100%;
122
+ height: 100%;
123
+ }
124
+ .zindex {
125
+ position: absolute;
126
+ z-index: -1;
127
+ }
128
+ .select-containaer {
129
+ float: left;
130
+ margin: 0;
131
+ padding: 0;
132
+ width: 200px;
133
+ height: 300px;
134
+ }
135
+
136
+ .functionLayout {
137
+ position: fixed;
138
+ top: 100px;
139
+ width: 80px;
140
+ height: 550px;
141
+ }
142
+ .test {
143
+ width: 100px;
144
+ height: 100px;
145
+ left: 300px;
146
+ top: 300xp;
147
+ margin-left: 300px;
148
+ }
149
+ .leftpart > div {
150
+ float: left;
151
+ line-height: 50px;
152
+ }
153
+ .phase-description {
154
+ /* background: #43b4cf;
155
+ width: 25px;
156
+ height: 23px; */
157
+
158
+ /* width: 18px;
159
+ height: 30px;
160
+ background: yellow;
161
+ position: absolute;
162
+ top: 0;
163
+ left: 9px; */
164
+ width: 34px;
165
+ height: 30px;
166
+ background: url('../kisscomps/components/image/phaseHexagon/phasebg.png');
167
+ background-size: 34px 30px;
168
+ box-sizing: border-box;
169
+ padding-left: 5px;
170
+ padding-top: 4px;
171
+ }
172
+ /* .phase-description::before {
173
+ content: "";
174
+ width: 0;
175
+ height: 0;
176
+ border-right: 9px yellow solid;
177
+ border-left: none;
178
+ border-top: 15px solid transparent;
179
+ border-bottom: 15px solid transparent;
180
+ position: absolute;
181
+ top: 0;
182
+ left: -9px;
183
+ }
184
+ .phase-description::after {
185
+ content: "";
186
+ width: 0;
187
+ height: 0;
188
+ border-left: 9px yellow solid;
189
+ border-right: none;
190
+ border-top: 15px solid transparent;
191
+ border-bottom: 15px solid transparent;
192
+ position: absolute;
193
+ top: 0;
194
+ right: -9px;
195
+ } */
196
+ </style>
@@ -1,27 +1,27 @@
1
- // A custom Nightwatch assertion.
2
- // The assertion name is the filename.
3
- // Example usage:
4
- //
5
- // browser.assert.elementCount(selector, count)
6
- //
7
- // For more information on custom assertions see:
8
- // http://nightwatchjs.org/guide#writing-custom-assertions
9
-
10
- exports.assertion = function (selector, count) {
11
- this.message = 'Testing if element <' + selector + '> has count: ' + count
12
- this.expected = count
13
- this.pass = function (val) {
14
- return val === this.expected
15
- }
16
- this.value = function (res) {
17
- return res.value
18
- }
19
- this.command = function (cb) {
20
- var self = this
21
- return this.api.execute(function (selector) {
22
- return document.querySelectorAll(selector).length
23
- }, [selector], function (res) {
24
- cb.call(self, res)
25
- })
26
- }
27
- }
1
+ // A custom Nightwatch assertion.
2
+ // The assertion name is the filename.
3
+ // Example usage:
4
+ //
5
+ // browser.assert.elementCount(selector, count)
6
+ //
7
+ // For more information on custom assertions see:
8
+ // http://nightwatchjs.org/guide#writing-custom-assertions
9
+
10
+ exports.assertion = function (selector, count) {
11
+ this.message = 'Testing if element <' + selector + '> has count: ' + count
12
+ this.expected = count
13
+ this.pass = function (val) {
14
+ return val === this.expected
15
+ }
16
+ this.value = function (res) {
17
+ return res.value
18
+ }
19
+ this.command = function (cb) {
20
+ var self = this
21
+ return this.api.execute(function (selector) {
22
+ return document.querySelectorAll(selector).length
23
+ }, [selector], function (res) {
24
+ cb.call(self, res)
25
+ })
26
+ }
27
+ }
@@ -1,46 +1,46 @@
1
- require('babel-register')
2
- var config = require('../../config')
3
-
4
- // http://nightwatchjs.org/gettingstarted#settings-file
5
- module.exports = {
6
- src_folders: ['test/e2e/specs'],
7
- output_folder: 'test/e2e/reports',
8
- custom_assertions_path: ['test/e2e/custom-assertions'],
9
-
10
- selenium: {
11
- start_process: true,
12
- server_path: require('selenium-server').path,
13
- host: '127.0.0.1',
14
- port: 4444,
15
- cli_args: {
16
- 'webdriver.chrome.driver': require('chromedriver').path
17
- }
18
- },
19
-
20
- test_settings: {
21
- default: {
22
- selenium_port: 4444,
23
- selenium_host: 'localhost',
24
- silent: true,
25
- globals: {
26
- devServerURL: 'http://localhost:' + (process.env.PORT || config.dev.port)
27
- }
28
- },
29
-
30
- chrome: {
31
- desiredCapabilities: {
32
- browserName: 'chrome',
33
- javascriptEnabled: true,
34
- acceptSslCerts: true
35
- }
36
- },
37
-
38
- firefox: {
39
- desiredCapabilities: {
40
- browserName: 'firefox',
41
- javascriptEnabled: true,
42
- acceptSslCerts: true
43
- }
44
- }
45
- }
46
- }
1
+ require('babel-register')
2
+ var config = require('../../config')
3
+
4
+ // http://nightwatchjs.org/gettingstarted#settings-file
5
+ module.exports = {
6
+ src_folders: ['test/e2e/specs'],
7
+ output_folder: 'test/e2e/reports',
8
+ custom_assertions_path: ['test/e2e/custom-assertions'],
9
+
10
+ selenium: {
11
+ start_process: true,
12
+ server_path: require('selenium-server').path,
13
+ host: '127.0.0.1',
14
+ port: 4444,
15
+ cli_args: {
16
+ 'webdriver.chrome.driver': require('chromedriver').path
17
+ }
18
+ },
19
+
20
+ test_settings: {
21
+ default: {
22
+ selenium_port: 4444,
23
+ selenium_host: 'localhost',
24
+ silent: true,
25
+ globals: {
26
+ devServerURL: 'http://localhost:' + (process.env.PORT || config.dev.port)
27
+ }
28
+ },
29
+
30
+ chrome: {
31
+ desiredCapabilities: {
32
+ browserName: 'chrome',
33
+ javascriptEnabled: true,
34
+ acceptSslCerts: true
35
+ }
36
+ },
37
+
38
+ firefox: {
39
+ desiredCapabilities: {
40
+ browserName: 'firefox',
41
+ javascriptEnabled: true,
42
+ acceptSslCerts: true
43
+ }
44
+ }
45
+ }
46
+ }
@@ -1,48 +1,48 @@
1
- // 1. start the dev server using production config
2
- process.env.NODE_ENV = 'testing'
3
-
4
- const webpack = require('webpack')
5
- const DevServer = require('webpack-dev-server')
6
-
7
- const webpackConfig = require('../../build/webpack.prod.conf')
8
- const devConfigPromise = require('../../build/webpack.dev.conf')
9
-
10
- let server
11
-
12
- devConfigPromise.then(devConfig => {
13
- const devServerOptions = devConfig.devServer
14
- const compiler = webpack(webpackConfig)
15
- server = new DevServer(compiler, devServerOptions)
16
- const port = devServerOptions.port
17
- const host = devServerOptions.host
18
- return server.listen(port, host)
19
- })
20
- .then(() => {
21
- // 2. run the nightwatch test suite against it
22
- // to run in additional browsers:
23
- // 1. add an entry in test/e2e/nightwatch.conf.js under "test_settings"
24
- // 2. add it to the --env flag below
25
- // or override the environment flag, for example: `npm run e2e -- --env chrome,firefox`
26
- // For more information on Nightwatch's config file, see
27
- // http://nightwatchjs.org/guide#settings-file
28
- let opts = process.argv.slice(2)
29
- if (opts.indexOf('--config') === -1) {
30
- opts = opts.concat(['--config', 'test/e2e/nightwatch.conf.js'])
31
- }
32
- if (opts.indexOf('--env') === -1) {
33
- opts = opts.concat(['--env', 'chrome'])
34
- }
35
-
36
- const spawn = require('cross-spawn')
37
- const runner = spawn('./node_modules/.bin/nightwatch', opts, { stdio: 'inherit' })
38
-
39
- runner.on('exit', function (code) {
40
- server.close()
41
- process.exit(code)
42
- })
43
-
44
- runner.on('error', function (err) {
45
- server.close()
46
- throw err
47
- })
48
- })
1
+ // 1. start the dev server using production config
2
+ process.env.NODE_ENV = 'testing'
3
+
4
+ const webpack = require('webpack')
5
+ const DevServer = require('webpack-dev-server')
6
+
7
+ const webpackConfig = require('../../build/webpack.prod.conf')
8
+ const devConfigPromise = require('../../build/webpack.dev.conf')
9
+
10
+ let server
11
+
12
+ devConfigPromise.then(devConfig => {
13
+ const devServerOptions = devConfig.devServer
14
+ const compiler = webpack(webpackConfig)
15
+ server = new DevServer(compiler, devServerOptions)
16
+ const port = devServerOptions.port
17
+ const host = devServerOptions.host
18
+ return server.listen(port, host)
19
+ })
20
+ .then(() => {
21
+ // 2. run the nightwatch test suite against it
22
+ // to run in additional browsers:
23
+ // 1. add an entry in test/e2e/nightwatch.conf.js under "test_settings"
24
+ // 2. add it to the --env flag below
25
+ // or override the environment flag, for example: `npm run e2e -- --env chrome,firefox`
26
+ // For more information on Nightwatch's config file, see
27
+ // http://nightwatchjs.org/guide#settings-file
28
+ let opts = process.argv.slice(2)
29
+ if (opts.indexOf('--config') === -1) {
30
+ opts = opts.concat(['--config', 'test/e2e/nightwatch.conf.js'])
31
+ }
32
+ if (opts.indexOf('--env') === -1) {
33
+ opts = opts.concat(['--env', 'chrome'])
34
+ }
35
+
36
+ const spawn = require('cross-spawn')
37
+ const runner = spawn('./node_modules/.bin/nightwatch', opts, { stdio: 'inherit' })
38
+
39
+ runner.on('exit', function (code) {
40
+ server.close()
41
+ process.exit(code)
42
+ })
43
+
44
+ runner.on('error', function (err) {
45
+ server.close()
46
+ throw err
47
+ })
48
+ })