@live-change/codeceptjs-helper 0.1.0 → 0.5.27
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.
- package/index.js +40 -1
- package/package.json +7 -6
package/index.js
CHANGED
|
@@ -35,8 +35,47 @@ class LiveChangeHelper extends Helper {
|
|
|
35
35
|
return this.setupPromise
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
haveService(name) {
|
|
39
|
+
const service = this.testServer.apiServer.services.services.find(service => service.name == name)
|
|
40
|
+
if(!service) throw new Error('service '+name+' not found')
|
|
41
|
+
return service
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
haveModel(serviceName, modelName) {
|
|
45
|
+
const service = this.haveService(serviceName)
|
|
46
|
+
const model = service.models[modelName]
|
|
47
|
+
if(!model) throw new Error('model '+modelName+' not found')
|
|
48
|
+
return model
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
haveView(serviceName, viewName) {
|
|
52
|
+
const service = this.haveService(serviceName)
|
|
53
|
+
const view = service.views[viewName]
|
|
54
|
+
if(!view) throw new Error('view '+viewName+' not found')
|
|
55
|
+
return view
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
haveAction(serviceName, actionName) {
|
|
59
|
+
const service = this.haveService(serviceName)
|
|
60
|
+
const action = service.actions[actionName]
|
|
61
|
+
if(!action) throw new Error('action '+actionName+' not found')
|
|
62
|
+
return action
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
haveTrigger(serviceName, triggerName) {
|
|
66
|
+
const service = this.haveService(serviceName)
|
|
67
|
+
const trigger = service.triggers[triggerName]
|
|
68
|
+
if(!trigger) throw new Error('trigger '+triggerName+' not found')
|
|
69
|
+
return trigger
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
async grabObject(serviceName, modelName, id) {
|
|
73
|
+
const model = this.haveModel(serviceName, modelName)
|
|
74
|
+
return await model.get(id)
|
|
75
|
+
}
|
|
76
|
+
|
|
38
77
|
_init() {
|
|
39
|
-
|
|
78
|
+
|
|
40
79
|
}
|
|
41
80
|
|
|
42
81
|
async _beforeSuite() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/codeceptjs-helper",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.27",
|
|
4
4
|
"description": "CodeceptJS Helper",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/live-change/
|
|
11
|
+
"url": "git+https://github.com/live-change/live-change-framework.git"
|
|
12
12
|
},
|
|
13
13
|
"author": {
|
|
14
14
|
"email": "m8@em8.pl",
|
|
@@ -17,13 +17,14 @@
|
|
|
17
17
|
},
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"bugs": {
|
|
20
|
-
"url": "https://github.com/live-change/
|
|
20
|
+
"url": "https://github.com/live-change/live-change-framework/issues"
|
|
21
21
|
},
|
|
22
|
-
"homepage": "https://github.com/live-change/
|
|
22
|
+
"homepage": "https://github.com/live-change/live-change-framework",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@codeceptjs/helper": "^1.0.2"
|
|
24
|
+
"@codeceptjs/helper": "^1.0.2"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"wtfnode": "^0.9.0"
|
|
28
|
-
}
|
|
28
|
+
},
|
|
29
|
+
"gitHead": "8cdab8d362794c923e765193d2e786fb29587877"
|
|
29
30
|
}
|