This commit is contained in:
2020-04-04 22:18:48 +00:00
parent 05a7cdf84f
commit 5124aed04b
2 changed files with 37 additions and 1 deletions

View File

@@ -34,6 +34,7 @@
:ref="item.key"
:disabled="item.stockRequired"
@change="visibleChanged(item)"
:data-cy="!!$ay.dev ? item.key + 'Visible' : false"
></v-checkbox>
<v-checkbox
v-model="item.required"
@@ -51,6 +52,7 @@
item-value="id"
:label="$ay.t('UiFieldDataType')"
@input="dataTypeChanged(item)"
:data-cy="!!$ay.dev ? item.key + 'SelectType' : false"
></v-select>
<!-- <v-divider></v-divider>
<div>{{ item }}</div> -->

View File

@@ -1,7 +1,7 @@
// https://docs.cypress.io/api/introduction/api.html
describe("CUSTOMIZE", () => {
it("Loads from edit form", () => {
it("Edits and works", () => {
cy.visit("/login");
cy.get("input[name=username]")
@@ -16,10 +16,44 @@ describe("CUSTOMIZE", () => {
cy.visit("/widgets/0");
cy.url().should("include", "/widgets/0");
//check serial field is present, then hide it and check it's gone then re-show it again
cy.get("[data-cy=serial]").should("exist");
cy.get("[data-cy=WidgetCustom8]").should("not.exist");
cy.wait(100);
cy.get("[data-cy=contextmenu]").click();
cy.get('[data-cy="app:customize"]').click();
cy.url().should("include", "/customize/Widget");
//hide serial
cy.get("[data-cy=SerialVisible]").uncheck({ force: true });
//show widget 8 and set it to a type
cy.get("[data-cy=WidgetCustom8]").scrollIntoView();
cy.get("[data-cy=WidgetCustom8Visible]").check({ force: true });
cy.get("[data-cy=WidgetCustom8SelectType]").type("tr{enter}", {
force: true
});
cy.get('[data-cy="customize:save"] > .v-btn__content > .v-icon').click();
cy.go("back");
//check customize worked
cy.get("[data-cy=serial]").should("not.exist");
cy.get("[data-cy=WidgetCustom8]").should("exist");
//reverse
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=SerialVisible]").check({ force: true });
cy.get("[data-cy=WidgetCustom8Visible]").uncheck({ force: true });
cy.get("[data-cy=WidgetCustom8SelectType]").type("te{enter}", {
force: true
});
cy.get('[data-cy="customize:save"] > .v-btn__content > .v-icon').click();
cy.go("back");
cy.get("[data-cy=serial]").should("exist");
cy.get("[data-cy=WidgetCustom8]").should("not.exist");
//-----
});
});