@onehat/ui 0.4.22 → 0.4.24
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/package.json +1 -1
- package/src/Components/Form/Field/Combo/Combo.js +7 -5
- package/src/Components/Form/Field/Input.js +0 -1
- package/src/Components/Form/Field/Tag/Tag.js +5 -3
- package/src/Components/Form/Field/TextArea.js +2 -0
- package/src/Components/Grid/GridRow.js +4 -4
- package/src/Components/Hoc/withAlert.js +3 -0
- package/src/Components/Hoc/withModal.js +6 -0
- package/src/Components/Screens/Manager.js +4 -0
- package/src/Components/Tree/Tree.js +3 -1
- package/src/Components/Tree/TreeNode.js +1 -1
- package/src/Functions/Cypress/button_functions.js +36 -4
- package/src/Functions/Cypress/common_functions.js +6 -1
- package/src/Functions/Cypress/crud_functions.js +76 -118
- package/src/Functions/Cypress/form_functions.js +31 -7
- package/src/Functions/Cypress/grid_functions.js +9 -15
- package/src/Functions/Cypress/navigation_functions.js +5 -0
- package/src/Functions/Cypress/tree_functions.js +10 -15
- package/src/Functions/Cypress/utilities.js +4 -0
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
Text,
|
|
11
11
|
TextNative,
|
|
12
12
|
Tooltip,
|
|
13
|
-
|
|
13
|
+
VStackNative,
|
|
14
14
|
} from '@project-components/Gluestack';
|
|
15
15
|
import {
|
|
16
16
|
UI_MODE_NATIVE,
|
|
@@ -444,8 +444,9 @@ export function ComboComponent(props) {
|
|
|
444
444
|
});
|
|
445
445
|
}
|
|
446
446
|
|
|
447
|
-
|
|
448
|
-
|
|
447
|
+
if (!isId) {
|
|
448
|
+
setNewEntityDisplayValue(value); // capture the search query so we can tell Grid what to use for a new entity's displayValue
|
|
449
|
+
}
|
|
449
450
|
} else {
|
|
450
451
|
// Search through data
|
|
451
452
|
const regex = new RegExp('^' + value);
|
|
@@ -1021,7 +1022,7 @@ export function ComboComponent(props) {
|
|
|
1021
1022
|
if (isRendered && additionalButtons?.length && containerWidth < 500) {
|
|
1022
1023
|
// be responsive for small screen sizes and bump additionalButtons to the next line
|
|
1023
1024
|
assembledComponents =
|
|
1024
|
-
<
|
|
1025
|
+
<VStackNative
|
|
1025
1026
|
testID={testID}
|
|
1026
1027
|
className="Combo-VStack"
|
|
1027
1028
|
>
|
|
@@ -1038,11 +1039,12 @@ export function ComboComponent(props) {
|
|
|
1038
1039
|
<HStack className="mt-1">
|
|
1039
1040
|
{additionalButtons}
|
|
1040
1041
|
</HStack>
|
|
1041
|
-
</
|
|
1042
|
+
</VStackNative>;
|
|
1042
1043
|
} else {
|
|
1043
1044
|
assembledComponents =
|
|
1044
1045
|
<HStackNative
|
|
1045
1046
|
{...refProps}
|
|
1047
|
+
testID={testID}
|
|
1046
1048
|
onLayout={onLayout}
|
|
1047
1049
|
className={className}
|
|
1048
1050
|
>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useRef, } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
HStack,
|
|
4
|
-
|
|
4
|
+
VStackNative,
|
|
5
5
|
} from '@project-components/Gluestack';
|
|
6
6
|
import {
|
|
7
7
|
EDITOR_TYPE__WINDOWED,
|
|
@@ -27,6 +27,7 @@ function TagComponent(props) {
|
|
|
27
27
|
Editor,
|
|
28
28
|
_combo = {},
|
|
29
29
|
tooltip,
|
|
30
|
+
testID,
|
|
30
31
|
|
|
31
32
|
// parent Form
|
|
32
33
|
onChangeValue,
|
|
@@ -301,7 +302,8 @@ function TagComponent(props) {
|
|
|
301
302
|
}
|
|
302
303
|
}
|
|
303
304
|
|
|
304
|
-
return <
|
|
305
|
+
return <VStackNative
|
|
306
|
+
testID={testID}
|
|
305
307
|
className={className}
|
|
306
308
|
style={style}
|
|
307
309
|
>
|
|
@@ -322,7 +324,7 @@ function TagComponent(props) {
|
|
|
322
324
|
{..._combo}
|
|
323
325
|
className={comboClassName}
|
|
324
326
|
/>}
|
|
325
|
-
</
|
|
327
|
+
</VStackNative>;
|
|
326
328
|
|
|
327
329
|
}
|
|
328
330
|
|
|
@@ -17,6 +17,7 @@ const
|
|
|
17
17
|
onChangeText,
|
|
18
18
|
placeholder,
|
|
19
19
|
minimizeForRow = false,
|
|
20
|
+
testID,
|
|
20
21
|
} = props,
|
|
21
22
|
value = _.isNil(props.value) ? '' : props.value, // null value may not actually reset this TextArea, so set it explicitly to empty string
|
|
22
23
|
styles = UiGlobals.styles,
|
|
@@ -95,6 +96,7 @@ const
|
|
|
95
96
|
|
|
96
97
|
return <Textarea className={textareaClassName}>
|
|
97
98
|
<TextareaInput
|
|
99
|
+
testID={testID}
|
|
98
100
|
ref={props.outerRef}
|
|
99
101
|
onChangeText={onChangeTextLocal}
|
|
100
102
|
value={localValue}
|
|
@@ -53,7 +53,7 @@ function GridRow(props) {
|
|
|
53
53
|
hash = item?.hash || item;
|
|
54
54
|
return useMemo(() => {
|
|
55
55
|
|
|
56
|
-
let bg = props.bg || styles.GRID_ROW_BG,
|
|
56
|
+
let bg = rowProps.bg || props.bg || styles.GRID_ROW_BG,
|
|
57
57
|
mixWith;
|
|
58
58
|
if (isSelected) {
|
|
59
59
|
if (showHovers && isHovered) {
|
|
@@ -137,7 +137,7 @@ function GridRow(props) {
|
|
|
137
137
|
extraProps._web.style = {};
|
|
138
138
|
}
|
|
139
139
|
extraProps._web.style = {
|
|
140
|
-
userSelect: 'none',
|
|
140
|
+
// userSelect: 'none',
|
|
141
141
|
};
|
|
142
142
|
|
|
143
143
|
return <HStackNative
|
|
@@ -171,7 +171,7 @@ function GridRow(props) {
|
|
|
171
171
|
key={key}
|
|
172
172
|
overflow="hidden"
|
|
173
173
|
style={{
|
|
174
|
-
userSelect: 'none',
|
|
174
|
+
// userSelect: 'none',
|
|
175
175
|
...colStyle,
|
|
176
176
|
}}
|
|
177
177
|
minimizeForRow={true}
|
|
@@ -217,7 +217,7 @@ function GridRow(props) {
|
|
|
217
217
|
{...testProps('cell-' + config.fieldName)}
|
|
218
218
|
key={key}
|
|
219
219
|
style={{
|
|
220
|
-
userSelect: 'none',
|
|
220
|
+
// userSelect: 'none',
|
|
221
221
|
...colStyle,
|
|
222
222
|
}}
|
|
223
223
|
numberOfLines={1}
|
|
@@ -97,6 +97,7 @@ function withAlert(WrappedComponent) {
|
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
showModal({
|
|
100
|
+
testID: 'AlertModal',
|
|
100
101
|
title,
|
|
101
102
|
body: getBody({
|
|
102
103
|
icon: TriangleExclamation,
|
|
@@ -119,6 +120,7 @@ function withAlert(WrappedComponent) {
|
|
|
119
120
|
onConfirm = (message, onYes, includeCancel = false, onNo) => {
|
|
120
121
|
hideModal();
|
|
121
122
|
showModal({
|
|
123
|
+
testID: 'ConfirmModal',
|
|
122
124
|
title: 'Confirm',
|
|
123
125
|
body: getBody({
|
|
124
126
|
icon: CircleQuestion,
|
|
@@ -142,6 +144,7 @@ function withAlert(WrappedComponent) {
|
|
|
142
144
|
onInfo = (message) => {
|
|
143
145
|
hideModal();
|
|
144
146
|
showModal({
|
|
147
|
+
testID: 'InfoModal',
|
|
145
148
|
title: 'Info',
|
|
146
149
|
body: getBody({
|
|
147
150
|
icon: CircleInfo,
|
|
@@ -36,6 +36,7 @@ export default function withModal(WrappedComponent) {
|
|
|
36
36
|
[customButtons, setCustomButtons] = useState(),
|
|
37
37
|
[body, setBody] = useState(),
|
|
38
38
|
[whichModal, setWhichModal] = useState(),
|
|
39
|
+
[testID, setTestID] = useState('Modal'),
|
|
39
40
|
autoFocusRef = useRef(null),
|
|
40
41
|
cancelRef = useRef(null),
|
|
41
42
|
[windowWidth, windowHeight] = useAdjustedWindowSize(w, h),
|
|
@@ -59,6 +60,7 @@ export default function withModal(WrappedComponent) {
|
|
|
59
60
|
h = null,
|
|
60
61
|
w = null,
|
|
61
62
|
whichModal = null,
|
|
63
|
+
testID = null,
|
|
62
64
|
formProps = null, // deprecated
|
|
63
65
|
} = args;
|
|
64
66
|
|
|
@@ -83,6 +85,9 @@ export default function withModal(WrappedComponent) {
|
|
|
83
85
|
setWidth(w); // || 400
|
|
84
86
|
setWhichModal(whichModal);
|
|
85
87
|
setIsModalShown(true);
|
|
88
|
+
if (testID) {
|
|
89
|
+
setTestID(testID);
|
|
90
|
+
}
|
|
86
91
|
},
|
|
87
92
|
updateModalBody = (newBody) => {
|
|
88
93
|
setBody(newBody);
|
|
@@ -185,6 +190,7 @@ export default function withModal(WrappedComponent) {
|
|
|
185
190
|
isOpen={true}
|
|
186
191
|
onClose={onCancel}
|
|
187
192
|
className="withModal-Modal"
|
|
193
|
+
{...testProps(testID)}
|
|
188
194
|
>
|
|
189
195
|
<ModalBackdrop className="withModal-ModalBackdrop" />
|
|
190
196
|
{modalBody}
|
|
@@ -23,6 +23,7 @@ function ManagerScreen(props) {
|
|
|
23
23
|
title,
|
|
24
24
|
sideModeComponent,
|
|
25
25
|
fullModeComponent,
|
|
26
|
+
onChangeMode,
|
|
26
27
|
|
|
27
28
|
// withComponent
|
|
28
29
|
self,
|
|
@@ -45,6 +46,9 @@ function ManagerScreen(props) {
|
|
|
45
46
|
if (id) {
|
|
46
47
|
setSaved(id + '-mode', newMode);
|
|
47
48
|
}
|
|
49
|
+
if (onChangeMode) {
|
|
50
|
+
onChangeMode(newMode);
|
|
51
|
+
}
|
|
48
52
|
},
|
|
49
53
|
onLayout = (e) => {
|
|
50
54
|
if (sideModeComponent) {
|
|
@@ -121,6 +121,7 @@ function TreeComponent(props) {
|
|
|
121
121
|
initialSelection,
|
|
122
122
|
canRecordBeEdited,
|
|
123
123
|
onTreeLoad,
|
|
124
|
+
onLayout,
|
|
124
125
|
|
|
125
126
|
selectorId,
|
|
126
127
|
selectorSelected,
|
|
@@ -515,7 +516,7 @@ function TreeComponent(props) {
|
|
|
515
516
|
iconCollapsed: getNodeIcon(COLLAPSED, treeNode),
|
|
516
517
|
iconExpanded: getNodeIcon(EXPANDED, treeNode),
|
|
517
518
|
iconLeaf: getNodeIcon(LEAF, treeNode),
|
|
518
|
-
isExpanded: defaultToExpanded || isRoot, // all non-root treeNodes are collapsed by default
|
|
519
|
+
isExpanded: treeNode.isExpanded || defaultToExpanded || isRoot, // all non-root treeNodes are collapsed by default
|
|
519
520
|
isVisible: isRoot ? areRootsVisible : true,
|
|
520
521
|
isLoading: false,
|
|
521
522
|
children,
|
|
@@ -1380,6 +1381,7 @@ function TreeComponent(props) {
|
|
|
1380
1381
|
return <VStackNative
|
|
1381
1382
|
{...testProps(self)}
|
|
1382
1383
|
className={className}
|
|
1384
|
+
onLayout={onLayout}
|
|
1383
1385
|
>
|
|
1384
1386
|
{topToolbar}
|
|
1385
1387
|
|
|
@@ -43,7 +43,7 @@ export default function TreeNode(props) {
|
|
|
43
43
|
|
|
44
44
|
return useMemo(() => {
|
|
45
45
|
const icon = hasChildren ? (isExpanded ? iconExpanded : iconCollapsed) : iconLeaf;
|
|
46
|
-
let bg = props.bg || styles.TREE_NODE_BG,
|
|
46
|
+
let bg = props.nodeProps?.bg || props.bg || styles.TREE_NODE_BG,
|
|
47
47
|
mixWith;
|
|
48
48
|
if (isSelected) {
|
|
49
49
|
if (isHovered) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import 'cypress-if'; // for clickButtonIfExists only!
|
|
2
2
|
import {
|
|
3
3
|
getDomNode,
|
|
4
4
|
getDomNodes,
|
|
@@ -8,78 +8,110 @@ const $ = Cypress.$;
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
export function clickAddButton(parentSelectors) {
|
|
11
|
+
cy.log('clickAddButton');
|
|
11
12
|
return clickButton(parentSelectors, 'addBtn');
|
|
12
13
|
}
|
|
13
14
|
export function clickSaveButton(parentSelectors) {
|
|
15
|
+
cy.log('clickSaveButton');
|
|
14
16
|
return clickButton(parentSelectors, 'saveBtn');
|
|
15
17
|
}
|
|
16
18
|
export function clickEditButton(parentSelectors) {
|
|
19
|
+
cy.log('clickEditButton');
|
|
17
20
|
return clickButton(parentSelectors, 'editBtn');
|
|
18
21
|
}
|
|
19
22
|
export function clickDeleteButton(parentSelectors) {
|
|
23
|
+
cy.log('clickDeleteButton');
|
|
20
24
|
return clickButton(parentSelectors, 'deleteBtn');
|
|
21
25
|
}
|
|
22
26
|
export function clickDuplicateButton(parentSelectors) {
|
|
27
|
+
cy.log('clickDuplicateButton');
|
|
23
28
|
return clickButton(parentSelectors, 'duplicateBtn');
|
|
24
29
|
}
|
|
25
30
|
export function clickReloadButton(parentSelectors) {
|
|
31
|
+
cy.log('clickReloadButton');
|
|
26
32
|
return clickButton(parentSelectors, 'reloadBtn');
|
|
27
33
|
}
|
|
28
34
|
export function clickCloseButton(parentSelectors) {
|
|
35
|
+
cy.log('clickCloseButton');
|
|
29
36
|
return clickButton(parentSelectors, 'closeBtn');
|
|
30
37
|
}
|
|
31
38
|
export function clickCancelButton(parentSelectors) {
|
|
39
|
+
cy.log('clickCancelButton');
|
|
32
40
|
return clickButton(parentSelectors, 'cancelBtn');
|
|
33
41
|
}
|
|
34
42
|
export function clickOkButton(parentSelectors) {
|
|
43
|
+
cy.log('clickOkButton');
|
|
35
44
|
return clickButton(parentSelectors, 'okBtn');
|
|
36
45
|
}
|
|
37
46
|
export function clickYesButton(parentSelectors) {
|
|
47
|
+
cy.log('clickYesButton');
|
|
38
48
|
return clickButton(parentSelectors, 'yesBtn');
|
|
39
49
|
}
|
|
40
50
|
export function clickNoButton(parentSelectors) {
|
|
51
|
+
cy.log('clickNoButton');
|
|
41
52
|
return clickButton(parentSelectors, 'noBtn');
|
|
42
53
|
}
|
|
43
54
|
export function clickExpandButton(parentSelectors) {
|
|
55
|
+
cy.log('clickExpandButton');
|
|
44
56
|
return clickButton(parentSelectors, 'expandBtn');
|
|
45
57
|
}
|
|
46
58
|
export function clickXButton(parentSelectors) {
|
|
59
|
+
cy.log('clickXButton');
|
|
47
60
|
return clickButton(parentSelectors, 'xBtn');
|
|
48
61
|
}
|
|
62
|
+
export function clickXButtonIfEnabled(parentSelectors) {
|
|
63
|
+
cy.log('clickXButtonIfEnabled');
|
|
64
|
+
return clickButtonIfEnabled(parentSelectors, 'xBtn', true);
|
|
65
|
+
}
|
|
49
66
|
export function clickTrigger(parentSelectors) {
|
|
67
|
+
cy.log('clickTrigger');
|
|
50
68
|
return clickButton(parentSelectors, 'trigger');
|
|
51
69
|
}
|
|
52
70
|
export function clickToEditButton(parentSelectors) {
|
|
71
|
+
cy.log('clickToEditButton');
|
|
53
72
|
return clickButton(parentSelectors, 'toEditBtn');
|
|
54
73
|
}
|
|
55
74
|
export function clickToEditButtonIfExists(parentSelectors) {
|
|
75
|
+
cy.log('clickToEditButtonIfExists');
|
|
56
76
|
return clickButtonIfExists(parentSelectors, 'toEditBtn');
|
|
57
77
|
}
|
|
58
78
|
export function clickToViewButton(parentSelectors) {
|
|
79
|
+
cy.log('clickToViewButton');
|
|
59
80
|
return clickButton(parentSelectors, 'toViewBtn');
|
|
60
81
|
}
|
|
61
82
|
export function clickToViewButtonIfExists(parentSelectors) {
|
|
83
|
+
cy.log('clickToViewButtonIfExists');
|
|
62
84
|
return clickButtonIfExists(parentSelectors, 'toViewBtn');
|
|
63
85
|
}
|
|
64
86
|
export function toFullMode(parentSelectors) {
|
|
87
|
+
cy.log('toFullMode');
|
|
65
88
|
return clickButton(parentSelectors, 'fullModeBtn');
|
|
66
89
|
}
|
|
67
90
|
export function toSideMode(parentSelectors) {
|
|
91
|
+
cy.log('toSideMode');
|
|
68
92
|
return clickButton(parentSelectors, 'sideModeBtn');
|
|
69
93
|
}
|
|
70
|
-
export function clickButton(parentSelectors, name) {
|
|
94
|
+
export function clickButton(parentSelectors, name) { // requires the button to be enabled
|
|
95
|
+
if (_.isString(parentSelectors)) {
|
|
96
|
+
parentSelectors = [parentSelectors];
|
|
97
|
+
}
|
|
98
|
+
cy.log('clickButton ' + name);
|
|
99
|
+
return getDomNode([...parentSelectors, name])
|
|
100
|
+
.should('not.have.attr', 'data-disabled', 'true') // Check that the element is not disabled
|
|
101
|
+
.click({ force: true });
|
|
102
|
+
}
|
|
103
|
+
export function clickButtonIfEnabled(parentSelectors, name) { // allows button to be disabled
|
|
71
104
|
if (_.isString(parentSelectors)) {
|
|
72
105
|
parentSelectors = [parentSelectors];
|
|
73
106
|
}
|
|
74
107
|
return getDomNode([...parentSelectors, name])
|
|
75
|
-
// .scrollIntoView()
|
|
76
108
|
.click({ force: true });
|
|
77
109
|
}
|
|
78
110
|
export function clickButtonIfExists(parentSelectors, name) {
|
|
79
111
|
if (_.isString(parentSelectors)) {
|
|
80
112
|
parentSelectors = [parentSelectors];
|
|
81
113
|
}
|
|
82
|
-
return getDomNode([...parentSelectors, name]).then((node) => {
|
|
114
|
+
return getDomNode([...parentSelectors, name]).if().then((node) => { // NOTE if() is a cypress-if function
|
|
83
115
|
if (node) {
|
|
84
116
|
node.click();
|
|
85
117
|
}
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
export function markForPageReload() {
|
|
8
|
+
cy.log('markForPageReload');
|
|
8
9
|
// See https://github.com/cypress-io/cypress/issues/1805#issuecomment-525482440
|
|
9
10
|
cy.window()
|
|
10
11
|
.then((win) => {
|
|
@@ -12,11 +13,13 @@ export function markForPageReload() {
|
|
|
12
13
|
});
|
|
13
14
|
}
|
|
14
15
|
export function waitForPageReload() {
|
|
16
|
+
cy.log('waitForPageReload');
|
|
15
17
|
// See https://github.com/cypress-io/cypress/issues/1805#issuecomment-525482440
|
|
16
18
|
cy.window({ timeout: 30000 })
|
|
17
19
|
.should('not.have.prop', 'beforeReload');
|
|
18
20
|
}
|
|
19
21
|
export function waitForNavigationTo(url) {
|
|
22
|
+
cy.log('waitForNavigationTo ' + url);
|
|
20
23
|
return cy.location('pathname', { timeout: 30000 })
|
|
21
24
|
.should('include', url);
|
|
22
25
|
}
|
|
@@ -30,10 +33,12 @@ export function waitForNavigationTo(url) {
|
|
|
30
33
|
// /_/ /_/\___/____/____/\__,_/\__, /\___/_____/\____/_/|_|
|
|
31
34
|
// /____/
|
|
32
35
|
export function clickMessageBoxDefaultButton() {
|
|
33
|
-
|
|
36
|
+
cy.log('clickMessageBoxDefaultButton');
|
|
37
|
+
getDomNode(['AlertModal', 'okBtn'])
|
|
34
38
|
.click();
|
|
35
39
|
}
|
|
36
40
|
export function verifyNoErrorBox() {
|
|
41
|
+
cy.log('verifyNoErrorBox');
|
|
37
42
|
getDomNode('ErrorMessage', { timeout: 1000 })
|
|
38
43
|
.should('not.exist', 'Error dialogue popped up.');
|
|
39
44
|
}
|
|
@@ -81,9 +81,7 @@ export const FULL = 'FULL';
|
|
|
81
81
|
|
|
82
82
|
// Form fields
|
|
83
83
|
export function crudCombo(selector, newData, editData, schema, ancillaryData, level = 0) {
|
|
84
|
-
cy.
|
|
85
|
-
Cypress.log({ name: 'crudCombo' });
|
|
86
|
-
});
|
|
84
|
+
cy.log('crudCombo');
|
|
87
85
|
|
|
88
86
|
const
|
|
89
87
|
fieldName = selector[1].match(/^field-(.*)$/)[1],
|
|
@@ -96,9 +94,7 @@ export function crudCombo(selector, newData, editData, schema, ancillaryData, le
|
|
|
96
94
|
clickTrigger(selector);
|
|
97
95
|
}
|
|
98
96
|
export function crudTag(selector, newData, editData, schema, ancillaryData, level = 0) {
|
|
99
|
-
cy.
|
|
100
|
-
Cypress.log({ name: 'crudTag' });
|
|
101
|
-
});
|
|
97
|
+
cy.log('crudTag');
|
|
102
98
|
|
|
103
99
|
const
|
|
104
100
|
fieldName = selector[1].match(/^field-(.*)$/)[1],
|
|
@@ -114,9 +110,7 @@ export function crudTag(selector, newData, editData, schema, ancillaryData, leve
|
|
|
114
110
|
clickTrigger(selector);
|
|
115
111
|
}
|
|
116
112
|
export function crudJson(selector, newData, editData, schema, ancillaryData, level = 0) {
|
|
117
|
-
cy.
|
|
118
|
-
Cypress.log({ name: 'crudJson' });
|
|
119
|
-
});
|
|
113
|
+
cy.log('crudJson');
|
|
120
114
|
|
|
121
115
|
// do nothing for now
|
|
122
116
|
}
|
|
@@ -125,9 +119,7 @@ export function crudJson(selector, newData, editData, schema, ancillaryData, lev
|
|
|
125
119
|
// Grid
|
|
126
120
|
export function crudWindowedGridRecord(gridSelector, newData, editData, schema, ancillaryData, level = 0) {
|
|
127
121
|
|
|
128
|
-
cy.
|
|
129
|
-
Cypress.log({ name: 'crudWindowedGridRecord ' + gridSelector });
|
|
130
|
-
});
|
|
122
|
+
cy.log('crudWindowedGridRecord ' + gridSelector);
|
|
131
123
|
|
|
132
124
|
getDomNode(gridSelector).scrollIntoView();
|
|
133
125
|
|
|
@@ -136,9 +128,7 @@ export function crudWindowedGridRecord(gridSelector, newData, editData, schema,
|
|
|
136
128
|
|
|
137
129
|
cy.get('@id' + level).then((id) => {
|
|
138
130
|
|
|
139
|
-
cy.
|
|
140
|
-
Cypress.log({ name: 'crudWindowedGridRecord: continue thru CRUD ' + gridSelector });
|
|
141
|
-
});
|
|
131
|
+
cy.log('crudWindowedGridRecord: continue thru CRUD ' + gridSelector);
|
|
142
132
|
|
|
143
133
|
// read
|
|
144
134
|
clickReloadButton(gridSelector);
|
|
@@ -156,9 +146,7 @@ export function crudWindowedGridRecord(gridSelector, newData, editData, schema,
|
|
|
156
146
|
}
|
|
157
147
|
export function crudInlineGridRecord(gridSelector, newData, editData, schema, ancillaryData, level = 0) {
|
|
158
148
|
|
|
159
|
-
cy.
|
|
160
|
-
Cypress.log({ name: 'crudInlineGridRecord ' + gridSelector });
|
|
161
|
-
});
|
|
149
|
+
cy.log('crudInlineGridRecord ' + gridSelector);
|
|
162
150
|
|
|
163
151
|
getDomNode(gridSelector).scrollIntoView();
|
|
164
152
|
|
|
@@ -167,9 +155,7 @@ export function crudInlineGridRecord(gridSelector, newData, editData, schema, an
|
|
|
167
155
|
|
|
168
156
|
cy.get('@id' + level).then((id) => {
|
|
169
157
|
|
|
170
|
-
cy.
|
|
171
|
-
Cypress.log({ name: 'crudWindowedGridRecord: continue thru CRUD ' + gridSelector });
|
|
172
|
-
});
|
|
158
|
+
cy.log('crudWindowedGridRecord: continue thru CRUD ' + gridSelector);
|
|
173
159
|
|
|
174
160
|
// read
|
|
175
161
|
clickReloadButton(gridSelector);
|
|
@@ -189,9 +175,7 @@ export function crudSideGridRecord(gridSelector, newData, editData, schema, anci
|
|
|
189
175
|
// NOTE: the 'level' arg allows this fn to be called recursively
|
|
190
176
|
// and to use the @id alias correctly, keeping track of the level of recursion
|
|
191
177
|
// so the CRUD operations don't step on each other at different levels.
|
|
192
|
-
cy.
|
|
193
|
-
Cypress.log({ name: 'crudSideGridRecord ' + gridSelector });
|
|
194
|
-
});
|
|
178
|
+
cy.log('crudSideGridRecord ' + gridSelector);
|
|
195
179
|
|
|
196
180
|
getDomNode(gridSelector).scrollIntoView();
|
|
197
181
|
|
|
@@ -216,16 +200,21 @@ export function crudSideGridRecord(gridSelector, newData, editData, schema, anci
|
|
|
216
200
|
}
|
|
217
201
|
export function addGridRecord(gridSelector, fieldValues, schema, ancillaryData, level = 0) {
|
|
218
202
|
|
|
219
|
-
cy.
|
|
220
|
-
Cypress.log({ name: 'addGridRecord ' + gridSelector });
|
|
221
|
-
});
|
|
203
|
+
cy.log('addGridRecord ' + gridSelector);
|
|
222
204
|
|
|
223
205
|
const
|
|
224
206
|
editorSelector = gridSelector + '/editor',
|
|
225
207
|
viewerSelector = editorSelector + '/viewer',
|
|
226
|
-
formSelector = editorSelector + '/form'
|
|
208
|
+
formSelector = editorSelector + '/form',
|
|
209
|
+
isRemotePhantomMode = schema.repository.isRemotePhantomMode;
|
|
227
210
|
|
|
211
|
+
if (isRemotePhantomMode) {
|
|
212
|
+
cy.intercept('POST', '**/add**').as('addWaiter');
|
|
213
|
+
}
|
|
228
214
|
clickAddButton(gridSelector);
|
|
215
|
+
if (isRemotePhantomMode) {
|
|
216
|
+
cy.wait('@addWaiter');
|
|
217
|
+
}
|
|
229
218
|
getDomNode(formSelector).should('exist');
|
|
230
219
|
|
|
231
220
|
fillForm(formSelector, fieldValues, schema, level +1);
|
|
@@ -233,12 +222,12 @@ export function addGridRecord(gridSelector, fieldValues, schema, ancillaryData,
|
|
|
233
222
|
// TODO: Change this to wait until save button is enabled
|
|
234
223
|
|
|
235
224
|
let method = 'add';
|
|
236
|
-
if (
|
|
225
|
+
if (isRemotePhantomMode) {
|
|
237
226
|
method = 'edit';
|
|
238
227
|
}
|
|
239
|
-
cy.intercept('POST', '**/' + method + '**').as('
|
|
228
|
+
cy.intercept('POST', '**/' + method + '**').as(method + 'Waiter');
|
|
240
229
|
clickSaveButton(formSelector); // it's labeled 'Add' in the form, but is really the save button
|
|
241
|
-
cy.wait('@
|
|
230
|
+
cy.wait('@' + method + 'Waiter');
|
|
242
231
|
|
|
243
232
|
verifyNoErrorBox();
|
|
244
233
|
|
|
@@ -262,8 +251,11 @@ export function addGridRecord(gridSelector, fieldValues, schema, ancillaryData,
|
|
|
262
251
|
schema = data.schema,
|
|
263
252
|
newData = data.newData,
|
|
264
253
|
editData = data.editData,
|
|
265
|
-
ancillaryData = data.ancillaryData
|
|
266
|
-
|
|
254
|
+
ancillaryData = data.ancillaryData;
|
|
255
|
+
let ancillaryGridSelector = formSelector + '/' + (gridType || Models + 'GridEditor');
|
|
256
|
+
if (ancillaryGridSelector.match(/^(.*)Side(A|B)(.*)$/)) {
|
|
257
|
+
ancillaryGridSelector = ancillaryGridSelector.replace(/^(.*)Side(A|B)(.*)$/, '$1$3Side$2');
|
|
258
|
+
}
|
|
267
259
|
crudWindowedGridRecord(ancillaryGridSelector, newData, editData, schema, ancillaryData, level+1);
|
|
268
260
|
});
|
|
269
261
|
}
|
|
@@ -271,15 +263,11 @@ export function addGridRecord(gridSelector, fieldValues, schema, ancillaryData,
|
|
|
271
263
|
export function addWindowedGridRecord(gridSelector, fieldValues, schema, ancillaryData, level = 0) {
|
|
272
264
|
// adds the record as normal, then closes the editor window
|
|
273
265
|
|
|
274
|
-
cy.
|
|
275
|
-
Cypress.log({ name: 'addWindowedGridRecord ' + gridSelector });
|
|
276
|
-
});
|
|
266
|
+
cy.log('addWindowedGridRecord ' + gridSelector);
|
|
277
267
|
|
|
278
268
|
addGridRecord(gridSelector, fieldValues, schema, ancillaryData, level);
|
|
279
269
|
|
|
280
|
-
cy.
|
|
281
|
-
Cypress.log({ name: 'addWindowedGridRecord: close window ' + gridSelector });
|
|
282
|
-
});
|
|
270
|
+
cy.log('addWindowedGridRecord: close window ' + gridSelector);
|
|
283
271
|
const formSelector = gridSelector + '/editor/form';
|
|
284
272
|
clickCloseButton(formSelector);
|
|
285
273
|
cy.wait(500); // allow window to close
|
|
@@ -288,25 +276,18 @@ export function addWindowedGridRecord(gridSelector, fieldValues, schema, ancilla
|
|
|
288
276
|
export function addInlineGridRecord(gridSelector, fieldValues, schema, ancillaryData, level = 0) {
|
|
289
277
|
// adds the record as normal, then closes the editor window
|
|
290
278
|
|
|
291
|
-
cy.
|
|
292
|
-
Cypress.log({ name: 'addInlineGridRecord ' + gridSelector });
|
|
293
|
-
});
|
|
279
|
+
cy.log('addInlineGridRecord ' + gridSelector);
|
|
294
280
|
|
|
295
281
|
addGridRecord(gridSelector, fieldValues, schema, ancillaryData, level);
|
|
296
282
|
|
|
297
|
-
cy.
|
|
298
|
-
Cypress.log({ name: 'addWindowedGridRecord: close window ' + gridSelector });
|
|
299
|
-
});
|
|
283
|
+
cy.log('addWindowedGridRecord: close window ' + gridSelector);
|
|
300
284
|
const formSelector = gridSelector + '/editor/form';
|
|
301
285
|
clickCloseButton(formSelector);
|
|
302
286
|
cy.wait(500); // allow window to close
|
|
303
287
|
// TODO: Change this to wait until window is closed
|
|
304
288
|
}
|
|
305
289
|
export function editGridRecord(gridSelector, fieldValues, schema, id, level = 0, whichEditor = WINDOWED) {
|
|
306
|
-
|
|
307
|
-
cy.then(() => {
|
|
308
|
-
Cypress.log({ name: 'editGridRecord ' + gridSelector + ' ' + id});
|
|
309
|
-
});
|
|
290
|
+
cy.log('editGridRecord ' + gridSelector + ' ' + id);
|
|
310
291
|
|
|
311
292
|
selectGridRowIfNotAlreadySelectedById(gridSelector, id);
|
|
312
293
|
|
|
@@ -316,11 +297,11 @@ export function editGridRecord(gridSelector, fieldValues, schema, id, level = 0,
|
|
|
316
297
|
formSelector = editorSelector + '/form';
|
|
317
298
|
|
|
318
299
|
if (whichEditor === SIDE) {
|
|
319
|
-
|
|
300
|
+
cy.log('switch to Edit mode if necessary ' + viewerSelector);
|
|
320
301
|
clickToEditButtonIfExists(viewerSelector);
|
|
321
302
|
} else {
|
|
322
303
|
// windowed or inline editor
|
|
323
|
-
|
|
304
|
+
cy.log('click editBtn ' + gridSelector);
|
|
324
305
|
clickEditButton(gridSelector);
|
|
325
306
|
}
|
|
326
307
|
cy.wait(1500); // allow form to build
|
|
@@ -329,10 +310,12 @@ export function editGridRecord(gridSelector, fieldValues, schema, id, level = 0,
|
|
|
329
310
|
fillForm(formSelector, fieldValues, schema, level +1);
|
|
330
311
|
cy.wait(500); // allow validator to enable save button
|
|
331
312
|
// TODO: Change this to wait until save button is enabled
|
|
332
|
-
|
|
333
|
-
|
|
313
|
+
const existingEditWaiter = Cypress.state('aliases')['editWaiter'];
|
|
314
|
+
if (!existingEditWaiter) {
|
|
315
|
+
cy.intercept('POST', '**/edit**').as('editWaiter');
|
|
316
|
+
}
|
|
334
317
|
clickSaveButton(formSelector);
|
|
335
|
-
cy.wait('@
|
|
318
|
+
cy.wait('@editWaiter');
|
|
336
319
|
|
|
337
320
|
verifyNoErrorBox();
|
|
338
321
|
// cy.wait(1000);
|
|
@@ -341,9 +324,7 @@ export function editGridRecord(gridSelector, fieldValues, schema, id, level = 0,
|
|
|
341
324
|
export function editWindowedGridRecord(gridSelector, fieldValues, schema, id, level = 0) {
|
|
342
325
|
// edits the record as normal, then closes the editor window
|
|
343
326
|
|
|
344
|
-
cy.
|
|
345
|
-
Cypress.log({ name: 'editWindowedGridRecord ' + gridSelector + ' ' + id});
|
|
346
|
-
});
|
|
327
|
+
cy.log('editWindowedGridRecord ' + gridSelector + ' ' + id);
|
|
347
328
|
|
|
348
329
|
editGridRecord(gridSelector, fieldValues, schema, id, level, WINDOWED);
|
|
349
330
|
|
|
@@ -355,9 +336,7 @@ export function editWindowedGridRecord(gridSelector, fieldValues, schema, id, le
|
|
|
355
336
|
export function editInlineGridRecord(gridSelector, fieldValues, schema, id, level = 0) {
|
|
356
337
|
// edits the record as normal, then closes the editor window
|
|
357
338
|
|
|
358
|
-
cy.
|
|
359
|
-
Cypress.log({ name: 'editWindowedGridRecord ' + gridSelector + ' ' + id});
|
|
360
|
-
});
|
|
339
|
+
cy.log('editWindowedGridRecord ' + gridSelector + ' ' + id);
|
|
361
340
|
|
|
362
341
|
editGridRecord(gridSelector, fieldValues, schema, id, level, INLINE);
|
|
363
342
|
|
|
@@ -367,27 +346,22 @@ export function editInlineGridRecord(gridSelector, fieldValues, schema, id, leve
|
|
|
367
346
|
// TODO: Change this to wait until window is closed
|
|
368
347
|
}
|
|
369
348
|
export function deleteGridRecord(gridSelector, id) {
|
|
370
|
-
|
|
371
|
-
cy.then(() => {
|
|
372
|
-
Cypress.log({ name: 'deleteGridRecord ' + gridSelector + ' ' + id });
|
|
373
|
-
});
|
|
349
|
+
cy.log('deleteGridRecord ' + gridSelector + ' ' + id);
|
|
374
350
|
|
|
375
351
|
selectGridRowIfNotAlreadySelectedById(gridSelector, id);
|
|
376
352
|
clickDeleteButton(gridSelector);
|
|
377
353
|
cy.wait(500); // allow confirmation box to appear
|
|
378
354
|
|
|
379
355
|
// Click OK on confirmation box
|
|
380
|
-
cy.intercept('POST', '**/delete**').as('
|
|
381
|
-
clickYesButton('
|
|
382
|
-
cy.wait('@
|
|
356
|
+
cy.intercept('POST', '**/delete**').as('deleteWaiter');
|
|
357
|
+
clickYesButton('ConfirmModal');
|
|
358
|
+
cy.wait('@deleteWaiter');
|
|
383
359
|
|
|
384
360
|
verifyNoErrorBox();
|
|
385
361
|
// cy.wait(1000);
|
|
386
362
|
}
|
|
387
363
|
export function switchToEditModeIfNecessary(editorSelector) {
|
|
388
|
-
cy.
|
|
389
|
-
Cypress.log({ name: 'switchToEditModeIfNecessary ' + editorSelector });
|
|
390
|
-
});
|
|
364
|
+
cy.log('switchToEditModeIfNecessary ' + editorSelector);
|
|
391
365
|
|
|
392
366
|
getDomNode(editorSelector).then((editor) => {
|
|
393
367
|
const btn = editor.find('.toEditBtn');
|
|
@@ -399,9 +373,7 @@ export function switchToEditModeIfNecessary(editorSelector) {
|
|
|
399
373
|
});
|
|
400
374
|
}
|
|
401
375
|
export function switchToViewModeIfNecessary(editorSelector) {
|
|
402
|
-
cy.
|
|
403
|
-
Cypress.log({ name: 'switchToViewModeIfNecessary ' + editorSelector });
|
|
404
|
-
});
|
|
376
|
+
cy.log('switchToViewModeIfNecessary ' + editorSelector);
|
|
405
377
|
|
|
406
378
|
getDomNode(editorSelector).then((editor) => {
|
|
407
379
|
const btn = editor.find('.toViewBtn');
|
|
@@ -417,9 +389,7 @@ export function switchToViewModeIfNecessary(editorSelector) {
|
|
|
417
389
|
// Tree
|
|
418
390
|
export function crudWindowedTreeRecord(treeSelector, newData, editData, schema, ancillaryData, level = 0) {
|
|
419
391
|
|
|
420
|
-
cy.
|
|
421
|
-
Cypress.log({ name: 'crudWindowedTreeRecord ' + treeSelector });
|
|
422
|
-
});
|
|
392
|
+
cy.log('crudWindowedTreeRecord ' + treeSelector);
|
|
423
393
|
|
|
424
394
|
getDomNode(treeSelector).scrollIntoView();
|
|
425
395
|
|
|
@@ -428,9 +398,7 @@ export function crudWindowedTreeRecord(treeSelector, newData, editData, schema,
|
|
|
428
398
|
|
|
429
399
|
cy.get('@id' + level).then((id) => {
|
|
430
400
|
|
|
431
|
-
cy.
|
|
432
|
-
Cypress.log({ name: 'crudWindowedTreeRecord: continue thru CRUD ' + treeSelector });
|
|
433
|
-
});
|
|
401
|
+
cy.log('crudWindowedTreeRecord: continue thru CRUD ' + treeSelector);
|
|
434
402
|
|
|
435
403
|
// read
|
|
436
404
|
clickReloadButton(treeSelector);
|
|
@@ -450,9 +418,7 @@ export function crudSideTreeRecord(treeSelector, newData, editData, schema, anci
|
|
|
450
418
|
// NOTE: the 'level' arg allows this fn to be called recursively
|
|
451
419
|
// and to use the @id alias correctly, keeping track of the level of recursion
|
|
452
420
|
// so the CRUD operations don't step on each other at different levels.
|
|
453
|
-
cy.
|
|
454
|
-
Cypress.log({ name: 'crudSideTreeRecord ' + treeSelector });
|
|
455
|
-
});
|
|
421
|
+
cy.log('crudSideTreeRecord ' + treeSelector);
|
|
456
422
|
|
|
457
423
|
getDomNode(treeSelector).scrollIntoView();
|
|
458
424
|
|
|
@@ -477,9 +443,7 @@ export function crudSideTreeRecord(treeSelector, newData, editData, schema, anci
|
|
|
477
443
|
}
|
|
478
444
|
export function addTreeRecord(treeSelector, fieldValues, schema, ancillaryData, level = 0) {
|
|
479
445
|
|
|
480
|
-
cy.
|
|
481
|
-
Cypress.log({ name: 'addTreeRecord ' + treeSelector });
|
|
482
|
-
});
|
|
446
|
+
cy.log('addTreeRecord ' + treeSelector);
|
|
483
447
|
|
|
484
448
|
const
|
|
485
449
|
editorSelector = treeSelector + '/editor',
|
|
@@ -508,9 +472,9 @@ export function addTreeRecord(treeSelector, fieldValues, schema, ancillaryData,
|
|
|
508
472
|
if (schema.repository.isRemotePhantomMode) {
|
|
509
473
|
method = 'edit';
|
|
510
474
|
}
|
|
511
|
-
cy.intercept('POST', '**/' + method + '**').as('
|
|
475
|
+
cy.intercept('POST', '**/' + method + '**').as(method + 'Waiter');
|
|
512
476
|
clickSaveButton(formSelector); // it's labeled 'Add' in the form, but is really the save button
|
|
513
|
-
cy.wait('@
|
|
477
|
+
cy.wait('@' + method + 'Waiter');
|
|
514
478
|
|
|
515
479
|
verifyNoErrorBox();
|
|
516
480
|
|
|
@@ -534,8 +498,11 @@ export function addTreeRecord(treeSelector, fieldValues, schema, ancillaryData,
|
|
|
534
498
|
schema = data.schema,
|
|
535
499
|
newData = data.newData,
|
|
536
500
|
editData = data.editData,
|
|
537
|
-
ancillaryData = data.ancillaryData
|
|
538
|
-
|
|
501
|
+
ancillaryData = data.ancillaryData;
|
|
502
|
+
let ancillaryGridSelector = formSelector + '/' + (gridType || Models + 'GridEditor');
|
|
503
|
+
if (ancillaryGridSelector.match(/^(.*)Side(A|B)(.*)$/)) {
|
|
504
|
+
ancillaryGridSelector = ancillaryGridSelector.replace(/^(.*)Side(A|B)(.*)$/, '$1$3Side$2');
|
|
505
|
+
}
|
|
539
506
|
crudWindowedGridRecord(ancillaryGridSelector, newData, editData, schema, ancillaryData, level+1);
|
|
540
507
|
});
|
|
541
508
|
}
|
|
@@ -543,15 +510,11 @@ export function addTreeRecord(treeSelector, fieldValues, schema, ancillaryData,
|
|
|
543
510
|
export function addWindowedTreeRecord(treeSelector, fieldValues, schema, ancillaryData, level = 0) {
|
|
544
511
|
// adds the record as normal, then closes the editor window
|
|
545
512
|
|
|
546
|
-
cy.
|
|
547
|
-
Cypress.log({ name: 'addWindowedTreeRecord ' + treeSelector });
|
|
548
|
-
});
|
|
513
|
+
cy.log('addWindowedTreeRecord ' + treeSelector);
|
|
549
514
|
|
|
550
515
|
addTreeRecord(treeSelector, fieldValues, schema, ancillaryData, level);
|
|
551
516
|
|
|
552
|
-
cy.
|
|
553
|
-
Cypress.log({ name: 'addWindowedTreeRecord: close window ' + treeSelector });
|
|
554
|
-
});
|
|
517
|
+
cy.log('addWindowedTreeRecord: close window ' + treeSelector);
|
|
555
518
|
const formSelector = treeSelector + '/editor/form';
|
|
556
519
|
clickCloseButton(formSelector);
|
|
557
520
|
cy.wait(500); // allow window to close
|
|
@@ -559,9 +522,7 @@ export function addWindowedTreeRecord(treeSelector, fieldValues, schema, ancilla
|
|
|
559
522
|
}
|
|
560
523
|
export function editTreeRecord(treeSelector, fieldValues, schema, id, level = 0, whichEditor = WINDOWED) {
|
|
561
524
|
|
|
562
|
-
cy.
|
|
563
|
-
Cypress.log({ name: 'editTreeRecord ' + treeSelector + ' ' + id});
|
|
564
|
-
});
|
|
525
|
+
cy.log('editTreeRecord ' + treeSelector + ' ' + id);
|
|
565
526
|
|
|
566
527
|
selectTreeNodeIfNotAlreadySelectedById(treeSelector, id);
|
|
567
528
|
|
|
@@ -571,10 +532,10 @@ export function editTreeRecord(treeSelector, fieldValues, schema, id, level = 0,
|
|
|
571
532
|
formSelector = editorSelector + '/form';
|
|
572
533
|
|
|
573
534
|
if (whichEditor === SIDE) {
|
|
574
|
-
|
|
535
|
+
cy.log('switch to Edit mode if necessary ' + viewerSelector);
|
|
575
536
|
clickToEditButtonIfExists(viewerSelector);
|
|
576
537
|
} else {
|
|
577
|
-
|
|
538
|
+
cy.log('click editBtn ' + treeSelector);
|
|
578
539
|
clickEditButton(treeSelector);
|
|
579
540
|
}
|
|
580
541
|
cy.wait(1500); // allow form to build
|
|
@@ -584,9 +545,12 @@ export function editTreeRecord(treeSelector, fieldValues, schema, id, level = 0,
|
|
|
584
545
|
cy.wait(500); // allow validator to enable save button
|
|
585
546
|
// TODO: Change this to wait until save button is enabled
|
|
586
547
|
|
|
587
|
-
|
|
548
|
+
const existingEditWaiter = Cypress.state('aliases')['editWaiter'];
|
|
549
|
+
if (!existingEditWaiter) {
|
|
550
|
+
cy.intercept('POST', '**/edit**').as('editWaiter');
|
|
551
|
+
}
|
|
588
552
|
clickSaveButton(formSelector);
|
|
589
|
-
cy.wait('@
|
|
553
|
+
cy.wait('@editWaiter');
|
|
590
554
|
|
|
591
555
|
verifyNoErrorBox();
|
|
592
556
|
// cy.wait(1000);
|
|
@@ -595,9 +559,7 @@ export function editTreeRecord(treeSelector, fieldValues, schema, id, level = 0,
|
|
|
595
559
|
export function editWindowedTreeRecord(treeSelector, fieldValues, schema, id, level = 0) {
|
|
596
560
|
// edits the record as normal, then closes the editor window
|
|
597
561
|
|
|
598
|
-
cy.
|
|
599
|
-
Cypress.log({ name: 'editWindowedTreeRecord ' + treeSelector + ' ' + id});
|
|
600
|
-
});
|
|
562
|
+
cy.log('editWindowedTreeRecord ' + treeSelector + ' ' + id);
|
|
601
563
|
|
|
602
564
|
editTreeRecord(treeSelector, fieldValues, schema, id, level, WINDOWED);
|
|
603
565
|
|
|
@@ -608,18 +570,16 @@ export function editWindowedTreeRecord(treeSelector, fieldValues, schema, id, le
|
|
|
608
570
|
}
|
|
609
571
|
export function deleteTreeRecord(treeSelector, id) {
|
|
610
572
|
|
|
611
|
-
cy.
|
|
612
|
-
Cypress.log({ name: 'deleteTreeRecord ' + treeSelector + ' ' + id });
|
|
613
|
-
});
|
|
573
|
+
cy.log('deleteTreeRecord ' + treeSelector + ' ' + id);
|
|
614
574
|
|
|
615
575
|
selectTreeNodeIfNotAlreadySelectedById(treeSelector, id);
|
|
616
576
|
clickDeleteButton(treeSelector);
|
|
617
577
|
cy.wait(500); // allow confirmation box to appear
|
|
618
578
|
|
|
619
579
|
// Click OK on confirmation box
|
|
620
|
-
cy.intercept('POST', '**/delete**').as('
|
|
621
|
-
clickYesButton('
|
|
622
|
-
cy.wait('@
|
|
580
|
+
cy.intercept('POST', '**/delete**').as('deleteWaiter');
|
|
581
|
+
clickYesButton('ConfirmModal');
|
|
582
|
+
cy.wait('@deleteWaiter');
|
|
623
583
|
|
|
624
584
|
verifyNoErrorBox();
|
|
625
585
|
// cy.wait(1000);
|
|
@@ -866,9 +826,7 @@ export function runReportsManagerTests(reportData) {
|
|
|
866
826
|
|
|
867
827
|
it('Report ' + report.id, function() {
|
|
868
828
|
|
|
869
|
-
cy.
|
|
870
|
-
Cypress.log({ name: 'report ' + report.id });
|
|
871
|
-
});
|
|
829
|
+
cy.log('report ' + report.id);
|
|
872
830
|
|
|
873
831
|
const selector = 'Report-' + report.id;
|
|
874
832
|
|
|
@@ -878,17 +836,17 @@ export function runReportsManagerTests(reportData) {
|
|
|
878
836
|
|
|
879
837
|
|
|
880
838
|
// Press Excel button
|
|
881
|
-
cy.intercept('GET', '**/getReport**').as('
|
|
839
|
+
cy.intercept('GET', '**/getReport**').as('getWaiter');
|
|
882
840
|
clickButton(selector, 'excelBtn');
|
|
883
|
-
cy.wait('@
|
|
841
|
+
cy.wait('@getWaiter', { timeout: 10000 }).then((interception) => {
|
|
884
842
|
expect(interception.response.headers['content-type']).to.include('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
|
885
843
|
});
|
|
886
844
|
|
|
887
845
|
|
|
888
846
|
// Press PDF button
|
|
889
|
-
cy.intercept('POST', '**/getReport**').as('
|
|
847
|
+
cy.intercept('POST', '**/getReport**').as('getReportWaiter');
|
|
890
848
|
clickButton(selector, 'pdfBtn');
|
|
891
|
-
cy.wait('@
|
|
849
|
+
cy.wait('@getReportWaiter', { timeout: 10000 }).then((interception) => {
|
|
892
850
|
expect(interception.response.headers['content-type']).to.include('pdf');
|
|
893
851
|
});
|
|
894
852
|
|
|
@@ -12,6 +12,9 @@ import {
|
|
|
12
12
|
crudTag,
|
|
13
13
|
crudJson,
|
|
14
14
|
} from './crud_functions.js';
|
|
15
|
+
import {
|
|
16
|
+
clickXButtonIfEnabled
|
|
17
|
+
} from './button_functions.js';
|
|
15
18
|
import natsort from 'natsort';
|
|
16
19
|
import _ from 'lodash';
|
|
17
20
|
const $ = Cypress.$;
|
|
@@ -29,6 +32,7 @@ export function setCustomFormFunctions(fns) {
|
|
|
29
32
|
* @param {object} schema - fieldName/fieldType pairs
|
|
30
33
|
*/
|
|
31
34
|
export function fillForm(selector, fieldValues, schema, level = 0) {
|
|
35
|
+
cy.log('fillForm');
|
|
32
36
|
_.each(fieldValues, (value, fieldName) => {
|
|
33
37
|
|
|
34
38
|
const selectors = [selector, 'field-' + fieldName];
|
|
@@ -116,6 +120,7 @@ export function fillForm(selector, fieldValues, schema, level = 0) {
|
|
|
116
120
|
// export function setFileValue(field, value) {
|
|
117
121
|
// }
|
|
118
122
|
export function setArrayComboValue(selectors, value) {
|
|
123
|
+
cy.log('setArrayComboValue ' + value);
|
|
119
124
|
getDomNode([...selectors, 'input']).then((field) => {
|
|
120
125
|
cy.get(field).clear({ force: true });
|
|
121
126
|
if (value) {
|
|
@@ -129,18 +134,25 @@ export function setArrayComboValue(selectors, value) {
|
|
|
129
134
|
});
|
|
130
135
|
}
|
|
131
136
|
export function setComboValue(selectors, value) {
|
|
137
|
+
cy.log('setComboValue ' + value);
|
|
132
138
|
getDomNode([...selectors, 'input']).then((field) => {
|
|
133
|
-
cy.get(field).clear({ force: true });
|
|
139
|
+
// cy.get(field).clear({ force: true });
|
|
140
|
+
clickXButtonIfEnabled(selectors); // clear current value
|
|
134
141
|
if (value) {
|
|
135
|
-
|
|
142
|
+
const existingGetWaiter = Cypress.state('aliases')['getWaiter'];
|
|
143
|
+
if (!existingGetWaiter) {
|
|
144
|
+
cy.intercept('GET', '**/get**').as('getWaiter'); // set up waiter
|
|
145
|
+
}
|
|
146
|
+
|
|
136
147
|
cy.get(field)
|
|
137
148
|
.type(value, { delay: 40, force: true }) // slow it down a bit, so React has time to re-render
|
|
138
149
|
.wait('@getWaiter'); // allow dropdown to load
|
|
139
150
|
|
|
140
151
|
cy.get(field)
|
|
141
|
-
.wait(
|
|
152
|
+
.wait(1000) // render
|
|
153
|
+
|
|
142
154
|
.type('{downarrow}')
|
|
143
|
-
.wait(
|
|
155
|
+
.wait(500) // allow time for selection
|
|
144
156
|
|
|
145
157
|
.type('{enter}')
|
|
146
158
|
.wait(250); // allow time to register enter key
|
|
@@ -148,6 +160,7 @@ export function setComboValue(selectors, value) {
|
|
|
148
160
|
});
|
|
149
161
|
}
|
|
150
162
|
export function setTagValue(selectors, value) {
|
|
163
|
+
cy.log('setTagValue ' + value);
|
|
151
164
|
const values = !_.isEmpty(value) ? JSON.parse(value) : null;
|
|
152
165
|
|
|
153
166
|
// Clear any previously selected tags
|
|
@@ -173,15 +186,18 @@ export function setTagValue(selectors, value) {
|
|
|
173
186
|
if (!_.isEmpty(values)) {
|
|
174
187
|
_.each(values, (value) => {
|
|
175
188
|
const id = value.id;
|
|
176
|
-
|
|
189
|
+
const existingGetWaiter = Cypress.state('aliases')['getWaiter'];
|
|
190
|
+
if (!existingGetWaiter) {
|
|
191
|
+
cy.intercept('GET', '**/get**').as('getWaiter'); // set up waiter
|
|
192
|
+
}
|
|
177
193
|
cy.get(field)
|
|
178
194
|
.type('id:' + id, { delay: 40, force: true }) // slow it down a bit, so React has time to re-render
|
|
179
195
|
.wait('@getWaiter'); // allow dropdown to load
|
|
180
196
|
|
|
181
197
|
cy.get(field)
|
|
182
|
-
.wait(
|
|
198
|
+
.wait(1000) // render
|
|
183
199
|
.type('{downarrow}')
|
|
184
|
-
.wait(
|
|
200
|
+
.wait(500); // allow time for selection
|
|
185
201
|
});
|
|
186
202
|
|
|
187
203
|
// press trigger to hide dropdown
|
|
@@ -190,6 +206,7 @@ export function setTagValue(selectors, value) {
|
|
|
190
206
|
});
|
|
191
207
|
}
|
|
192
208
|
export function setDateValue(selectors, value) {
|
|
209
|
+
cy.log('setDateValue ' + value);
|
|
193
210
|
getDomNode(selectors).then((field) => {
|
|
194
211
|
cy.get(field).clear({ force: true });
|
|
195
212
|
if (value) {
|
|
@@ -200,6 +217,7 @@ export function setDateValue(selectors, value) {
|
|
|
200
217
|
});
|
|
201
218
|
}
|
|
202
219
|
export function setNumberValue(selectors, value) {
|
|
220
|
+
cy.log('setNumberValue ' + value);
|
|
203
221
|
// setTextValue(selectors, value);
|
|
204
222
|
|
|
205
223
|
getDomNode(selectors).clear({ force: true });
|
|
@@ -210,6 +228,7 @@ export function setNumberValue(selectors, value) {
|
|
|
210
228
|
}
|
|
211
229
|
}
|
|
212
230
|
export function setToggleValue(selectors, value) {
|
|
231
|
+
cy.log('setToggleValue ' + value);
|
|
213
232
|
selectors.push('input[role="switch"]');
|
|
214
233
|
if (value) {
|
|
215
234
|
getToggleState(selectors).then((isYes) => {
|
|
@@ -228,6 +247,7 @@ export function setToggleValue(selectors, value) {
|
|
|
228
247
|
}
|
|
229
248
|
}
|
|
230
249
|
export function getToggleState(selectors) {
|
|
250
|
+
cy.log('getToggleState');
|
|
231
251
|
return getDomNode(selectors).then((node) => {
|
|
232
252
|
if (!node.length) {
|
|
233
253
|
return null;
|
|
@@ -236,9 +256,11 @@ export function getToggleState(selectors) {
|
|
|
236
256
|
});
|
|
237
257
|
}
|
|
238
258
|
export function clickToggle(selectors, options = {}) {
|
|
259
|
+
cy.log('clickToggle');
|
|
239
260
|
getDomNode(selectors).click(options);
|
|
240
261
|
}
|
|
241
262
|
export function setTextValue(selectors, value) {
|
|
263
|
+
cy.log('setTextValue ' + value);
|
|
242
264
|
getDomNode(selectors).clear({ force: true });
|
|
243
265
|
if (value !== null && value !== '') {
|
|
244
266
|
getDomNode(selectors)
|
|
@@ -247,6 +269,7 @@ export function setTextValue(selectors, value) {
|
|
|
247
269
|
}
|
|
248
270
|
}
|
|
249
271
|
export function setTextAreaValue(selectors, value) {
|
|
272
|
+
cy.log('setTextAreaValue ' + value);
|
|
250
273
|
getDomNode(selectors).clear({ force: true });
|
|
251
274
|
if (value !== null && value !== '') {
|
|
252
275
|
getDomNode(selectors)
|
|
@@ -254,6 +277,7 @@ export function setTextAreaValue(selectors, value) {
|
|
|
254
277
|
}
|
|
255
278
|
}
|
|
256
279
|
export function setInputValue(selectors, value) {
|
|
280
|
+
cy.log('setInputValue ' + value);
|
|
257
281
|
setTextValue(selectors, value);
|
|
258
282
|
}
|
|
259
283
|
|
|
@@ -14,9 +14,11 @@ const $ = Cypress.$;
|
|
|
14
14
|
|
|
15
15
|
// Get rows
|
|
16
16
|
export function hasRowWithFieldValue(gridSelector, field, value) {
|
|
17
|
+
cy.log('hasRowWithFieldValue ' + gridSelector + ' ' + field + ' ' + value);
|
|
17
18
|
return getDomNodes([gridSelector, 'row', 'cell-' + field]).contains(value);
|
|
18
19
|
}
|
|
19
20
|
export function getRowWithFieldValue(gridSelector, field, value) {
|
|
21
|
+
cy.log('getRowWithFieldValue ' + gridSelector + ' ' + field + ' ' + value);
|
|
20
22
|
return getDomNodes([gridSelector, 'row', 'cell-' + field]).contains(value).then((cells) => {
|
|
21
23
|
if (!cells.length) {
|
|
22
24
|
return null;
|
|
@@ -39,17 +41,13 @@ export function getRowWithFieldValue(gridSelector, field, value) {
|
|
|
39
41
|
|
|
40
42
|
// Select rows
|
|
41
43
|
export function selectGridRowById(gridSelector, id) {
|
|
42
|
-
cy.
|
|
43
|
-
Cypress.log({ name: 'selectGridRowById ' + gridSelector + ' ' + id});
|
|
44
|
-
});
|
|
44
|
+
cy.log('selectGridRowById ' + gridSelector + ' ' + id);
|
|
45
45
|
const rowSelector = getGridRowSelectorById(gridSelector, id);
|
|
46
46
|
getDomNode([gridSelector, rowSelector])
|
|
47
47
|
.click();
|
|
48
48
|
}
|
|
49
49
|
export function selectGridRowIfNotAlreadySelectedById(gridSelector, id) {
|
|
50
|
-
cy.
|
|
51
|
-
Cypress.log({ name: 'selectGridRowIfNotAlreadySelectedById ' + gridSelector + ' ' + id});
|
|
52
|
-
});
|
|
50
|
+
cy.log('selectGridRowIfNotAlreadySelectedById ' + gridSelector + ' ' + id);
|
|
53
51
|
const rowSelector = getGridRowSelectorById(gridSelector, id);
|
|
54
52
|
getDomNode([gridSelector, rowSelector]).then((row) => {
|
|
55
53
|
const found = row.find('[data-testid="row-selected"]')
|
|
@@ -86,6 +84,7 @@ export function verifyGridRecordDoesNotExistByValue(gridSelector, fieldValues, s
|
|
|
86
84
|
field = schema.model.displayProperty,
|
|
87
85
|
value = fieldValues[field];
|
|
88
86
|
|
|
87
|
+
cy.log('verifyGridRecordDoesNotExistByValue ' + gridSelector + ' ' + value);
|
|
89
88
|
getDomNodes([gridSelector, 'row', 'cell-' + field])
|
|
90
89
|
.contains(value, { timeout: 500 })
|
|
91
90
|
.should('not.exist');
|
|
@@ -95,31 +94,26 @@ export function verifyGridRecordExistsByValue(gridSelector, fieldValues, schema)
|
|
|
95
94
|
field = schema.model.displayProperty,
|
|
96
95
|
value = fieldValues[field];
|
|
97
96
|
|
|
97
|
+
cy.log('verifyGridRecordExistsByValue ' + gridSelector + ' ' + value);
|
|
98
98
|
getDomNodes([gridSelector, 'row', 'cell-' + field])
|
|
99
99
|
.contains(value, { timeout: 500 })
|
|
100
100
|
.should('exist');
|
|
101
101
|
}
|
|
102
102
|
export function verifyGridRecordExistsById(gridSelector, id) {
|
|
103
|
-
cy.
|
|
104
|
-
Cypress.log({ name: 'verifyGridRecordExistsById ' + gridSelector + ' ' + id });
|
|
105
|
-
});
|
|
103
|
+
cy.log('verifyGridRecordExistsById ' + gridSelector + ' ' + id);
|
|
106
104
|
|
|
107
105
|
const rowSelector = getGridRowSelectorById(gridSelector, id);
|
|
108
106
|
getDomNodes([gridSelector, rowSelector])
|
|
109
107
|
.should('exist');
|
|
110
108
|
}
|
|
111
109
|
export function verifyGridRecordDoesNotExistById(gridSelector, id) {
|
|
112
|
-
cy.
|
|
113
|
-
Cypress.log({ name: 'verifyGridRecordDoesNotExistById ' + gridSelector + ' ' + id });
|
|
114
|
-
});
|
|
110
|
+
cy.log('verifyGridRecordDoesNotExistById ' + gridSelector + ' ' + id);
|
|
115
111
|
const rowSelector = getGridRowSelectorById(gridSelector, id);
|
|
116
112
|
getDomNodes([gridSelector, rowSelector])
|
|
117
113
|
.should('not.exist');
|
|
118
114
|
}
|
|
119
115
|
export function verifyGridRowIsSelectedById(gridSelector, id) {
|
|
120
|
-
cy.
|
|
121
|
-
Cypress.log({ name: 'verifyGridRowIsSelectedById ' + gridSelector + ' ' + id});
|
|
122
|
-
});
|
|
116
|
+
cy.log('verifyGridRowIsSelectedById ' + gridSelector + ' ' + id);
|
|
123
117
|
const rowSelector = getGridRowSelectorById(gridSelector, id);
|
|
124
118
|
getDomNodes([gridSelector, rowSelector, 'row-selected'])
|
|
125
119
|
.should('exist');
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
// /____/
|
|
13
13
|
|
|
14
14
|
export function login(loginId = null, password = null) {
|
|
15
|
+
cy.log('login');
|
|
15
16
|
if (!loginId) {
|
|
16
17
|
loginId = Cypress.env('loginId');
|
|
17
18
|
}
|
|
@@ -34,6 +35,7 @@ export function login(loginId = null, password = null) {
|
|
|
34
35
|
});
|
|
35
36
|
}
|
|
36
37
|
export function logout() {
|
|
38
|
+
cy.log('logout');
|
|
37
39
|
const baseDir = Cypress.env('baseDir');
|
|
38
40
|
getDomNode(baseDir + 'logout').click({ force: true });
|
|
39
41
|
}
|
|
@@ -47,6 +49,7 @@ export function logout() {
|
|
|
47
49
|
// /____/
|
|
48
50
|
|
|
49
51
|
export function navigateViaTabOrHomeButtonTo(url) {
|
|
52
|
+
cy.log('navigateViaTabOrHomeButtonTo ' + url);
|
|
50
53
|
// i.e. If we're on home screen, press the button.
|
|
51
54
|
// If we have a tab navigation, press the tab's button
|
|
52
55
|
const baseDir = Cypress.env('baseDir');
|
|
@@ -54,9 +57,11 @@ export function navigateViaTabOrHomeButtonTo(url) {
|
|
|
54
57
|
cy.url().should('include', url);
|
|
55
58
|
}
|
|
56
59
|
export function navigateToHome() {
|
|
60
|
+
cy.log('navigateToHome');
|
|
57
61
|
navigateToScreen('home');
|
|
58
62
|
}
|
|
59
63
|
export function navigateToScreen(path) {
|
|
64
|
+
cy.log('navigateToScreen ' + path);
|
|
60
65
|
const
|
|
61
66
|
baseUrl = Cypress.env('baseUrl'),
|
|
62
67
|
baseDir = Cypress.env('baseDir');
|
|
@@ -14,9 +14,11 @@ const $ = Cypress.$;
|
|
|
14
14
|
|
|
15
15
|
// Get rows
|
|
16
16
|
export function hasNodeWithFieldValue(treeSelector, field, value) {
|
|
17
|
+
cy.log('hasNodeWithFieldValue ' + treeSelector + ' ' + field + ' ' + value);
|
|
17
18
|
return getDomNodes([treeSelector, 'row', 'cell-' + field]).contains(value);
|
|
18
19
|
}
|
|
19
20
|
export function getNodeWithFieldValue(treeSelector, field, value) {
|
|
21
|
+
cy.log('getNodeWithFieldValue ' + treeSelector + ' ' + field + ' ' + value);
|
|
20
22
|
return getDomNodes([treeSelector, 'row', 'cell-' + field]).contains(value).then((cells) => {
|
|
21
23
|
if (!cells.length) {
|
|
22
24
|
return null;
|
|
@@ -27,6 +29,7 @@ export function getNodeWithFieldValue(treeSelector, field, value) {
|
|
|
27
29
|
});
|
|
28
30
|
}
|
|
29
31
|
export function getFirstTreeRootNode(treeSelector) {
|
|
32
|
+
cy.log('getFirstTreeRootNode ' + treeSelector);
|
|
30
33
|
return cy.get('[data-testid="' + treeSelector + '"]:first ' +
|
|
31
34
|
'[data-testid="ScrollView"]:first > div > div:first'); // this is fragile!
|
|
32
35
|
}
|
|
@@ -43,17 +46,13 @@ export function getFirstTreeRootNode(treeSelector) {
|
|
|
43
46
|
|
|
44
47
|
// Select rows
|
|
45
48
|
export function selectTreeNodeById(treeSelector, id) {
|
|
46
|
-
cy.
|
|
47
|
-
Cypress.log({ name: 'selectTreeNodeById ' + treeSelector + ' ' + id});
|
|
48
|
-
});
|
|
49
|
+
cy.log('selectTreeNodeById ' + treeSelector + ' ' + id);
|
|
49
50
|
const rowSelector = getTreeNodeSelectorById(treeSelector, id);
|
|
50
51
|
getDomNode([treeSelector, rowSelector])
|
|
51
52
|
.click();
|
|
52
53
|
}
|
|
53
54
|
export function selectTreeNodeIfNotAlreadySelectedById(treeSelector, id) {
|
|
54
|
-
cy.
|
|
55
|
-
Cypress.log({ name: 'selectTreeNodeIfNotAlreadySelectedById ' + treeSelector + ' ' + id});
|
|
56
|
-
});
|
|
55
|
+
cy.log('selectTreeNodeIfNotAlreadySelectedById ' + treeSelector + ' ' + id);
|
|
57
56
|
const rowSelector = getTreeNodeSelectorById(treeSelector, id);
|
|
58
57
|
getDomNode([treeSelector, rowSelector]).then((row) => {
|
|
59
58
|
const found = row.find('[data-testid="node-selected"]')
|
|
@@ -90,6 +89,7 @@ export function verifyTreeRecordDoesNotExistByValue(treeSelector, fieldValues, s
|
|
|
90
89
|
field = schema.model.displayProperty,
|
|
91
90
|
value = fieldValues[field];
|
|
92
91
|
|
|
92
|
+
cy.log('verifyTreeRecordDoesNotExistByValue ' + treeSelector + ' ' + value);
|
|
93
93
|
getDomNodes([treeSelector, 'row', 'cell-' + field])
|
|
94
94
|
.contains(value, { timeout: 500 })
|
|
95
95
|
.should('not.exist');
|
|
@@ -99,31 +99,26 @@ export function verifyTreeRecordExistsByValue(treeSelector, fieldValues, schema)
|
|
|
99
99
|
field = schema.model.displayProperty,
|
|
100
100
|
value = fieldValues[field];
|
|
101
101
|
|
|
102
|
+
cy.log('verifyTreeRecordExistsByValue ' + treeSelector + ' ' + value);
|
|
102
103
|
getDomNodes([treeSelector, 'row', 'cell-' + field])
|
|
103
104
|
.contains(value, { timeout: 500 })
|
|
104
105
|
.should('exist');
|
|
105
106
|
}
|
|
106
107
|
export function verifyTreeRecordExistsById(treeSelector, id) {
|
|
107
|
-
cy.
|
|
108
|
-
Cypress.log({ name: 'verifyTreeRecordExistsById ' + treeSelector + ' ' + id });
|
|
109
|
-
});
|
|
108
|
+
cy.log('verifyTreeRecordExistsById ' + treeSelector + ' ' + id);
|
|
110
109
|
|
|
111
110
|
const rowSelector = getTreeNodeSelectorById(treeSelector, id);
|
|
112
111
|
getDomNodes([treeSelector, rowSelector])
|
|
113
112
|
.should('exist');
|
|
114
113
|
}
|
|
115
114
|
export function verifyTreeRecordDoesNotExistById(treeSelector, id) {
|
|
116
|
-
cy.
|
|
117
|
-
Cypress.log({ name: 'verifyTreeRecordDoesNotExistById ' + treeSelector + ' ' + id });
|
|
118
|
-
});
|
|
115
|
+
cy.log('verifyTreeRecordDoesNotExistById ' + treeSelector + ' ' + id);
|
|
119
116
|
const rowSelector = getTreeNodeSelectorById(treeSelector, id);
|
|
120
117
|
getDomNodes([treeSelector, rowSelector])
|
|
121
118
|
.should('not.exist');
|
|
122
119
|
}
|
|
123
120
|
export function verifyTreeNodeIsSelectedById(treeSelector, id) {
|
|
124
|
-
cy.
|
|
125
|
-
Cypress.log({ name: 'verifyTreeNodeIsSelectedById ' + treeSelector + ' ' + id});
|
|
126
|
-
});
|
|
121
|
+
cy.log('verifyTreeNodeIsSelectedById ' + treeSelector + ' ' + id);
|
|
127
122
|
const rowSelector = getTreeNodeSelectorById(treeSelector, id);
|
|
128
123
|
getDomNodes([treeSelector, rowSelector, 'node-selected'])
|
|
129
124
|
.should('exist');
|
|
@@ -10,6 +10,10 @@ import moment from 'moment';
|
|
|
10
10
|
export function fixInflector(str) {
|
|
11
11
|
// inflector-js doesn't handle pluralization of 'equipment' correctly
|
|
12
12
|
str = str.replace(/quipments/, 'quipment');
|
|
13
|
+
|
|
14
|
+
// Don't pluralize 'SideA' or 'SideB'
|
|
15
|
+
str = str.replace(/SideAs/, 'SideA');
|
|
16
|
+
str = str.replace(/SideBs/, 'SideB');
|
|
13
17
|
return str;
|
|
14
18
|
}
|
|
15
19
|
export function getPropertyDefinitionFromSchema(fieldName, schema) {
|