3
0

Add cy ids to number and string fields, and RecordBase

This commit is contained in:
Katrin Yordanova 2024-01-25 11:13:34 +02:00
parent 9f301a19b6
commit 72d6ff8ee5
4 changed files with 13 additions and 0 deletions

View File

@ -1,5 +1,6 @@
<template>
<b-form-group
:data-test-id="getFieldCypressId(label || value)"
:label-cols-md="horizontal && '5'"
:label-cols-xl="horizontal && '4'"
:content-cols-md="horizontal && '7'"

View File

@ -1,5 +1,6 @@
<template>
<b-form-group
:data-test-id="getFieldCypressId(label || value)"
:label-cols-md="horizontal && '5'"
:label-cols-xl="horizontal && '4'"
:content-cols-md="horizontal && '7'"

View File

@ -144,5 +144,11 @@ export default {
return !!recordPageID || !!magnifiedBlockID
},
},
methods: {
getFieldCypressId (field) {
return `field-${field.toLowerCase().split(' ').join('-')}`
},
},
}
</script>

View File

@ -18,6 +18,7 @@
<b-form-group
v-if="canDisplay(field)"
:key="field.id"
:data-test-id="getFieldCypressId(field.label || field.name)"
:label-cols-md="options.horizontalFieldLayoutEnabled && '6'"
:label-cols-xl="options.horizontalFieldLayoutEnabled && '5'"
:content-cols-md="options.horizontalFieldLayoutEnabled && '6'"
@ -332,6 +333,10 @@ export default {
cancel()
})
},
getFieldCypressId (field) {
return `field-${field.toLowerCase().split(' ').join('-')}`
},
},
}
</script>