system-clients 3.0.47-fanxian → 3.0.48-fanxian

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 (101) hide show
  1. package/.babelrc +5 -5
  2. package/.editorconfig +9 -9
  3. package/.eslintrc.js +16 -16
  4. package/.gradle/buildOutputCleanup/cache.properties +2 -2
  5. package/CHANGELOG.md +51 -51
  6. package/README.md +36 -36
  7. package/SystemClient.iml +11 -11
  8. package/build/css-loaders.js +34 -34
  9. package/build/dev-client.js +8 -8
  10. package/build/example-server.js +80 -80
  11. package/build/release.sh +28 -28
  12. package/build/utils.js +71 -71
  13. package/build/webpack.base.conf.js +75 -75
  14. package/build/webpack.dev.conf.js +31 -31
  15. package/build/webpack.example.conf.js +49 -49
  16. package/build/webpack.prod.conf.js +60 -60
  17. package/build/webpack.test.conf.js +31 -31
  18. package/build.gradle +6 -6
  19. package/config/dev.env.js +6 -6
  20. package/config/index.js +38 -38
  21. package/config/prod.env.js +3 -3
  22. package/config/test.env.js +6 -6
  23. package/doc/Login.md +7 -7
  24. package/examples/ReadCard/App.vue +23 -23
  25. package/examples/ReadCard/index.html +11 -11
  26. package/examples/ReadCard/main.js +12 -12
  27. package/index.html +21 -21
  28. package/package.json +102 -102
  29. package/release.bat +5 -5
  30. package/src/App.vue +24 -24
  31. package/src/LodopFuncs.js +123 -123
  32. package/src/assets/binding.svg +1 -1
  33. package/src/assets/unbind.svg +1 -1
  34. package/src/assets//345/205/254/345/221/212.svg +1 -1
  35. package/src/assets//347/207/203/346/260/224/347/274/264/350/264/271.eps +116 -116
  36. package/src/assets//350/201/224/347/263/273/346/210/221/344/273/254.svg +1 -1
  37. package/src/components/List.vue +51 -51
  38. package/src/components/Main.vue +632 -632
  39. package/src/components/Table.js +74 -74
  40. package/src/components/Util.js +343 -343
  41. package/src/components/equipment/EquipmentManage.vue +65 -65
  42. package/src/components/equipment/PcAdd.vue +105 -105
  43. package/src/components/equipment/PcList.vue +119 -119
  44. package/src/components/equipment/PcManage.vue +60 -60
  45. package/src/components/equipment/PhoneAdd.vue +94 -94
  46. package/src/components/equipment/PhoneList.vue +102 -102
  47. package/src/components/equipment/PhoneManage.vue +60 -60
  48. package/src/components/equipment/PosAdd.vue +137 -137
  49. package/src/components/equipment/PosList.vue +156 -156
  50. package/src/components/equipment/PosManage.vue +67 -67
  51. package/src/components/materialManage/materialData.vue +44 -44
  52. package/src/components/materialManage/materialList.vue +255 -255
  53. package/src/components/parammanage/AlarmInformation.vue +124 -122
  54. package/src/components/parammanage/ParamManage.vue +42 -42
  55. package/src/components/parammanage/ParamManages.vue +43 -43
  56. package/src/components/parammanage/ParamPage.vue +314 -314
  57. package/src/components/parammanage/ParamPages.vue +214 -214
  58. package/src/components/parammanage/SinglePage.vue +237 -237
  59. package/src/components/parammanage/SinglePages.vue +161 -161
  60. package/src/components/server/AddChangeMsg.vue +66 -66
  61. package/src/components/server/ChangeDeclare.vue +45 -45
  62. package/src/components/server/IconTree.vue +26 -26
  63. package/src/components/server/LeftTree.vue +111 -111
  64. package/src/components/server/LoadData.vue +36 -36
  65. package/src/components/server/Login.vue +625 -625
  66. package/src/components/server/Menu.vue +188 -188
  67. package/src/components/server/ModifyPw.vue +125 -125
  68. package/src/components/server/ResSelect.vue +150 -150
  69. package/src/components/server/ResSelectGroup.vue +140 -140
  70. package/src/components/server/RightTree.vue +263 -263
  71. package/src/components/server/RoleSelector.vue +88 -88
  72. package/src/components/server/TestResSelect.vue +58 -58
  73. package/src/components/server/TestResSelectGroup.vue +388 -388
  74. package/src/components/server/TestRightTree.vue +42 -42
  75. package/src/index.js +7 -7
  76. package/src/plugins/GetLoginInfoService.js +509 -509
  77. package/src/plugins/validation.js +7 -7
  78. package/src/project/ProjectPage.vue +24 -24
  79. package/src/project/State.js +17 -17
  80. package/src/stores/AppData.js +38 -38
  81. package/src/system.js +78 -78
  82. package/src/systemphone.js +11 -11
  83. package/src/util/LdapHelper.js +75 -75
  84. package/test/e2e/custom-assertions/elementCount.js +26 -26
  85. package/test/e2e/nightwatch.conf.js +40 -40
  86. package/test/e2e/runner.js +30 -30
  87. package/test/e2e/specs/test.js +14 -14
  88. package/test/unit/.eslintrc +5 -5
  89. package/test/unit/index.js +13 -13
  90. package/test/unit/init.js +10 -10
  91. package/test/unit/karma.conf.js +49 -49
  92. package/test/unit/specs/base64.spec.js +5 -5
  93. package/test/unit/specs/components/parammanage/ParamPage.spec.js +20 -20
  94. package/test/unit/specs/components/parammanage/SinglePage.spec.js +20 -20
  95. package/test/unit/specs/components/server/LeftTree/App.vue +18 -18
  96. package/test/unit/specs/components/server/LeftTree/LeftTree.spec.js +22 -22
  97. package/test/unit/specs/components/server/LoadData.spec.js +24 -24
  98. package/test/unit/specs/components/server/Login.spec.js +61 -61
  99. package/test/unit/specs/components/server/RightTree.spec.js +50 -50
  100. package/test/unit/specs/plugins/GetLoginInfoService.spec.js +55 -55
  101. package/test/unit/test.html +76 -76
@@ -1,7 +1,7 @@
1
- import Vue from 'vue'
2
- import Validator from 'vue-validator'
3
- Vue.use(Validator)
4
- //密码强度验证器(必须为为大小写字母、阿拉伯数字、字符)
5
- Vue.validator('strongpassword', function (val) {
6
- return /^(?:(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[^A-Za-z0-9])).*$/.test(val)
7
- });
1
+ import Vue from 'vue'
2
+ import Validator from 'vue-validator'
3
+ Vue.use(Validator)
4
+ //密码强度验证器(必须为为大小写字母、阿拉伯数字、字符)
5
+ Vue.validator('strongpassword', function (val) {
6
+ return /^(?:(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[^A-Za-z0-9])).*$/.test(val)
7
+ });
@@ -1,24 +1,24 @@
1
- <template>
2
- <div>
3
- <route v-ref:route></route>
4
- </div>
5
- </template>
6
-
7
- <script>
8
- import ProjectHome from './ProjectHome'
9
- import ProjectForm from './ProjectForm'
10
- import TaskForm from './TaskForm'
11
- import State from './State'
12
-
13
- export default {
14
- data () {
15
- return {
16
- state: new State()
17
- }
18
- },
19
- ready () {
20
- this.$refs.route.route('项目管理', 'ProjectHome')
21
- },
22
- components: { ProjectHome, ProjectForm, TaskForm }
23
- }
24
- </script>
1
+ <template>
2
+ <div>
3
+ <route v-ref:route></route>
4
+ </div>
5
+ </template>
6
+
7
+ <script>
8
+ import ProjectHome from './ProjectHome'
9
+ import ProjectForm from './ProjectForm'
10
+ import TaskForm from './TaskForm'
11
+ import State from './State'
12
+
13
+ export default {
14
+ data () {
15
+ return {
16
+ state: new State()
17
+ }
18
+ },
19
+ ready () {
20
+ this.$refs.route.route('项目管理', 'ProjectHome')
21
+ },
22
+ components: { ProjectHome, ProjectForm, TaskForm }
23
+ }
24
+ </script>
@@ -1,17 +1,17 @@
1
- import { TreeList } from 'vue-client'
2
-
3
- export default class {
4
- constructor () {
5
- this.selected = null
6
- // 左侧项目树
7
- this.projects = new TreeList('/rs/sql/project.sql')
8
- }
9
-
10
- select (selected) {
11
- this.selected = selected
12
- }
13
-
14
- getSelected () {
15
- return this.selected
16
- }
17
- }
1
+ import { TreeList } from 'vue-client'
2
+
3
+ export default class {
4
+ constructor () {
5
+ this.selected = null
6
+ // 左侧项目树
7
+ this.projects = new TreeList('/rs/sql/project.sql')
8
+ }
9
+
10
+ select (selected) {
11
+ this.selected = selected
12
+ }
13
+
14
+ getSelected () {
15
+ return this.selected
16
+ }
17
+ }
@@ -1,38 +1,38 @@
1
- import Vue from 'vue'
2
-
3
- let GetAppDataService = {
4
- install(Vue, options) {
5
- // 给vue增添对话框显示方法
6
-
7
- Vue.$appdata = Vue.prototype.$appdata = GetAppDataService
8
- },
9
-
10
- // 开启卡监听
11
- load () {
12
- return Vue.resetpost('rs/logic/getInitData', {data: {f_filialeids: Vue.$login.f.orgid}}, {resolveMsg: null, rejectMsg: null}).then((res) => {
13
- res.data.singleValues.forEach((item) => {
14
- this.singleValues[item.name] = item.value
15
- })
16
- res.data.params.forEach((item) => {
17
- let value = []
18
- item.f_paramvalues.forEach((item, index) => {
19
- value[index] = {}
20
- value[index].label = item.name
21
- value[index].value = item.name
22
- })
23
- this.params[item.name] = value
24
- })
25
- })
26
- },
27
-
28
- params: {},
29
- singleValues: {},
30
-
31
- getParam(key) {
32
- return this.params[key]
33
- },
34
- getSingleValue(key) {
35
- return this.singleValues[key]
36
- }
37
- }
38
- export default GetAppDataService
1
+ import Vue from 'vue'
2
+
3
+ let GetAppDataService = {
4
+ install(Vue, options) {
5
+ // 给vue增添对话框显示方法
6
+
7
+ Vue.$appdata = Vue.prototype.$appdata = GetAppDataService
8
+ },
9
+
10
+ // 开启卡监听
11
+ load () {
12
+ return Vue.resetpost('rs/logic/getInitData', {data: {f_filialeids: Vue.$login.f.orgid}}, {resolveMsg: null, rejectMsg: null}).then((res) => {
13
+ res.data.singleValues.forEach((item) => {
14
+ this.singleValues[item.name] = item.value
15
+ })
16
+ res.data.params.forEach((item) => {
17
+ let value = []
18
+ item.f_paramvalues.forEach((item, index) => {
19
+ value[index] = {}
20
+ value[index].label = item.name
21
+ value[index].value = item.name
22
+ })
23
+ this.params[item.name] = value
24
+ })
25
+ })
26
+ },
27
+
28
+ params: {},
29
+ singleValues: {},
30
+
31
+ getParam(key) {
32
+ return this.params[key]
33
+ },
34
+ getSingleValue(key) {
35
+ return this.singleValues[key]
36
+ }
37
+ }
38
+ export default GetAppDataService
package/src/system.js CHANGED
@@ -1,78 +1,78 @@
1
- import Vue from 'vue'
2
- import GetLoginInfoService from './plugins/GetLoginInfoService'
3
- import GetAppDataService from './stores/AppData'
4
-
5
- // /** **************************登录与主界面相关******************************/
6
-
7
- import login from './components/server/Login'
8
- import changeDeclare from './components/server/ChangeDeclare'
9
- import addChangemsg from './components/server/AddChangeMsg'
10
- import homePage from './components/Main'
11
- import leftTree from './components/server/LeftTree'
12
- import iconTree from './components/server/IconTree'
13
- import modifyPw from './components/server/ModifyPw'
14
- import LoadData from './components/server/LoadData'
15
- import RightTree from './components/server/RightTree'
16
- import TestRightTree from './components/server/TestRightTree'
17
- //资源选择
18
- import ResSelect from './components/server/ResSelect'
19
- import ResSelectGroup from './components/server/ResSelectGroup'
20
-
21
- //资源选择测试
22
- import TestResSelect from './components/server/TestResSelect'
23
- import RoleSelector from "./components/server/RoleSelector";
24
- export default function (val) {
25
- //验证码开关赋值
26
- if(val!=null){
27
- GetLoginInfoService.Verification=val
28
- }
29
- Vue.use(GetLoginInfoService)
30
- Vue.use(GetAppDataService)
31
-
32
- Vue.component('login', login)
33
- Vue.component('change-declare', changeDeclare)
34
- Vue.component('add-changemsg', addChangemsg)
35
- Vue.component('home-page', homePage)
36
- Vue.component('left-tree', leftTree)
37
- Vue.component('icon-tree', iconTree)
38
- Vue.component('modify-pw', modifyPw)
39
- Vue.component('load-data', LoadData)
40
- Vue.component('right-tree', RightTree)
41
- Vue.component('test-right-tree', TestRightTree)
42
- Vue.component('role-selector', RoleSelector)
43
- //资源选择
44
- Vue.component('res-select', ResSelect)
45
- Vue.component('res-select-group', ResSelectGroup)
46
- //资源选择测试
47
- Vue.component('test-res-select', TestResSelect)
48
-
49
- // 参数管理(新)
50
- Vue.component('param-manage', (resolve) => { require(['./components/parammanage/ParamManage'], resolve) })
51
- // 参数管理
52
- Vue.component('param-page', (resolve) => { require(['./components/parammanage/ParamPage'], resolve) })
53
- // 参数管理
54
- Vue.component('single-page', (resolve) => { require(['./components/parammanage/SinglePage'], resolve) })
55
-
56
- // 参数管理(旧)
57
- Vue.component('param-manages', (resolve) => { require(['./components/parammanage/ParamManages'], resolve) })
58
- // 参数管理
59
- Vue.component('param-pages', (resolve) => { require(['./components/parammanage/ParamPages'], resolve) })
60
- // 参数管理
61
- Vue.component('single-pages', (resolve) => { require(['./components/parammanage/SinglePages'], resolve) })
62
- // 异常报警信息
63
- Vue.component('alarm-information', (resolve) => { require(['./components/parammanage/AlarmInformation'], resolve) })
64
-
65
- // 终端管理
66
- Vue.component('equipment-manage', (resolve) => { require(['./components/equipment/EquipmentManage'], resolve) })
67
- // pc端控制
68
- Vue.component('pc-manage', (resolve) => { require(['./components/equipment/PcManage'], resolve) })
69
- // phone端控制
70
- Vue.component('phone-manage', (resolve) => { require(['./components/equipment/PhoneManage'], resolve) })
71
- // pos端控制
72
- Vue.component('pos-manage', (resolve) => { require(['./components/equipment/PosManage'], resolve) })
73
-
74
- // 材料字典
75
- Vue.component('material-data', (resolve) => { require(['./components/materialManage/materialData.vue'], resolve) })
76
- Vue.component('material-data-list', (resolve) => { require(['./components/materialManage/materialList.vue'], resolve) })
77
-
78
- }
1
+ import Vue from 'vue'
2
+ import GetLoginInfoService from './plugins/GetLoginInfoService'
3
+ import GetAppDataService from './stores/AppData'
4
+
5
+ // /** **************************登录与主界面相关******************************/
6
+
7
+ import login from './components/server/Login'
8
+ import changeDeclare from './components/server/ChangeDeclare'
9
+ import addChangemsg from './components/server/AddChangeMsg'
10
+ import homePage from './components/Main'
11
+ import leftTree from './components/server/LeftTree'
12
+ import iconTree from './components/server/IconTree'
13
+ import modifyPw from './components/server/ModifyPw'
14
+ import LoadData from './components/server/LoadData'
15
+ import RightTree from './components/server/RightTree'
16
+ import TestRightTree from './components/server/TestRightTree'
17
+ //资源选择
18
+ import ResSelect from './components/server/ResSelect'
19
+ import ResSelectGroup from './components/server/ResSelectGroup'
20
+
21
+ //资源选择测试
22
+ import TestResSelect from './components/server/TestResSelect'
23
+ import RoleSelector from "./components/server/RoleSelector";
24
+ export default function (val) {
25
+ //验证码开关赋值
26
+ if(val!=null){
27
+ GetLoginInfoService.Verification=val
28
+ }
29
+ Vue.use(GetLoginInfoService)
30
+ Vue.use(GetAppDataService)
31
+
32
+ Vue.component('login', login)
33
+ Vue.component('change-declare', changeDeclare)
34
+ Vue.component('add-changemsg', addChangemsg)
35
+ Vue.component('home-page', homePage)
36
+ Vue.component('left-tree', leftTree)
37
+ Vue.component('icon-tree', iconTree)
38
+ Vue.component('modify-pw', modifyPw)
39
+ Vue.component('load-data', LoadData)
40
+ Vue.component('right-tree', RightTree)
41
+ Vue.component('test-right-tree', TestRightTree)
42
+ Vue.component('role-selector', RoleSelector)
43
+ //资源选择
44
+ Vue.component('res-select', ResSelect)
45
+ Vue.component('res-select-group', ResSelectGroup)
46
+ //资源选择测试
47
+ Vue.component('test-res-select', TestResSelect)
48
+
49
+ // 参数管理(新)
50
+ Vue.component('param-manage', (resolve) => { require(['./components/parammanage/ParamManage'], resolve) })
51
+ // 参数管理
52
+ Vue.component('param-page', (resolve) => { require(['./components/parammanage/ParamPage'], resolve) })
53
+ // 参数管理
54
+ Vue.component('single-page', (resolve) => { require(['./components/parammanage/SinglePage'], resolve) })
55
+
56
+ // 参数管理(旧)
57
+ Vue.component('param-manages', (resolve) => { require(['./components/parammanage/ParamManages'], resolve) })
58
+ // 参数管理
59
+ Vue.component('param-pages', (resolve) => { require(['./components/parammanage/ParamPages'], resolve) })
60
+ // 参数管理
61
+ Vue.component('single-pages', (resolve) => { require(['./components/parammanage/SinglePages'], resolve) })
62
+ // 异常报警信息
63
+ Vue.component('alarm-information', (resolve) => { require(['./components/parammanage/AlarmInformation'], resolve) })
64
+
65
+ // 终端管理
66
+ Vue.component('equipment-manage', (resolve) => { require(['./components/equipment/EquipmentManage'], resolve) })
67
+ // pc端控制
68
+ Vue.component('pc-manage', (resolve) => { require(['./components/equipment/PcManage'], resolve) })
69
+ // phone端控制
70
+ Vue.component('phone-manage', (resolve) => { require(['./components/equipment/PhoneManage'], resolve) })
71
+ // pos端控制
72
+ Vue.component('pos-manage', (resolve) => { require(['./components/equipment/PosManage'], resolve) })
73
+
74
+ // 材料字典
75
+ Vue.component('material-data', (resolve) => { require(['./components/materialManage/materialData.vue'], resolve) })
76
+ Vue.component('material-data-list', (resolve) => { require(['./components/materialManage/materialList.vue'], resolve) })
77
+
78
+ }
@@ -1,11 +1,11 @@
1
- import Vue from 'vue'
2
-
3
-
4
- // /** **************************登录与主界面相关******************************/
5
- import RightTree from './components/server/RightTree'
6
-
7
- export default function (val) {
8
-
9
- Vue.component('right-tree', RightTree)
10
-
11
- }
1
+ import Vue from 'vue'
2
+
3
+
4
+ // /** **************************登录与主界面相关******************************/
5
+ import RightTree from './components/server/RightTree'
6
+
7
+ export default function (val) {
8
+
9
+ Vue.component('right-tree', RightTree)
10
+
11
+ }
@@ -1,75 +1,75 @@
1
- /**
2
- * 获得给定资源的名称全路径
3
- * @param res: 资源
4
- * @param name: 全路径字段
5
- */
6
- export function getFullName (res, name) {
7
- let result = ''
8
- while (res != null) {
9
- if (result === '') {
10
- result = res[name]
11
- } else {
12
- result = res[name] + '.' + result
13
- }
14
- res = res.parent
15
- }
16
- return result
17
- }
18
-
19
- /**
20
- * 给拿到的资源添加父关系
21
- * @param res
22
- */
23
- export function procParent (reses) {
24
- for (let value of reses) {
25
- procInnerParent(value)
26
- }
27
- }
28
-
29
- // 给资源res的所有子,添加父关系
30
- function procInnerParent (res) {
31
- for (let value of res.children) {
32
- value.parent = res
33
- procInnerParent(value)
34
- }
35
- }
36
-
37
- /**
38
- * 从给定一批资源中,递归找到给定号码的资源
39
- * @param model:给定的一批资源
40
- * @param id:要查找的资源id串
41
- */
42
- export function find (model, id) {
43
- // 返回最后一个id信息
44
- let index = id.lastIndexOf('.')
45
- if (index !== -1) {
46
- id = id.substr(index + 1)
47
- }
48
-
49
- // 子中有,返回子里的
50
- for (let value of model) {
51
- let ret = getInnerResourceById(value, id)
52
- if (ret) {
53
- return ret
54
- }
55
- }
56
-
57
- return null
58
- }
59
-
60
- // 根据id号取资源,自己不是,递归从子中找
61
- function getInnerResourceById (res, id) {
62
- if (res.id === id) {
63
- return res
64
- }
65
-
66
- // 子中有,返回子里的
67
- for (let value of res.children) {
68
- let ret = getInnerResourceById(value, id)
69
- if (ret) {
70
- return ret
71
- }
72
- }
73
-
74
- return null
75
- }
1
+ /**
2
+ * 获得给定资源的名称全路径
3
+ * @param res: 资源
4
+ * @param name: 全路径字段
5
+ */
6
+ export function getFullName (res, name) {
7
+ let result = ''
8
+ while (res != null) {
9
+ if (result === '') {
10
+ result = res[name]
11
+ } else {
12
+ result = res[name] + '.' + result
13
+ }
14
+ res = res.parent
15
+ }
16
+ return result
17
+ }
18
+
19
+ /**
20
+ * 给拿到的资源添加父关系
21
+ * @param res
22
+ */
23
+ export function procParent (reses) {
24
+ for (let value of reses) {
25
+ procInnerParent(value)
26
+ }
27
+ }
28
+
29
+ // 给资源res的所有子,添加父关系
30
+ function procInnerParent (res) {
31
+ for (let value of res.children) {
32
+ value.parent = res
33
+ procInnerParent(value)
34
+ }
35
+ }
36
+
37
+ /**
38
+ * 从给定一批资源中,递归找到给定号码的资源
39
+ * @param model:给定的一批资源
40
+ * @param id:要查找的资源id串
41
+ */
42
+ export function find (model, id) {
43
+ // 返回最后一个id信息
44
+ let index = id.lastIndexOf('.')
45
+ if (index !== -1) {
46
+ id = id.substr(index + 1)
47
+ }
48
+
49
+ // 子中有,返回子里的
50
+ for (let value of model) {
51
+ let ret = getInnerResourceById(value, id)
52
+ if (ret) {
53
+ return ret
54
+ }
55
+ }
56
+
57
+ return null
58
+ }
59
+
60
+ // 根据id号取资源,自己不是,递归从子中找
61
+ function getInnerResourceById (res, id) {
62
+ if (res.id === id) {
63
+ return res
64
+ }
65
+
66
+ // 子中有,返回子里的
67
+ for (let value of res.children) {
68
+ let ret = getInnerResourceById(value, id)
69
+ if (ret) {
70
+ return ret
71
+ }
72
+ }
73
+
74
+ return null
75
+ }
@@ -1,26 +1,26 @@
1
- // A custom Nightwatch assertion.
2
- // the name of the method is the filename.
3
- // can be used in tests like this:
4
- //
5
- // browser.assert.elementCount(selector, count)
6
- //
7
- // for how to write custom assertions see
8
- // http://nightwatchjs.org/guide#writing-custom-assertions
9
- exports.assertion = function (selector, count) {
10
- this.message = 'Testing if element <' + selector + '> has count: ' + count
11
- this.expected = count
12
- this.pass = function (val) {
13
- return val === this.expected
14
- }
15
- this.value = function (res) {
16
- return res.value
17
- }
18
- this.command = function (cb) {
19
- var self = this
20
- return this.api.execute(function (selector) {
21
- return document.querySelectorAll(selector).length
22
- }, [selector], function (res) {
23
- cb.call(self, res)
24
- })
25
- }
26
- }
1
+ // A custom Nightwatch assertion.
2
+ // the name of the method is the filename.
3
+ // can be used in tests like this:
4
+ //
5
+ // browser.assert.elementCount(selector, count)
6
+ //
7
+ // for how to write custom assertions see
8
+ // http://nightwatchjs.org/guide#writing-custom-assertions
9
+ exports.assertion = function (selector, count) {
10
+ this.message = 'Testing if element <' + selector + '> has count: ' + count
11
+ this.expected = count
12
+ this.pass = function (val) {
13
+ return val === this.expected
14
+ }
15
+ this.value = function (res) {
16
+ return res.value
17
+ }
18
+ this.command = function (cb) {
19
+ var self = this
20
+ return this.api.execute(function (selector) {
21
+ return document.querySelectorAll(selector).length
22
+ }, [selector], function (res) {
23
+ cb.call(self, res)
24
+ })
25
+ }
26
+ }
@@ -1,40 +1,40 @@
1
- // http://nightwatchjs.org/guide#settings-file
2
- module.exports = {
3
- 'src_folders': ['test/e2e/specs'],
4
- 'output_folder': 'test/e2e/reports',
5
- 'custom_assertions_path': ['test/e2e/custom-assertions'],
6
-
7
- 'selenium': {
8
- 'start_process': true,
9
- 'server_path': 'node_modules/selenium-server/lib/runner/selenium-server-standalone-2.52.0.jar',
10
- 'host': '127.0.0.1',
11
- 'port': 4444,
12
- 'cli_args': {
13
- 'webdriver.chrome.driver': require('chromedriver').path
14
- }
15
- },
16
-
17
- 'test_settings': {
18
- 'default': {
19
- 'selenium_port': 4444,
20
- 'selenium_host': 'localhost',
21
- 'silent': true
22
- },
23
-
24
- 'chrome': {
25
- 'desiredCapabilities': {
26
- 'browserName': 'chrome',
27
- 'javascriptEnabled': true,
28
- 'acceptSslCerts': true
29
- }
30
- },
31
-
32
- 'firefox': {
33
- 'desiredCapabilities': {
34
- 'browserName': 'firefox',
35
- 'javascriptEnabled': true,
36
- 'acceptSslCerts': true
37
- }
38
- }
39
- }
40
- }
1
+ // http://nightwatchjs.org/guide#settings-file
2
+ module.exports = {
3
+ 'src_folders': ['test/e2e/specs'],
4
+ 'output_folder': 'test/e2e/reports',
5
+ 'custom_assertions_path': ['test/e2e/custom-assertions'],
6
+
7
+ 'selenium': {
8
+ 'start_process': true,
9
+ 'server_path': 'node_modules/selenium-server/lib/runner/selenium-server-standalone-2.52.0.jar',
10
+ 'host': '127.0.0.1',
11
+ 'port': 4444,
12
+ 'cli_args': {
13
+ 'webdriver.chrome.driver': require('chromedriver').path
14
+ }
15
+ },
16
+
17
+ 'test_settings': {
18
+ 'default': {
19
+ 'selenium_port': 4444,
20
+ 'selenium_host': 'localhost',
21
+ 'silent': true
22
+ },
23
+
24
+ 'chrome': {
25
+ 'desiredCapabilities': {
26
+ 'browserName': 'chrome',
27
+ 'javascriptEnabled': true,
28
+ 'acceptSslCerts': true
29
+ }
30
+ },
31
+
32
+ 'firefox': {
33
+ 'desiredCapabilities': {
34
+ 'browserName': 'firefox',
35
+ 'javascriptEnabled': true,
36
+ 'acceptSslCerts': true
37
+ }
38
+ }
39
+ }
40
+ }