My first e2e test and modifications to client to support it

This commit is contained in:
2020-03-31 20:05:27 +00:00
parent 8feb4375f9
commit 2211bf550f
7 changed files with 136 additions and 24 deletions

View File

@@ -19,13 +19,13 @@
:prepend-icon="item.icon"
:value="false"
:key="item.key"
:data-cy="item.testid"
>
<template v-slot:activator>
<!--group activator -->
<v-list-item-title>{{ item.title }}</v-list-item-title>
</template>
<!-- TOP LEVEL HOLDER SUBITEMS -->
<template v-for="subitem in item.navItems">
<template v-if="!subitem.route">
<!-- SECOND LEVEL HOLDER -->
@@ -64,7 +64,10 @@
<template v-else>
<!-- SECOND LEVEL ACTION -->
<div class="pl-3" :key="subitem.key">
<v-list-item :to="subitem.route">
<v-list-item
:to="subitem.route"
:data-cy="'nav' + subitem.route"
>
<v-list-item-action>
<v-icon v-if="subitem.icon">{{ subitem.icon }}</v-icon>
</v-list-item-action>
@@ -107,7 +110,10 @@
fixed
app
>
<v-app-bar-nav-icon @click.stop="drawer = !drawer"></v-app-bar-nav-icon>
<v-app-bar-nav-icon
@click.stop="drawer = !drawer"
data-cy="navicon"
></v-app-bar-nav-icon>
<v-toolbar-title style="width: 300px" class="ml-0 pl-4">
<v-icon>{{ appBar.icon }}</v-icon
>&nbsp;
@@ -132,7 +138,7 @@
<v-spacer></v-spacer>
<v-menu bottom float-left>
<template v-slot:activator="{ on }">
<v-btn text icon v-on="on">
<v-btn text icon v-on="on" data-cy="contextmenu">
<v-icon>fa-ellipsis-v</v-icon>
</v-btn>
</template>
@@ -152,6 +158,7 @@
:disabled="item.disabled"
@click="clickMenuItem(item)"
v-bind:class="{ 'hidden-sm-and-up': item.surface }"
:data-cy="item.key"
>
<v-list-item-action>
<v-icon

View File

@@ -1,12 +1,16 @@
/* Xeslint-disable */
function addNavItem(title, icon, route, navItems, key) {
function addNavItem(title, icon, route, navItems, key, testid) {
if (!testid) {
testid = route;
}
window.$gz.store.commit("addNavItem", {
title,
icon,
route,
navItems,
key: key
key: key,
testid: testid
});
}
@@ -157,7 +161,8 @@ export default function initialize() {
"fa-home",
undefined,
sub,
key++
key++,
"home"
);
}
@@ -200,7 +205,8 @@ export default function initialize() {
"fa-address-book",
undefined,
sub,
key++
key++,
"customer"
);
}
@@ -387,7 +393,8 @@ export default function initialize() {
"fa-toolbox",
undefined,
sub,
key++
key++,
"service"
);
}
@@ -467,7 +474,8 @@ export default function initialize() {
"fa-box",
undefined,
sub,
key++
key++,
"inventory"
);
}
@@ -488,7 +496,8 @@ export default function initialize() {
"fa-store",
"/vendors",
[],
key++
key++,
"vendor"
);
}
@@ -516,7 +525,8 @@ export default function initialize() {
"fa-calculator",
undefined,
sub,
key++
key++,
"accounting"
);
}
@@ -602,7 +612,8 @@ export default function initialize() {
"fa-user-tie",
undefined,
sub,
key++
key++,
"administration"
);
}
@@ -668,7 +679,8 @@ export default function initialize() {
"fa-server",
undefined,
sub,
key++
key++,
"operations"
);
}
@@ -688,7 +700,8 @@ export default function initialize() {
"fa-vial",
"/widgets",
[],
key++
key++,
"widgets"
);
}
@@ -730,7 +743,8 @@ export default function initialize() {
"fa-home",
undefined,
sub,
key++
key++,
"homecustomer"
);
}
})