@@ -198,29 +198,29 @@ defineExpose({
198198 >
199199 <!-- TITLE AS DIV -->
200200 <div v-if =" (!mutableConfig.inside || isPrinting) && onionConfig.style.chart.title.text" :style =" `width:100%;background:${onionConfig.style.chart.backgroundColor}`" >
201- <div :style =" `width:100%;text-align:center;color:${onionConfig.style.chart.title.color};font-size:${onionConfig.style.chart.title.fontSize}px;font-weight:${onionConfig.style.chart.title.bold ? 'bold': ''}`" >
201+ <div data-cy = " onion-div-title " :style =" `width:100%;text-align:center;color:${onionConfig.style.chart.title.color};font-size:${onionConfig.style.chart.title.fontSize}px;font-weight:${onionConfig.style.chart.title.bold ? 'bold': ''}`" >
202202 {{ onionConfig.style.chart.title.text }}
203203 </div >
204- <div v-if =" onionConfig.style.chart.title.subtitle.text" :style =" `width:100%;text-align:center;color:${onionConfig.style.chart.title.subtitle.color};font-size:${onionConfig.style.chart.title.subtitle.fontSize}px;font-weight:${onionConfig.style.chart.title.subtitle.bold ? 'bold': ''}`" >
204+ <div data-cy = " onion-div-subtitle " v-if =" onionConfig.style.chart.title.subtitle.text" :style =" `width:100%;text-align:center;color:${onionConfig.style.chart.title.subtitle.color};font-size:${onionConfig.style.chart.title.subtitle.fontSize}px;font-weight:${onionConfig.style.chart.title.subtitle.bold ? 'bold': ''}`" >
205205 {{ onionConfig.style.chart.title.subtitle.text }}
206206 </div >
207207 </div >
208208
209209 <!-- OPTIONS -->
210210 <details class =" vue-ui-onion-user-options" :style =" `background:${onionConfig.style.chart.backgroundColor};color:${onionConfig.style.chart.color}`" data-html2canvas-ignore v-if =" onionConfig.userOptions.show" ref =" details" >
211- <summary :style =" `background:${onionConfig.style.chart.backgroundColor};color:${onionConfig.style.chart.color}`" >{{ onionConfig.userOptions.title }}</summary >
211+ <summary data-cy = " onion-summary " :style =" `background:${onionConfig.style.chart.backgroundColor};color:${onionConfig.style.chart.color}`" >{{ onionConfig.userOptions.title }}</summary >
212212 <div class =" vue-ui-onion-user-options-items" :style =" `background:${onionConfig.style.chart.backgroundColor};color:${onionConfig.style.chart.color}`" >
213213 <div class =" vue-ui-onion-user-option-item" >
214- <input type =" checkbox" :id =" `vue-ui-onion-option-title_${uid}`" :name =" `vue-ui-onion-option-title_${uid}`"
214+ <input data-cy = " onion-checkbox-title " type =" checkbox" :id =" `vue-ui-onion-option-title_${uid}`" :name =" `vue-ui-onion-option-title_${uid}`"
215215 v-model =" mutableConfig.inside" >
216216 <label :for =" `vue-ui-onion-option-title_${uid}`" >{{ onionConfig.userOptions.labels.useDiv }}</label >
217217 </div >
218218 <div class =" vue-ui-onion-user-option-item" >
219- <input type =" checkbox" :id =" `vue-ui-onion-option-table_${uid}`" :name =" `vue-ui-onion-option-table_${uid}`"
219+ <input data-cy = " onion-checkbox-table " type =" checkbox" :id =" `vue-ui-onion-option-table_${uid}`" :name =" `vue-ui-onion-option-table_${uid}`"
220220 v-model =" mutableConfig.showTable" >
221221 <label :for =" `vue-ui-onion-option-table_${uid}`" >{{ onionConfig.userOptions.labels.showTable }}</label >
222222 </div >
223- <button class =" vue-ui-onion-button" @click =" generatePdf" :disabled =" isPrinting" style =" margin-top :12px " :style =" `background:${onionConfig.style.chart.backgroundColor};color:${onionConfig.style.chart.color}`" >
223+ <button data-cy = " onion-pdf " class =" vue-ui-onion-button" @click =" generatePdf" :disabled =" isPrinting" style =" margin-top :12px " :style =" `background:${onionConfig.style.chart.backgroundColor};color:${onionConfig.style.chart.color}`" >
224224 <svg class =" vue-ui-onion-print-icon" xmlns =" http://www.w3.org/2000/svg" v-if =" isPrinting" width =" 20" height =" 20" viewBox =" 0 0 24 24" stroke-width =" 1.5" :stroke =" onionConfig.style.chart.color" fill =" none" stroke-linecap =" round" stroke-linejoin =" round" >
225225 <path stroke =" none" d =" M0 0h24v24H0z" fill =" none" />
226226 <path d =" M18 16v.01" />
@@ -231,7 +231,7 @@ defineExpose({
231231 </svg >
232232 <span v-else >PDF</span >
233233 </button >
234- <button class =" vue-ui-onion-button" @click =" generateXls" :style =" `background:${onionConfig.style.chart.backgroundColor};color:${onionConfig.style.chart.color}`" >
234+ <button data-cy = " onion-xls " class =" vue-ui-onion-button" @click =" generateXls" :style =" `background:${onionConfig.style.chart.backgroundColor};color:${onionConfig.style.chart.color}`" >
235235 XLSX
236236 </button >
237237 </div >
@@ -251,6 +251,7 @@ defineExpose({
251251 <!-- TITLE AS G -->
252252 <g v-if =" onionConfig.style.chart.title.text && mutableConfig.inside && !isPrinting" >
253253 <text
254+ data-cy =" onion-text-title"
254255 :font-size =" onionConfig.style.chart.title.fontSize"
255256 :fill =" onionConfig.style.chart.title.color"
256257 :x =" svg.width / 2"
@@ -261,6 +262,7 @@ defineExpose({
261262 {{ onionConfig.style.chart.title.text }}
262263 </text >
263264 <text
265+ data-cy =" onion-text-subtitle"
264266 v-if =" onionConfig.style.chart.title.subtitle.text"
265267 :font-size =" onionConfig.style.chart.title.subtitle.fontSize"
266268 :fill =" onionConfig.style.chart.title.subtitle.color"
@@ -276,6 +278,7 @@ defineExpose({
276278 <!-- GUTTERS -->
277279 <circle
278280 v-for =" onion in mutableDataset"
281+ :data-cy =" `onion-track-${i}`"
279282 :cx =" drawableArea.centerX"
280283 :cy =" drawableArea.centerY"
281284 :r =" onion.radius"
@@ -345,7 +348,7 @@ defineExpose({
345348 style =" overflow :visible "
346349 >
347350 <div class =" vue-ui-onion-legend" :style =" `color:${onionConfig.style.chart.legend.color};font-size:${onionConfig.style.chart.legend.fontSize}px;padding-bottom:12px;font-weight:${onionConfig.style.chart.legend.bold ? 'bold' : ''}`" @click =" closeDetails" >
348- <div v-for =" (legendItem, i) in immutableDataset" class =" vue-ui-onion-legend-item" @click =" segregate(legendItem.id)" :style =" `opacity:${segregated.includes(legendItem.id) ? 0.5 : 1}`" >
351+ <div v-for =" (legendItem, i) in immutableDataset" :data-cy = " `onion-foreignObject-legend-item-${i}` " class =" vue-ui-onion-legend-item" @click =" segregate(legendItem.id)" :style =" `opacity:${segregated.includes(legendItem.id) ? 0.5 : 1}`" >
349352 <svg viewBox =" 0 0 12 12" height =" 14" width =" 14" ><circle cx =" 6" cy =" 6" r =" 6" stroke =" none" :fill =" legendItem.color" /></svg >
350353 <span >{{ legendItem.name }} : </span >
351354 <span >{{ legendItem.percentage.toFixed(onionConfig.style.chart.legend.roundingPercentage) }}% </span >
@@ -357,7 +360,7 @@ defineExpose({
357360
358361 <!-- LEGEND AS DIV -->
359362 <div v-if =" onionConfig.style.chart.legend.show && (!mutableConfig.inside || isPrinting)" class =" vue-ui-onion-legend" :style =" `background:${onionConfig.style.chart.legend.backgroundColor};color:${onionConfig.style.chart.legend.color};font-size:${onionConfig.style.chart.legend.fontSize}px;padding-bottom:12px;font-weight:${onionConfig.style.chart.legend.bold ? 'bold' : ''}`" @click =" closeDetails" >
360- <div v-for =" (legendItem, i) in immutableDataset" class =" vue-ui-onion-legend-item" @click =" segregate(legendItem.id)" :style =" `opacity:${segregated.includes(legendItem.id) ? 0.5 : 1}`" >
363+ <div v-for =" (legendItem, i) in immutableDataset" :data-cy = " `onion-div-legend-item-${i}` " class =" vue-ui-onion-legend-item" @click =" segregate(legendItem.id)" :style =" `opacity:${segregated.includes(legendItem.id) ? 0.5 : 1}`" >
361364 <svg viewBox =" 0 0 12 12" height =" 14" width =" 14" ><circle cx =" 6" cy =" 6" r =" 6" stroke =" none" :fill =" legendItem.color" /></svg >
362365 <span >{{ legendItem.name }} : </span >
363366 <span >{{ legendItem.percentage.toFixed(onionConfig.style.chart.legend.roundingPercentage) }}% </span >
@@ -368,23 +371,23 @@ defineExpose({
368371 <!-- DATA TABLE -->
369372 <div @click =" closeDetails" class =" vue-ui-onion-table" :style =" `width:100%;margin-top:${mutableConfig.inside ? '48px' : ''}`" v-if =" mutableConfig.showTable" >
370373 <table >
371- <thead >
374+ <thead >
372375 <tr v-if =" onionConfig.style.chart.title.text" >
373- <th colspan =" 3" :style =" `background:${onionConfig.table.th.backgroundColor};color:${onionConfig.table.th.color};outline:${onionConfig.table.th.outline}`" >
376+ <th data-cy = " onion-table-title " colspan =" 3" :style =" `background:${onionConfig.table.th.backgroundColor};color:${onionConfig.table.th.color};outline:${onionConfig.table.th.outline}`" >
374377 <span >{{ onionConfig.style.chart.title.text }}</span >
375378 <span v-if =" onionConfig.style.chart.title.subtitle.text" >
376379 : {{ onionConfig.style.chart.title.subtitle.text }}
377380 </span >
378381 </th >
379382 </tr >
380383 <tr >
381- <th v-for =" th in table.head" :colspan =" th.color ? 2 : 1" :style =" `background:${onionConfig.table.th.backgroundColor};color:${onionConfig.table.th.color};outline:${onionConfig.table.th.outline}`" >
384+ <th v-for =" (th, i) in table.head" :data-cy = " `onion-table-head-col-title-${i}` " :colspan =" th.color ? 2 : 1" :style =" `background:${onionConfig.table.th.backgroundColor};color:${onionConfig.table.th.color};outline:${onionConfig.table.th.outline}`" >
382385 {{ th }}
383386 </th >
384387 </tr >
385388 </thead >
386389 <tbody >
387- <tr v-for =" onion in mutableDataset" >
390+ <tr v-for =" ( onion, i) in mutableDataset" :data-cy = " `onion-table-tr-${i}` " >
388391 <td :style =" `background:${onionConfig.table.td.backgroundColor};color:${onionConfig.table.td.color};outline:${onionConfig.table.td.outline}`" >
389392 <span :style =" `color:${onion.color}`" >
390393 ⬤
0 commit comments