3
0

Add cypress ids for integration gateway

This commit is contained in:
Katrin Yordanova 2022-11-25 16:58:38 +02:00
parent e5631d0f9f
commit d4c6bae09a
10 changed files with 40 additions and 1 deletions

View File

@ -20,6 +20,7 @@
/> />
<b-form-checkbox <b-form-checkbox
v-model="filter.enabled" v-model="filter.enabled"
data-test-id="checkbox-filter-enable"
@change="onUpdate" @change="onUpdate"
> >
{{ $t('filters.enabled') }} {{ $t('filters.enabled') }}

View File

@ -1,5 +1,6 @@
<template> <template>
<b-dropdown <b-dropdown
data-test-id="dropdown-add-filter"
:text="$t('filters.addFilter')" :text="$t('filters.addFilter')"
class="min-content" class="min-content"
variant="primary" variant="primary"
@ -8,6 +9,7 @@
<b-dropdown-item <b-dropdown-item
v-for="(filter, index) in filterList" v-for="(filter, index) in filterList"
:key="index" :key="index"
:data-test-id="filterDropdownCypressId(filter.label)"
:disabled="filter.disabled" :disabled="filter.disabled"
href="#" href="#"
@click="onAddFilter(filter)" @click="onAddFilter(filter)"
@ -20,7 +22,10 @@
disabled disabled
href="#" href="#"
> >
<span class="text-danger"> <span
data-test-id="filter-list-empty"
class="text-danger"
>
{{ $t('filters.filterListEmpty') }} {{ $t('filters.filterListEmpty') }}
</span> </span>
</b-dropdown-item> </b-dropdown-item>
@ -59,6 +64,10 @@ export default {
this.$emit('addFilter', add) this.$emit('addFilter', add)
}, },
filterDropdownCypressId (filter) {
return filter.toLowerCase().split(' ').join('-')
},
}, },
} }
</script> </script>

View File

@ -1,5 +1,6 @@
<template> <template>
<b-card <b-card
data-test-id="card-filter-list"
class="apigw shadow-sm mt-3" class="apigw shadow-sm mt-3"
header-bg-variant="white" header-bg-variant="white"
footer-bg-variant="white" footer-bg-variant="white"
@ -15,6 +16,7 @@
@submit.prevent="$emit('submit', route)" @submit.prevent="$emit('submit', route)"
> >
<b-tabs <b-tabs
data-test-id="filter-steps"
active-nav-item-class="active-tab bg-white" active-nav-item-class="active-tab bg-white"
class="border-0 font-weight-bold" class="border-0 font-weight-bold"
content-class="border-bottom" content-class="border-bottom"

View File

@ -44,6 +44,7 @@
</b-table-simple> </b-table-simple>
<h6 <h6
v-if="!sortableFilters.length" v-if="!sortableFilters.length"
data-test-id="no-filters"
class="d-flex justify-content-center align-items-center mb-3" class="d-flex justify-content-center align-items-center mb-3"
> >
{{ $t('filters.list.noFilters') }} {{ $t('filters.list.noFilters') }}

View File

@ -1,6 +1,7 @@
<template> <template>
<b-card <b-card
class="shadow-sm" class="shadow-sm"
data-test-id="card-route-edit"
header-bg-variant="white" header-bg-variant="white"
footer-bg-variant="white" footer-bg-variant="white"
> >
@ -14,6 +15,7 @@
> >
<b-form-input <b-form-input
v-model="route.routeID" v-model="route.routeID"
data-test-id="input-route-id"
plaintext plaintext
disabled disabled
/> />
@ -48,6 +50,7 @@
<b-form-input <b-form-input
id="endpoint" id="endpoint"
v-model="route.endpoint" v-model="route.endpoint"
data-test-id="input-endpoint"
:state="isValidEndpoint" :state="isValidEndpoint"
required required
/> />
@ -59,6 +62,7 @@
> >
<b-form-select <b-form-select
v-model="route.method" v-model="route.method"
data-test-id="select-method"
:options="methods" :options="methods"
required required
/> />
@ -70,6 +74,7 @@
> >
<b-form-checkbox <b-form-checkbox
v-model="route.enabled" v-model="route.enabled"
data-test-id="checkbox-enabled"
> >
{{ $t('enabled') }} {{ $t('enabled') }}
</b-form-checkbox> </b-form-checkbox>
@ -82,6 +87,7 @@
> >
<b-form-input <b-form-input
:value="route.updatedAt | locFullDateTime" :value="route.updatedAt | locFullDateTime"
data-test-id="input-updated-at"
plaintext plaintext
disabled disabled
/> />
@ -94,6 +100,7 @@
> >
<b-form-input <b-form-input
:value="route.deletedAt | locFullDateTime" :value="route.deletedAt | locFullDateTime"
data-test-id="input-delete-at"
plaintext plaintext
disabled disabled
/> />
@ -101,6 +108,7 @@
<b-form-group <b-form-group
v-if="route.createdAt" v-if="route.createdAt"
data-test-id="input-create-at"
:label="$t('createdAt')" :label="$t('createdAt')"
label-cols="2" label-cols="2"
class="mb-0" class="mb-0"
@ -130,6 +138,7 @@
<confirmation-toggle <confirmation-toggle
v-if="route && route.routeID && route.canDeleteApigwRoute" v-if="route && route.routeID && route.canDeleteApigwRoute"
:data-test-id="deletedButtonStatusCypressId"
@confirmed="$emit('delete')" @confirmed="$emit('delete')"
> >
{{ getDeleteStatus }} {{ getDeleteStatus }}
@ -223,6 +232,10 @@ export default {
} }
return '' return ''
}, },
deletedButtonStatusCypressId () {
return `button-${this.getDeleteStatus.toLowerCase()}`
},
}, },
} }
</script> </script>

View File

@ -1,6 +1,7 @@
<template> <template>
<div> <div>
<b-card <b-card
data-test-id="card-general-info"
class="shadow-sm" class="shadow-sm"
header-bg-variant="white" header-bg-variant="white"
footer-bg-variant="white" footer-bg-variant="white"
@ -28,6 +29,7 @@
> >
<b-form-input <b-form-input
v-model="request.route" v-model="request.route"
data-test-id="input-route"
plaintext plaintext
disabled disabled
/> />

View File

@ -1,5 +1,6 @@
<template> <template>
<b-card <b-card
data-test-id="card-requests"
no-body no-body
class="shadow-sm mb-3" class="shadow-sm mb-3"
footer-class="d-flex align-items-center justify-content-center" footer-class="d-flex align-items-center justify-content-center"
@ -20,6 +21,7 @@
{{ autoRefreshLabel }} {{ autoRefreshLabel }}
</span> </span>
<b-button <b-button
data-test-id="button-refresh"
variant="primary" variant="primary"
:disabled="loading" :disabled="loading"
class="ml-2" class="ml-2"
@ -63,6 +65,7 @@
</template> </template>
<template #cell(actions)="row"> <template #cell(actions)="row">
<b-button <b-button
data-test-id="button-edit-route"
size="sm" size="sm"
variant="link" variant="link"
class="p-0" class="p-0"

View File

@ -4,6 +4,7 @@
<span class="text-nowrap"> <span class="text-nowrap">
<b-button <b-button
v-if="routeID && canCreate" v-if="routeID && canCreate"
data-test-id="button-add"
variant="primary" variant="primary"
:to="{ name: 'system.apigw.new' }" :to="{ name: 'system.apigw.new' }"
> >

View File

@ -10,6 +10,7 @@
> >
<b-button <b-button
v-if="canCreate" v-if="canCreate"
data-test-id="button-add"
variant="primary" variant="primary"
:to="{ name: 'system.apigw.new' }" :to="{ name: 'system.apigw.new' }"
> >
@ -17,6 +18,7 @@
</b-button> </b-button>
<b-button <b-button
v-if="$Settings.get('apigw.profilerEnabled', false)" v-if="$Settings.get('apigw.profilerEnabled', false)"
data-test-id="button-profiler"
class="ml-2" class="ml-2"
variant="info" variant="info"
:to="{ name: 'system.apigw.profiler' }" :to="{ name: 'system.apigw.profiler' }"
@ -25,6 +27,7 @@
</b-button> </b-button>
<c-permissions-button <c-permissions-button
v-if="canGrant" v-if="canGrant"
data-test-id="button-permissions"
resource="corteza::system:apigw-route/*" resource="corteza::system:apigw-route/*"
button-variant="light" button-variant="light"
class="ml-2" class="ml-2"
@ -68,6 +71,7 @@
<template #header> <template #header>
<c-resource-list-status-filter <c-resource-list-status-filter
v-model="filter.deleted" v-model="filter.deleted"
data-test-id="filter-deleted-routes"
:label="$t('filterForm.deleted.label')" :label="$t('filterForm.deleted.label')"
:excluded-label="$t('filterForm.excluded.label')" :excluded-label="$t('filterForm.excluded.label')"
:inclusive-label="$t('filterForm.inclusive.label')" :inclusive-label="$t('filterForm.inclusive.label')"

View File

@ -1,5 +1,6 @@
<template> <template>
<b-container <b-container
data-tets-id="profiler"
class="py-3" class="py-3"
> >
<c-content-header <c-content-header
@ -8,6 +9,7 @@
<b-card <b-card
no-body no-body
data-test-id="card-profiler"
class="shadow-sm" class="shadow-sm"
footer-class="d-flex align-items-center justify-content-center" footer-class="d-flex align-items-center justify-content-center"
footer-bg-variant="white" footer-bg-variant="white"
@ -30,6 +32,7 @@
</span> </span>
<b-button <b-button
variant="primary" variant="primary"
data-test-id="button-refresh"
:disabled="loading" :disabled="loading"
class="ml-2" class="ml-2"
@click="loadItems()" @click="loadItems()"