Skip to content

Commit 65b77a8

Browse files
committed
Added remote config full data test cases
1 parent 7563847 commit 65b77a8

File tree

7 files changed

+301
-94
lines changed

7 files changed

+301
-94
lines changed

plugins/remote-config/frontend/public/javascripts/countly.views.js

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,25 +53,25 @@
5353
template: ' <table class="cly-vue-remote-config-percentages-breakdown">\
5454
<thead>\
5555
<tr>\
56-
<th class="cly-vue-remote-config-percentages-breakdown__sequence__heading bu-pl-2">\
56+
<th class="cly-vue-remote-config-percentages-breakdown__sequence__heading bu-pl-2" :data-test-id="testId + \'-hash-label\'">\
5757
#\
5858
</th>\
59-
<th class="cly-vue-remote-config-percentages-breakdown__condition__heading">\
59+
<th class="cly-vue-remote-config-percentages-breakdown__condition__heading" :data-test-id="testId + \'-condition-label\'">\
6060
{{i18n("remote-config.condition")}}\
6161
</th>\
62-
<th class="cly-vue-remote-config-percentages-breakdown__percentage__heading">\
62+
<th class="cly-vue-remote-config-percentages-breakdown__percentage__heading" :data-test-id="testId + \'-percentage-label\'">\
6363
{{i18n("remote-config.percentage")}}\
6464
</th>\
6565
</tr>\
6666
</thead>\
6767
<tbody>\
68-
<tr><td class="cly-vue-remote-config-percentages-breakdown__sequence__heading"><div class="cly-vue-remote-config-percentages-breakdown__sequence bu-py-1 bu-px-2">1</div></td><td class="has-ellipsis cly-vue-remote-config-percentages-breakdown__condition__heading bu-pr-1"><div class="has-ellipsis cly-vue-remote-config-percentages-breakdown__data bu-py-2 bu-px-1 cly-vue-remote-config-percentages-breakdown__default-value"><span class="bu-ml-2 bu-mr-3 text-medium">{{i18n("remote-config.default-value")}}</span><span class="cly-vue-remote-config-percentages-breakdown__default-value__value bu-py-1 bu-px-2 text-small" v-tooltip="defaultValue.value">{{defaultValue.value}}</span></div></td><td class="cly-vue-remote-config-percentages-breakdown__percentage__heading"><div class="bu-is-flex"><div class="text-big font-weight-bold">{{defaultValue.percentage}}% </div> <div class="font-weight-normal color-cool-gray-100 bu-pt-1 bu-pl-1">{{i18n("remote-config.percent.of.total")}}</div></div></td></tr>\
68+
<tr><td class="cly-vue-remote-config-percentages-breakdown__sequence__heading"><div class="cly-vue-remote-config-percentages-breakdown__sequence bu-py-1 bu-px-2" :data-test-id="testId + \'-order-label\'">1</div></td><td class="has-ellipsis cly-vue-remote-config-percentages-breakdown__condition__heading bu-pr-1"><div class="has-ellipsis cly-vue-remote-config-percentages-breakdown__data bu-py-2 bu-px-1 cly-vue-remote-config-percentages-breakdown__default-value"><span class="bu-ml-2 bu-mr-3 text-medium" :data-test-id="testId + \'-default-value-label\'">{{i18n("remote-config.default-value")}}</span><span class="cly-vue-remote-config-percentages-breakdown__default-value__value bu-py-1 bu-px-2 text-small" v-tooltip="defaultValue.value" :data-test-id="testId + \'-default-value\'">{{defaultValue.value}}</span></div></td><td class="cly-vue-remote-config-percentages-breakdown__percentage__heading"><div class="bu-is-flex"><div class="text-big font-weight-bold" :data-test-id="testId + \'-percentage\'">{{defaultValue.percentage}}% </div> <div class="font-weight-normal color-cool-gray-100 bu-pt-1 bu-pl-1" :data-test-id="testId + \'-percent-of-total\'">{{i18n("remote-config.percent.of.total")}}</div></div></td></tr>\
6969
<tr v-if="isDrillEnabled" v-for="(condition, i) in conditions" :key="i">\
70-
<td class="cly-vue-remote-config-percentages-breakdown__sequence__heading"><div class="cly-vue-remote-config-percentages-breakdown__sequence bu-py-1 bu-px-2">{{i+2}}</div>\
70+
<td class="cly-vue-remote-config-percentages-breakdown__sequence__heading"><div class="cly-vue-remote-config-percentages-breakdown__sequence bu-py-1 bu-px-2" :data-test-id="testId + \'other-order-label\'">{{i+2}}</div>\
7171
</td>\
72-
<td class="has-ellipsis cly-vue-remote-config-percentages-breakdown__condition__heading bu-pr-1"><div class="has-ellipsis cly-vue-remote-config-percentages-breakdown__data bu-py-2 bu-px-1 cly-vue-remote-config-percentages-breakdown__condition" :style="{backgroundColor: condition.color}"><span class="cly-vue-remote-config-percentages-breakdown__condition__vertical-align"><img src="/remote-config/images/call_split.svg"/></span><span class="cly-vue-remote-config-percentages-breakdown__condition__vertical-align bu-ml-2 bu-mr-3 text-medium">{{condition.name}}</span><span class="cly-vue-remote-config-percentages-breakdown__condition__vertical-align cly-vue-remote-config-percentages-breakdown__condition__value bu-py-1 bu-px-2 text-small" v-tooltip="condition.value">{{condition.value}}</span></div></td>\
72+
<td class="has-ellipsis cly-vue-remote-config-percentages-breakdown__condition__heading bu-pr-1"><div class="has-ellipsis cly-vue-remote-config-percentages-breakdown__data bu-py-2 bu-px-1 cly-vue-remote-config-percentages-breakdown__condition" :style="{backgroundColor: condition.color}"><span class="cly-vue-remote-config-percentages-breakdown__condition__vertical-align"><img src="/remote-config/images/call_split.svg"/></span><span class="cly-vue-remote-config-percentages-breakdown__condition__vertical-align bu-ml-2 bu-mr-3 text-medium" :data-test-id="testId + \'condition-name-label\'">{{condition.name}}</span><span class="cly-vue-remote-config-percentages-breakdown__condition__vertical-align cly-vue-remote-config-percentages-breakdown__condition__value bu-py-1 bu-px-2 text-small" v-tooltip="condition.value" :data-test-id="testId + \'condition-value\'">{{condition.value}}</span></div></td>\
7373
<td class="cly-vue-remote-config-percentages-breakdown__percentage__heading">\
74-
<div class="bu-is-flex"><div class="text-big font-weight-bold">{{condition.percentage}}% </div> <div class="font-weight-normal color-cool-gray-100 bu-pt-1 bu-pl-1">{{i18n("remote-config.percent.of.total")}}</div></div>\
74+
<div class="bu-is-flex"><div class="text-big font-weight-bold" :data-test-id="testId + \'percentage-label\'">{{condition.percentage}}% </div> <div class="font-weight-normal color-cool-gray-100 bu-pt-1 bu-pl-1" :data-test-id="testId + \'percent-of-label\'">{{i18n("remote-config.percent.of.total")}}</div></div>\
7575
</td>\
7676
</tr>\
7777
</tbody>\
@@ -82,7 +82,12 @@
8282
default: function() {
8383
return {};
8484
}
85-
}
85+
},
86+
testId: {
87+
type: String,
88+
default: 'condition-stats-default-test-id',
89+
required: false
90+
},
8691
},
8792
computed: {
8893
isDrillEnabled: function() {
@@ -1028,4 +1033,4 @@
10281033
this.renderWhenReady(mainView);
10291034
});
10301035
app.addMenu("improve", {code: "remote-config", permission: FEATURE_NAME, pluginName: "remote-config", url: "#/remote-config", text: "sidebar.remote-config", icon: '<div class="logo"><i class="material-icons" style="transform:rotate(90deg)"> call_split </i></div>', priority: 30});
1031-
})();
1036+
})();
Lines changed: 52 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<div>
2-
<cly-header
3-
:title="i18n('remote-config.title')"
4-
>
2+
<cly-header :title="i18n('remote-config.title')">
53
<template v-slot:header-right>
64
<div class="bu-level-item" v-if="hasCreateRight">
7-
<el-button :disabled="isParamterLimitExceeded" @click="create" type="success" size="small" icon="el-icon-circle-plus" data-test-id="add-parameter-button">{{i18n('remote-config.add-parameter-title')}}</el-button>
5+
<el-button :disabled="isParamterLimitExceeded" @click="create" type="success" size="small"
6+
icon="el-icon-circle-plus"
7+
data-test-id="add-parameter-button">{{i18n('remote-config.add-parameter-title')}}</el-button>
88
</div>
99
</template>
1010
</cly-header>
@@ -13,78 +13,102 @@
1313
<cly-notification class="bu-mb-5" :text="i18n('remote-config.maximum_parameters_added')" color="light-warning">
1414
</cly-notification>
1515
</div>
16-
<cly-datatable-n :rows="tableRows" :exportFormat="formatExportFunction" :force-loading="isTableLoading" class="cly-vue-remote-config-home-table" ref="table" @row-click="handleTableRowClick" :row-class-name="tableRowClassName">
16+
<cly-datatable-n test-id="remote-config" :rows="tableRows" :exportFormat="formatExportFunction"
17+
:force-loading="isTableLoading" class="cly-vue-remote-config-home-table" ref="table"
18+
@row-click="handleTableRowClick" :row-class-name="tableRowClassName">
1719
<template v-slot:default="scope">
18-
<el-table-column type="expand" min-width="50">
20+
<el-table-column :test-id="'remote-config-expand-' + scope.$index"
21+
type="expand" min-width="50">
1922
<template v-slot="props">
2023
<cly-section>
21-
<condition-stats :parameter="props.row"></condition-stats>
24+
<condition-stats :test-id="'datatable-remote-config-' + scope.$index" :parameter="props.row"></condition-stats>
2225
</cly-section>
2326
</template>
2427
</el-table-column>
25-
<el-table-column min-width="160" prop="parameter_key" :label="i18n('remote-config.parameter')" sortable="custom">
28+
<el-table-column min-width="160" prop="parameter_key" :label="i18n('remote-config.parameter')"
29+
sortable="custom">
2630
<template v-slot:default="rowScope">
2731
<div>
28-
<div class="cly-vue-remote-config-conditions-drawer__margin-bottom"> {{rowScope.row.parameter_key}}</div>
29-
<div v-if="isDrillEnabled" class="color-cool-gray-40 text-small"><span> {{getNumberOfConditionsText(rowScope.row.conditions)}} </span></div>
32+
<div class="cly-vue-remote-config-conditions-drawer__margin-bottom"
33+
:data-test-id="'datatable-remote-config-parameter-' + rowScope.$index"> {{rowScope.row.parameter_key}}
34+
</div>
35+
<div v-if="isDrillEnabled" class="color-cool-gray-40 text-small"><span>
36+
{{getNumberOfConditionsText(rowScope.row.conditions)}} </span></div>
3037
</div>
3138
</template>
3239
</el-table-column>
3340
<el-table-column min-width="160" prop="status" :label="i18n('remote-config.parameter.status')">
3441
<template v-slot:default="rowScope">
3542
<div>
3643
<div class="cly-vue-remote-config-conditions-drawer__margin-bottom">
37-
<cly-status-tag v-if="rowScope.row.status==='Stopped'" :text="i18n('remote-config.parameter.disabled')" color="red"></cly-status-tag>
38-
<cly-status-tag v-else-if="rowScope.row.status==='Expired'" :text="i18n('remote-config.parameter.expired')" color="yellow"></cly-status-tag>
39-
<cly-status-tag v-else :text="i18n('remote-config.parameter.enabled')" color="blue"></cly-status-tag>
44+
<cly-status-tag v-if="rowScope.row.status==='Stopped'" :text="i18n('remote-config.parameter.disabled')"
45+
color="red" :data-test-id="'datatable-remote-config-status-' + rowScope.$index"></cly-status-tag>
46+
<cly-status-tag v-else-if="rowScope.row.status==='Expired'"
47+
:text="i18n('remote-config.parameter.expired')" color="yellow"
48+
:data-test-id="'datatable-remote-config-status-' + rowScope.$index"></cly-status-tag>
49+
<cly-status-tag v-else :text="i18n('remote-config.parameter.enabled')" color="blue"
50+
:data-test-id="'datatable-remote-config-status-' + rowScope.$index"></cly-status-tag>
4051
</div>
41-
<div class="color-cool-gray-40 text-small" v-if="rowScope.row.expiry_dttm"> {{i18n('remote-config.expire.date')}} {{getDate(rowScope.row.expiry_dttm)}}</div>
52+
<div class="color-cool-gray-40 text-small" v-if="rowScope.row.expiry_dttm"
53+
:data-test-id="'datatable-remote-config-expire-date-' + rowScope.$index">
54+
{{i18n('remote-config.expire.date')}} {{getDate(rowScope.row.expiry_dttm)}}</div>
4255
</div>
4356
</template>
4457
</el-table-column>
4558
<el-table-column min-width="160" prop="description" :label="i18n('remote-config.description')">
4659
<template v-slot:default="rowScope">
47-
{{displayDescription(rowScope.row.description)}}
60+
<div :data-test-id="'datatable-remote-config-description-' + rowScope.$index">
61+
{{displayDescription(rowScope.row.description)}}
62+
</div>
4863
</template>
4964
</el-table-column>
5065
<el-table-column min-width="160" prop="ts" :label="i18n('remote-config.parameter.created')" sortable="custom">
5166
<template v-slot:default="rowScope">
5267
<div>
53-
<div class="cly-vue-remote-config-conditions-drawer__margin-bottom"> {{getDate(rowScope.row.ts)}}</div>
54-
<div class="color-cool-gray-40 text-small"> {{getTime(rowScope.row.ts)}}</div>
68+
<div class="cly-vue-remote-config-conditions-drawer__margin-bottom"
69+
:data-test-id="'datatable-remote-config-created-date-' + rowScope.$index"> {{getDate(rowScope.row.ts)}}
70+
</div>
71+
<div class="color-cool-gray-40 text-small"
72+
:data-test-id="'datatable-remote-config-created-time-' + rowScope.$index"> {{getTime(rowScope.row.ts)}}
73+
</div>
5574
</div>
5675
</template>
5776
</el-table-column>
5877
<el-table-column min-width="160" prop="abStatus" :label="i18n('remote-config.parameter.ab.status')">
5978
<template v-slot:default="rowScope">
60-
{{rowScope.row.abStatus || "-"}}
79+
<div :data-test-id="'datatable-remote-config-ab-status-' + rowScope.$index">
80+
{{rowScope.row.abStatus || "-"}}
81+
</div>
6182
</template>
6283
</el-table-column>
6384
<el-table-column min-width="160" v-if="hasUpdateRight || hasDeleteRight" type="options">
6485
<template v-slot="rowScope">
65-
<cly-more-options
66-
v-if="rowScope.row.hover"
67-
size="small"
86+
<cly-more-options :test-id="'datatable-remote-config-' + rowScope.$index" v-if="rowScope.row.hover" size="small"
6887
v-tooltip.left="rowScope.row.editable ? '' : i18n('remote-config.parameter.action-tooltip-content')"
6988
:disabledButton="rowScope.row.editable ? false : true"
7089
@command="handleCommand($event, scope, rowScope.row)">
71-
<el-dropdown-item v-if="hasUpdateRight && rowScope.row.editable" command="edit">{{i18n('common.edit')}}</el-dropdown-item>
72-
<el-dropdown-item v-if="hasDeleteRight && rowScope.row.editable" command="remove">{{i18n('common.delete')}}</el-dropdown-item>
90+
<el-dropdown-item v-if="hasUpdateRight && rowScope.row.editable"
91+
command="edit" :data-test-id="'datatable-remote-config-button-edit-' + rowScope.$index">{{i18n('common.edit')}}</el-dropdown-item>
92+
<el-dropdown-item v-if="hasDeleteRight && rowScope.row.editable"
93+
command="remove" :data-test-id="'datatable-remote-config-button-delete-' + rowScope.$index">{{i18n('common.delete')}}</el-dropdown-item>
7394
</cly-more-options>
7495
</template>
7596
</el-table-column>
7697
<el-table-column v-if="hasUpdateRight" min-width="110">
7798
<template v-slot="rowScope">
7899
<div v-if="rowScope.row.hover && rowScope.row.editable">
79-
<el-button v-if="rowScope.row.status==='Stopped' || rowScope.row.status==='Expired'" @click.stop="startParameter(rowScope.row)" size="small" icon="el-icon-remove">{{i18n('remote-config.enable')}}
80-
</el-button>
81-
<el-button v-else @click.stop="stopParameter(rowScope.row)" size="small" icon="el-icon-remove">{{i18n('remote-config.disable')}}
82-
</el-button>
100+
<el-button v-if="rowScope.row.status==='Stopped' || rowScope.row.status==='Expired'"
101+
@click.stop="startParameter(rowScope.row)" size="small"
102+
icon="el-icon-remove" :data-test-id="'datatable-remote-config-button-enable-' + rowScope.$index">{{i18n('remote-config.enable')}}
103+
</el-button>
104+
<el-button :data-test-id="'datatable-remote-config-button-disable-' + rowScope.$index" v-else @click.stop="stopParameter(rowScope.row)" size="small"
105+
icon="el-icon-remove">{{i18n('remote-config.disable')}}
106+
</el-button>
83107
</div>
84108
</template>
85109
</el-table-column>
86110
</template>
87111
</cly-datatable-n>
88112
</cly-main>
89113
<drawer :controls="drawers.parameters" @submit="onSubmit"></drawer>
90-
</div>
114+
</div>

ui-tests/cypress/e2e/onboarding/onboarding.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ describe('Complete Onboarding', () => {
374374
navigationHelpers.goToCrashesOverviewPage();
375375
crashesPageHelpers.verifyFullDataPageElements();
376376
navigationHelpers.goToRemoteConfigPage();
377-
//remoteConfigPageHelpers.verifyFullDataPageElements();
377+
//remoteConfigPageHelpers.verifyFullDataPageElements(); //TODO: Data is not being generated with the populator. Need to generate the data
378378
//TODO: Add the cases of the following pages
379379
//navigationHelpers.goToReportManagerPage();
380380
//reportManagerPageHelpers.verifyFullDataPageElements();

0 commit comments

Comments
 (0)