based on the provided flag.
* @param {boolean} show - If true, the tooltip
will be shown; otherwise, it will be hidden.
diff --git a/ui.tests/test-module/libs/support/commands.js b/ui.tests/test-module/libs/support/commands.js
index bd542cde03..045a8d9000 100644
--- a/ui.tests/test-module/libs/support/commands.js
+++ b/ui.tests/test-module/libs/support/commands.js
@@ -254,9 +254,13 @@ Cypress.Commands.add("openPage", (pagePath, options = {}) => {
// getting status 403 intermittently, just ignore it
const baseUrl = contextPath;
cy.visit(baseUrl, {'failOnStatusCode': false});
- cy.login(baseUrl, () => {
- cy.openPage(path, options);
- });
+ cy.getCookie('login-token').then(cookie => {
+ if(!cookie) {
+ cy.login(baseUrl, () => {
+ cy.openPage(path, options);
+ });
+ }
+ })
}
cy.visit(path, options);
});
@@ -726,4 +730,4 @@ Cypress.Commands.add("getRuleEditorIframe", () => {
.get('iframe#af-rule-editor')
.its('0.contentDocument.body').should('not.be.empty')
.then(cy.wrap)
-})
+});
\ No newline at end of file
diff --git a/ui.tests/test-module/package-lock.json b/ui.tests/test-module/package-lock.json
index 11fbffd3e0..5c54673beb 100644
--- a/ui.tests/test-module/package-lock.json
+++ b/ui.tests/test-module/package-lock.json
@@ -14913,8 +14913,7 @@
"version": "10.0.0",
"resolved": "https://registry.npmjs.org/babelify/-/babelify-10.0.0.tgz",
"integrity": "sha512-X40FaxyH7t3X+JFAKvb1H9wooWKLRCi8pg3m8poqtdZaIng+bjzp9RvKQCvRjF9isHiPkXspbbXT/zwXLtwgwg==",
- "dev": true,
- "requires": {}
+ "dev": true
},
"backo2": {
"version": "1.0.2",
@@ -15927,8 +15926,7 @@
"version": "5.0.8",
"resolved": "https://registry.npmjs.org/cypress-file-upload/-/cypress-file-upload-5.0.8.tgz",
"integrity": "sha512-+8VzNabRk3zG6x8f8BWArF/xA/W0VK4IZNx3MV0jFWrJS/qKn8eHfa5nU73P9fOQAgwHFJx7zjg4lwOnljMO8g==",
- "dev": true,
- "requires": {}
+ "dev": true
},
"cypress-iframe": {
"version": "1.0.1",
@@ -20788,8 +20786,7 @@
"version": "7.4.6",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz",
"integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==",
- "dev": true,
- "requires": {}
+ "dev": true
},
"xhr": {
"version": "2.6.0",
diff --git a/ui.tests/test-module/specs/aemEmbedContainer/aemEmbedContainer.runtime.spec.js b/ui.tests/test-module/specs/aemEmbedContainer/aemEmbedContainer.runtime.spec.js
index 7890822c0a..0c5a5c9ef7 100644
--- a/ui.tests/test-module/specs/aemEmbedContainer/aemEmbedContainer.runtime.spec.js
+++ b/ui.tests/test-module/specs/aemEmbedContainer/aemEmbedContainer.runtime.spec.js
@@ -41,12 +41,12 @@ describe("Sites with Aem Embed Container", () => {
it("test for aemembedcontainer presence inside iframe", () => {
getIframeBody().find('.cmp-adaptiveform-container').should('have.length', 1);
- getIframeBody().find('.cmp-adaptiveform-container').find('.cmp-adaptiveform-numberinput__widget').should('have.length', 7);
+ getIframeBody().find('.cmp-adaptiveform-container').find('.cmp-adaptiveform-numberinput__widget').should('have.length', 8);
})
it("test for form presence in nonIframe mode", () => {
cy.get('.cmp-adaptiveform-container').should('have.length', 1);
- cy.get('.cmp-adaptiveform-container').find('.cmp-adaptiveform-textinput__widget').should('have.length', 10);
+ cy.get('.cmp-adaptiveform-container').find('.cmp-adaptiveform-textinput__widget').should('have.length', 11);
})
it('Test iframe src with dataRef', () => {
@@ -134,4 +134,4 @@ describe("Sites with Aem Embed Container", () => {
})
})
})
-})
\ No newline at end of file
+})
diff --git a/ui.tests/test-module/specs/datepicker/datepicker.runtime.localisation.spec.js b/ui.tests/test-module/specs/datepicker/datepicker.runtime.localisation.spec.js
index c274d33bd5..c62f3e2b45 100644
--- a/ui.tests/test-module/specs/datepicker/datepicker.runtime.localisation.spec.js
+++ b/ui.tests/test-module/specs/datepicker/datepicker.runtime.localisation.spec.js
@@ -19,6 +19,17 @@ describe("Form Runtime with Date Picker", () => {
const bemBlock = 'cmp-adaptiveform-datepicker'
let formContainer = null
+ const fmPropertiesUI = "/libs/fd/fm/gui/content/forms/formmetadataeditor.html/content/dam/formsanddocuments/core-components-it/samples/datepicker/basic"
+ const themeRef = 'input[name="./jcr:content/metadata/themeRef"]'
+ const propertiesSaveBtn = '#shell-propertiespage-doneactivator'
+ // enabling theme for this test case as without theme there is a bug in custom widget css
+ before(() => {
+ cy.openPage(fmPropertiesUI).then(() => {
+ cy.get(themeRef).should('be.visible').clear().type('/libs/fd/af/themes/canvas').then(() => {
+ cy.get(propertiesSaveBtn).click();
+ })
+ })
+ })
beforeEach(() => {
cy.previewForm(pagePath, {"params" : ["afAcceptLang=fr"]}).then(p => {
@@ -81,4 +92,4 @@ describe("Form Runtime with Date Picker", () => {
});
});
-})
\ No newline at end of file
+})
diff --git a/ui.tests/test-module/specs/datepicker/datepicker.runtime.spec.js b/ui.tests/test-module/specs/datepicker/datepicker.runtime.spec.js
index 87d9ff5a72..11f032d3d9 100644
--- a/ui.tests/test-module/specs/datepicker/datepicker.runtime.spec.js
+++ b/ui.tests/test-module/specs/datepicker/datepicker.runtime.spec.js
@@ -17,13 +17,31 @@ describe("Form Runtime with Date Picker", () => {
const pagePath = "content/forms/af/core-components-it/samples/datepicker/basic.html"
const bemBlock = 'cmp-adaptiveform-datepicker'
+ let toggle_array = [];
let formContainer = null
+ const fmPropertiesUI = "/libs/fd/fm/gui/content/forms/formmetadataeditor.html/content/dam/formsanddocuments/core-components-it/samples/datepicker/basic"
+ const themeRef = 'input[name="./jcr:content/metadata/themeRef"]'
+ const propertiesSaveBtn = '#shell-propertiespage-doneactivator'
+ // enabling theme for this test case as without theme there is a bug in custom widget css
+ before(() => {
+ cy.openPage(fmPropertiesUI).then(() => {
+ cy.get(themeRef).should('be.visible').clear().type('/libs/fd/af/themes/canvas').then(() => {
+ cy.get(propertiesSaveBtn).click();
+ })
+ })
+ })
beforeEach(() => {
cy.previewForm(pagePath).then(p => {
formContainer = p;
})
+
+ cy.fetchFeatureToggles().then((response) => {
+ if (response.status === 200) {
+ toggle_array = response.body.enabled;
+ }
+ });
});
const checkHTML = (id, state, displayValue) => {
@@ -221,4 +239,19 @@ describe("Form Runtime with Date Picker", () => {
});
});
-})
\ No newline at end of file
+ it(" should support display value expression", () => {
+ if(toggle_array.includes("FT_FORMS-13193")) {
+ const [dateInput, dateInputView] = Object.entries(formContainer._fields)[7];
+ const input = '2024-02-02';
+ const formatted= '2024-02-02 today'
+ let model = dateInputView.getModel();
+
+ cy.get(`#${dateInput}`).find("input").clear().type(input).blur().then(x => {
+ expect(model.getState().value).to.equal('2024-02-02');
+ expect(model.getState().displayValue).to.be.equal(formatted)
+ cy.get(`#${dateInput}`).find('input').should('have.value', model.getState().displayValue);
+ })
+ }
+ });
+
+})
diff --git a/ui.tests/test-module/specs/datepicker/datepicker.runtime.thai.locale.spec.js b/ui.tests/test-module/specs/datepicker/datepicker.runtime.thai.locale.spec.js
index e570e892a0..d972abf59a 100644
--- a/ui.tests/test-module/specs/datepicker/datepicker.runtime.thai.locale.spec.js
+++ b/ui.tests/test-module/specs/datepicker/datepicker.runtime.thai.locale.spec.js
@@ -19,6 +19,17 @@ describe("Form Runtime with Date Picker", () => {
const bemBlock = 'cmp-adaptiveform-datepicker'
let formContainer = null
+ const fmPropertiesUI = "/libs/fd/fm/gui/content/forms/formmetadataeditor.html/content/dam/formsanddocuments/core-components-it/samples/datepicker/basic"
+ const themeRef = 'input[name="./jcr:content/metadata/themeRef"]'
+ const propertiesSaveBtn = '#shell-propertiespage-doneactivator'
+ // enabling theme for this test case as without theme there is a bug in custom widget css
+ before(() => {
+ cy.openPage(fmPropertiesUI).then(() => {
+ cy.get(themeRef).should('be.visible').clear().type('/libs/fd/af/themes/canvas').then(() => {
+ cy.get(propertiesSaveBtn).click();
+ })
+ })
+ })
beforeEach(() => {
cy.previewForm(pagePath, {"params" : ["afAcceptLang=th"]}).then(p => {
@@ -62,4 +73,4 @@ describe("Form Runtime with Date Picker", () => {
-})
\ No newline at end of file
+})
diff --git a/ui.tests/test-module/specs/emailinput/emailinput.runtime.spec.js b/ui.tests/test-module/specs/emailinput/emailinput.runtime.spec.js
index d353dbb2a2..d87241d60f 100644
--- a/ui.tests/test-module/specs/emailinput/emailinput.runtime.spec.js
+++ b/ui.tests/test-module/specs/emailinput/emailinput.runtime.spec.js
@@ -18,6 +18,7 @@ describe("Form Runtime with Email Input", () => {
const pagePath = "content/forms/af/core-components-it/samples/emailinput/basic.html"
const bemBlock = 'cmp-adaptiveform-emailinput'
const IS = "adaptiveFormEmailInput"
+ let toggle_array = [];
const selectors = {
textinput : `[data-cmp-is="${IS}"]`
}
@@ -28,6 +29,11 @@ describe("Form Runtime with Email Input", () => {
cy.previewForm(pagePath).then(p => {
formContainer = p;
})
+ cy.fetchFeatureToggles().then((response) => {
+ if (response.status === 200) {
+ toggle_array = response.body.enabled;
+ }
+ });
});
const checkHTML = (id, state) => {
@@ -155,4 +161,19 @@ describe("Form Runtime with Email Input", () => {
cy.get(`#${id}`).should('have.class', 'cmp-adaptiveform-emailinput--filled');
});
});
+
+ it(" should support display value expression", () => {
+ if(toggle_array.includes("FT_FORMS-13193")) {
+ const [field, fieldView] = Object.entries(formContainer._fields)[4];
+ const input = 'johndoe@adobe.com';
+ const formatted= 'j******@adobe.com'
+ let model = fieldView.getModel();
+
+ cy.get(`#${field}`).find("input").clear().type(input).blur().then(x => {
+ expect(model.getState().value).to.equal('johndoe@adobe.com');
+ expect(model.getState().displayValue).to.be.equal(formatted)
+ cy.get(`#${field}`).find('input').should('have.value', model.getState().displayValue);
+ })
+ }
+ });
})
diff --git a/ui.tests/test-module/specs/embedFormsInSite/embedFormsInSite.runtime.spec.js b/ui.tests/test-module/specs/embedFormsInSite/embedFormsInSite.runtime.spec.js
index 5c762033f9..faf3867cc9 100644
--- a/ui.tests/test-module/specs/embedFormsInSite/embedFormsInSite.runtime.spec.js
+++ b/ui.tests/test-module/specs/embedFormsInSite/embedFormsInSite.runtime.spec.js
@@ -56,12 +56,12 @@ describe("Embed multiple form in site", () => {
it("form 1 model initialized properly", () => {
expect(formContainer[0], "formcontainer is initialized").to.not.be.null;
- expect(Object.keys(formContainer[0]._fields).length).to.equal(11);
+ expect(Object.keys(formContainer[0]._fields).length).to.equal(12);
});
it("form 2 model initialized properly", () => {
expect(formContainer[1], "formcontainer is initialized").to.not.be.null;
- expect(Object.keys(formContainer[1]._fields).length).to.equal(4);
+ expect(Object.keys(formContainer[1]._fields).length).to.equal(5);
});
it(" model's changes are reflected in the html for form1", () => {
@@ -110,4 +110,4 @@ describe("Embed multiple form in site", () => {
})
})
-})
\ No newline at end of file
+})
diff --git a/ui.tests/test-module/specs/numberinput/numberinput.runtime.spec.js b/ui.tests/test-module/specs/numberinput/numberinput.runtime.spec.js
index a9e09562be..87c7c5eb33 100644
--- a/ui.tests/test-module/specs/numberinput/numberinput.runtime.spec.js
+++ b/ui.tests/test-module/specs/numberinput/numberinput.runtime.spec.js
@@ -18,6 +18,7 @@ describe("Form with Number Input", () => {
const pagePath = "content/forms/af/core-components-it/samples/numberinput/basic.html"
const bemBlock = 'cmp-adaptiveform-numberinput'
const IS = "adaptiveFormNumberInput"
+ let toggle_array = [];
const selectors = {
numberinput : `[data-cmp-is="${IS}"]`
}
@@ -28,6 +29,12 @@ describe("Form with Number Input", () => {
cy.previewForm(pagePath).then(p => {
formContainer = p;
})
+
+ cy.fetchFeatureToggles().then((response) => {
+ if (response.status === 200) {
+ toggle_array = response.body.enabled;
+ }
+ });
});
const checkHTML = (id, state) => {
@@ -222,4 +229,19 @@ describe("Form with Number Input", () => {
cy.get(`#${numberInput7}`).should('have.class', 'cmp-adaptiveform-numberinput--filled');
});
});
+
+ it(" should support display value expression", () => {
+ if(toggle_array.includes("FT_FORMS-13193")) {
+ const [numberInput, numberInputFieldView] = Object.entries(formContainer._fields)[7];
+ const input = 1234567812345678;
+ const formatted= '**** **** **** 5678 '
+ let model = numberInputFieldView.getModel();
+
+ cy.get(`#${numberInput}`).find("input").clear().type(input).blur().then(x => {
+ expect(Number(model.getState().value)).to.equal(Number(input));
+ expect(model.getState().displayValue).to.be.equal(formatted)
+ cy.get(`#${numberInput}`).find('input').should('have.value', model.getState().displayValue);
+ })
+ }
+ });
})
diff --git a/ui.tests/test-module/specs/telephoneinput/telephoneinput.runtime.spec.js b/ui.tests/test-module/specs/telephoneinput/telephoneinput.runtime.spec.js
index 4ea63c44bc..2b92ddb3c9 100644
--- a/ui.tests/test-module/specs/telephoneinput/telephoneinput.runtime.spec.js
+++ b/ui.tests/test-module/specs/telephoneinput/telephoneinput.runtime.spec.js
@@ -18,6 +18,7 @@ describe("Form Runtime with Telephone Input", () => {
const pagePath = "content/forms/af/core-components-it/samples/telephoneinput/basic.html"
const bemBlock = 'cmp-adaptiveform-telephoneinput'
const IS = "adaptiveFormTelephoneInput"
+ let toggle_array = [];
const selectors = {
telephoneinput : `[data-cmp-is="${IS}"]`
}
@@ -28,6 +29,11 @@ describe("Form Runtime with Telephone Input", () => {
cy.previewForm(pagePath).then(p => {
formContainer = p;
})
+ cy.fetchFeatureToggles().then((response) => {
+ if (response.status === 200) {
+ toggle_array = response.body.enabled;
+ }
+ });
});
const checkHTML = (id, state) => {
@@ -142,4 +148,19 @@ describe("Form Runtime with Telephone Input", () => {
cy.get(`#${id}`).should('have.class', 'cmp-adaptiveform-telephoneinput--filled');
});
});
+
+ it(" should support display value expression", () => {
+ if(toggle_array.includes("FT_FORMS-13193")) {
+ const [field, fieldView] = Object.entries(formContainer._fields)[7];
+ const input = 9999999999;
+ const formatted= '*******999'
+ let model = fieldView.getModel();
+
+ cy.get(`#${field}`).find("input").clear().type(input).blur().then(x => {
+ expect(model.getState().value).to.equal('9999999999');
+ expect(model.getState().displayValue).to.be.equal(formatted)
+ cy.get(`#${field}`).find('input').should('have.value', model.getState().displayValue);
+ })
+ }
+ });
})
diff --git a/ui.tests/test-module/specs/textinput/textinput.runtime.spec.js b/ui.tests/test-module/specs/textinput/textinput.runtime.spec.js
index b54af794dd..a3f1ad86d7 100644
--- a/ui.tests/test-module/specs/textinput/textinput.runtime.spec.js
+++ b/ui.tests/test-module/specs/textinput/textinput.runtime.spec.js
@@ -28,6 +28,7 @@ describe("Form Runtime with Text Input", () => {
}
let formContainer = null
+ let toggle_array = [];
beforeEach(() => {
if (Cypress.mocha.getRunner().suite.ctx.currentTest.title !== "should show different localised default error messages on different constraints") {
@@ -35,6 +36,11 @@ describe("Form Runtime with Text Input", () => {
formContainer = p;
})
}
+ cy.fetchFeatureToggles().then((response) => {
+ if (response.status === 200) {
+ toggle_array = response.body.enabled;
+ }
+ });
});
const checkHTML = (id, state) => {
@@ -163,7 +169,7 @@ describe("Form Runtime with Text Input", () => {
const [textbox7, textBox7FieldView] = Object.entries(formContainer._fields)[6];
const [textbox8, textBox8FieldView] = Object.entries(formContainer._fields)[7];
- const [submitbutton1, fieldView] = Object.entries(formContainer._fields)[10]
+ const [submitbutton1, fieldView] = Object.entries(formContainer._fields)[11]
// 1. Required
cy.get(`#${textbox6}`).find("input").focus().blur().then(x => {
@@ -273,6 +279,21 @@ describe("Form Runtime with Text Input", () => {
.invoke('attr', 'autocomplete')
.should("eq", "given-name");
})
+
+ it(" should support display value expression", () => {
+ if(toggle_array.includes("FT_FORMS-13193")) {
+ const [textInput, textInputField] = Object.entries(formContainer._fields)[10];
+ const input = '1234567812345678';
+ const formatted= '**** **** **** 5678 '
+ let model = textInputField.getModel();
+
+ cy.get(`#${textInput}`).find("input").clear().type(input).blur().then(x => {
+ expect(model.getState().value).to.equal(input);
+ expect(model.getState().displayValue).to.be.equal(formatted)
+ cy.get(`#${textInput}`).find('input').should('have.value', model.getState().displayValue);
+ })
+ }
+ });
})
describe("Form Runtime with Text Input For Different locale", () => {