This commit is contained in:
2020-04-04 00:17:00 +00:00
parent 02ada3a759
commit fa49eefc53
3 changed files with 35 additions and 1 deletions

View File

@@ -49,6 +49,11 @@ CURRENT TODOs
@@@@@@@@@@@ ROADMAP STAGE 2:
todo: change all testing data-cy attributes to conditional see ay-customize for example
- :data-cy="!!enableCypress ? item.key : false"
- Really need at this point a way to not have to add a fucking data property to *every* fucking form but rather a central location available to all vue from main or window
- dig into that and see if it's possible again and how to do it because then all forms could be simplified a great deal.
todo: add tests for the following:

View File

@@ -19,7 +19,7 @@
<template v-for="item in obj">
<v-col :key="item.key" cols="12" sm="6" lg="4" xl="3" px-2>
<v-card>
<v-card :data-cy="!!enableCypress ? item.key : false">
<v-card-title>
{{ item.title }}
</v-card-title>
@@ -112,6 +112,7 @@ export default {
},
data() {
return {
enableCypress: true,
obj: [],
concurrencyToken: undefined,
formCustomTemplateKey: this.$route.params.formCustomTemplateKey,
@@ -330,6 +331,9 @@ function initForm(vm) {
// Ensures UI translated text is available
//
function fetchTranslatedText(vm) {
//NOTE: This form expects to arrive here from the form being customized
//so it does *not* attempt to fetch the translations for the field names of the form in question
//since they should already be set by that form.
let tKeysRequired = [
"FormFieldEntryRequired",
"FormFieldVisible",

View File

@@ -0,0 +1,25 @@
// https://docs.cypress.io/api/introduction/api.html
describe("CUSTOMIZE", () => {
it("Loads from edit form", () => {
cy.visit("/login");
cy.get("input[name=username]")
.clear()
.type(Cypress.env("adminusername"));
// {enter} causes the form to submit
cy.get("input[name=password]")
.clear()
.type(`${Cypress.env("adminpassword")}{enter}`);
cy.url().should("include", "/home-dashboard");
cy.visit("/widgets/0");
cy.url().should("include", "/widgets/0");
cy.wait(100);
cy.get("[data-cy=contextmenu]").click();
cy.get('[data-cy="app:customize"]').click();
cy.url().should("include", "/customize/Widget");
cy.get("[data-cy=WidgetCustom8]").scrollIntoView();
});
});