-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FORMS-16943: added dateToDaysSinceEpoch method (#1455)
* FORMS-16943: added dateToDaysSinceEpoch method * FORMS-16943: added dateToDaysSinceEpoch method * FORMS-16943: added authoring and runtime test for date comparison validation * FORMS-16943: added authoring and runtime test for date comparison validation * FORMS-16943: updated tests * FORMS-16943: updated tests * FORMS-16943: updated tests --------- Co-authored-by: Arun Kumar Attri <[email protected]>
- Loading branch information
1 parent
a9be9e8
commit 75e25e7
Showing
20 changed files
with
1,463 additions
and
297 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
...am/formsanddocuments/core-components-it/samples/ruleeditor/navigate-in-panel/.content.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" | ||
jcr:primaryType="sling:Folder" | ||
lcFolder="{Long}0" | ||
type="lcFolder"> | ||
<jcr:content | ||
jcr:primaryType="nt:unstructured" | ||
jcr:title="navigate-in-panel"> | ||
<folderThumbnail/> | ||
</jcr:content> | ||
</jcr:root> |
23 changes: 23 additions & 0 deletions
23
...msanddocuments/core-components-it/samples/ruleeditor/navigate-in-panel/basic/.content.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:dam="http://www.day.com/dam/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:xmp="http://ns.adobe.com/xap/1.0/" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:fd="http://www.adobe.com/aemfd/fd/1.0" | ||
jcr:primaryType="dam:Asset"> | ||
<jcr:content | ||
cq:conf="\0" | ||
jcr:lastModified="{Date}2024-08-20T06:03:38.597Z" | ||
jcr:primaryType="dam:AssetContent" | ||
sling:resourceType="fd/fm/af/render" | ||
guide="1" | ||
type="guide"> | ||
<metadata | ||
fd:version="2.1" | ||
jcr:language="en" | ||
jcr:primaryType="nt:unstructured" | ||
xmp:CreatorTool="AEM Forms AF Wizard" | ||
allowedRenderFormat="HTML" | ||
author="admin" | ||
dorType="none" | ||
formmodel="none" | ||
themeRef="/libs/fd/af/themes/canvas" | ||
title="basic"/> | ||
</jcr:content> | ||
</jcr:root> |
23 changes: 23 additions & 0 deletions
23
...msanddocuments/core-components-it/samples/ruleeditor/navigate-in-panel/blank/.content.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:dam="http://www.day.com/dam/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:xmp="http://ns.adobe.com/xap/1.0/" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:fd="http://www.adobe.com/aemfd/fd/1.0" | ||
jcr:primaryType="dam:Asset"> | ||
<jcr:content | ||
cq:conf="\0" | ||
jcr:lastModified="{Date}2024-08-20T10:32:12.709Z" | ||
jcr:primaryType="dam:AssetContent" | ||
sling:resourceType="fd/fm/af/render" | ||
guide="1" | ||
type="guide"> | ||
<metadata | ||
fd:version="2.1" | ||
jcr:language="en" | ||
jcr:primaryType="nt:unstructured" | ||
xmp:CreatorTool="AEM Forms AF Wizard" | ||
allowedRenderFormat="HTML" | ||
author="admin" | ||
dorType="none" | ||
formmodel="none" | ||
themeRef="/libs/fd/af/themes/canvas" | ||
title="blank"/> | ||
</jcr:content> | ||
</jcr:root> |
142 changes: 94 additions & 48 deletions
142
...ontent/jcr_root/content/forms/af/core-components-it/samples/ruleeditor/basic/.content.xml
Large diffs are not rendered by default.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
...oot/content/forms/af/core-components-it/samples/ruleeditor/navigate-in-panel/.content.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" | ||
jcr:primaryType="sling:Folder"/> |
611 changes: 611 additions & 0 deletions
611
...ntent/forms/af/core-components-it/samples/ruleeditor/navigate-in-panel/basic/.content.xml
Large diffs are not rendered by default.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
...ntent/forms/af/core-components-it/samples/ruleeditor/navigate-in-panel/blank/.content.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:fd="http://www.adobe.com/aemfd/fd/1.0" | ||
jcr:primaryType="cq:Page"> | ||
<jcr:content | ||
cq:deviceGroups="[/etc/mobile/groups/responsive]" | ||
cq:lastModified="{Date}2024-08-20T10:32:12.710Z" | ||
cq:lastModifiedBy="admin" | ||
cq:template="/conf/core-components-examples/settings/wcm/templates/af-blank-v2" | ||
jcr:language="en" | ||
jcr:primaryType="cq:PageContent" | ||
jcr:title="blank" | ||
sling:configRef="/conf/forms/core-components-it/samples/ruleeditor/navigate-in-panel/blank/" | ||
sling:resourceType="forms-components-examples/components/page"> | ||
<guideContainer | ||
fd:version="2.1" | ||
jcr:primaryType="nt:unstructured" | ||
sling:resourceType="forms-components-examples/components/form/container" | ||
dorType="none" | ||
fieldType="form" | ||
thankYouOption="page" | ||
themeRef="/libs/fd/af/themes/canvas" | ||
title="blank"/> | ||
</jcr:content> | ||
</jcr:root> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
119 changes: 119 additions & 0 deletions
119
ui.tests/test-module/specs/ruleeditor/authoring/navigatePanel.authoring.cy.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
const commons = require('../../../libs/commons/commons'), | ||
sitesSelectors = require('../../../libs/commons/sitesSelectors'), | ||
formsSelectors = require('../../../libs/commons/guideSelectors'), | ||
afConstants = require('../../../libs/commons/formsConstants'); | ||
|
||
describe('Rule editor navigate-in-panel rule authoring',function(){ | ||
let toggle_array = []; | ||
|
||
before(() => { | ||
cy.fetchFeatureToggles().then((response) => { | ||
if (response.status === 200) { | ||
toggle_array = response.body.enabled; | ||
} | ||
}); | ||
}); | ||
|
||
context('Open Forms Editor', function() { | ||
const formPath = "/content/forms/af/core-components-it/samples/ruleeditor/navigate-in-panel/blank", | ||
formContainerPath = formPath + afConstants.FORM_EDITOR_FORM_CONTAINER_SUFFIX, | ||
buttonEditPath = formContainerPath + "/" + afConstants.components.forms.resourceType.formbutton.split("/").pop(), | ||
panelEditPath = formContainerPath + "/" + afConstants.components.forms.resourceType.panelcontainer.split("/").pop(), | ||
buttonEditPathSelector = "[data-path='" + buttonEditPath + "']"; | ||
|
||
it('should add rule to focus previousItem in Panel on button click', function () { | ||
if (toggle_array.includes("FT_FORMS-10781")) { | ||
cy.openAuthoring(formPath); | ||
cy.selectLayer("Edit"); | ||
cy.get(sitesSelectors.overlays.overlay.component + "[data-path='" + formContainerPath + "/*']").should("exist"); | ||
|
||
cy.insertComponent(sitesSelectors.overlays.overlay.component + "[data-path='" + formContainerPath + "/*']", | ||
"Adaptive Form Panel", afConstants.components.forms.resourceType.panelcontainer); | ||
cy.get(sitesSelectors.overlays.overlay.component + "[data-path='" + formContainerPath + "/panelcontainer/*']").should("exist"); | ||
cy.wait(1000); | ||
|
||
cy.insertComponent(sitesSelectors.overlays.overlay.component + "[data-path='" + formContainerPath + "/panelcontainer/*']", | ||
"Adaptive Form Text Box", afConstants.components.forms.resourceType.formtextinput); | ||
cy.insertComponent(sitesSelectors.overlays.overlay.component + "[data-path='" + formContainerPath + "/panelcontainer/*']", | ||
"Adaptive Form Text Box", afConstants.components.forms.resourceType.formtextinput); | ||
|
||
cy.insertComponent(sitesSelectors.overlays.overlay.component + "[data-path='" + formContainerPath + "/*']", | ||
"Adaptive Form Button", afConstants.components.forms.resourceType.formbutton); | ||
cy.openEditableToolbar(sitesSelectors.overlays.overlay.component + buttonEditPathSelector); | ||
|
||
// Edit rule option not existing on button toolbar | ||
cy.get(formsSelectors.ruleEditor.action.editRule).should("exist"); | ||
cy.initializeEventHandlerOnChannel("af-rule-editor-initialized").as("isRuleEditorInitialized"); | ||
cy.get(formsSelectors.ruleEditor.action.editRule).click(); | ||
|
||
// click on create option from rule editor header | ||
cy.get("@isRuleEditorInitialized").its('done').should('equal', true); | ||
createNavigateInPanelRule(); | ||
|
||
// check and close rule editor | ||
cy.getRuleEditorIframe().find(formsSelectors.ruleEditor.action.closeRuleEditor).should("exist"); | ||
cy.getRuleEditorIframe().find(formsSelectors.ruleEditor.action.closeRuleEditor).click(); | ||
|
||
cy.get(sitesSelectors.overlays.overlay.component + buttonEditPathSelector).should("exist"); | ||
cy.selectLayer("Edit"); | ||
cy.deleteComponentByPath(buttonEditPath); | ||
cy.deleteComponentByPath(panelEditPath); | ||
} | ||
}) | ||
}) | ||
|
||
const createNavigateInPanelRule = function() { | ||
cy.getRuleEditorIframe().find(formsSelectors.ruleEditor.action.createRuleButton).should("be.visible").click(); | ||
cy.getRuleEditorIframe().find(formsSelectors.ruleEditor.action.sideToggleButton + ":first").click(); | ||
|
||
// // Forms Objects option is not existing on side panel | ||
// cy.getRuleEditorIframe().find(formsSelectors.ruleEditor.action.sidePanelFormObjectTab).should("exist"); | ||
// cy.getRuleEditorIframe().find(formsSelectors.ruleEditor.action.sidePanelFormObjectTab).then($el => { | ||
// expect($el.text().trim()).to.equal("Form Objects"); | ||
// }) | ||
// | ||
// // Functions option is not existing on side panel | ||
// cy.getRuleEditorIframe().find(formsSelectors.ruleEditor.action.sidePanelFunctionObjectTab).should("exist"); | ||
// cy.getRuleEditorIframe().find(formsSelectors.ruleEditor.action.sidePanelFunctionObjectTab).then($el => { | ||
// expect($el.text().trim()).to.equal("Functions"); | ||
// }) | ||
|
||
cy.getRuleEditorIframe().find(formsSelectors.ruleEditor.choiceModels.STATEMENT + " .child-choice-name").should("exist"); | ||
cy.getRuleEditorIframe().find(formsSelectors.ruleEditor.choiceModels.STATEMENT + " .child-choice-name").click(); | ||
|
||
cy.getRuleEditorIframe().find(formsSelectors.ruleEditor.choiceModels.STATEMENT + " .expeditor-customoverlay.is-open coral-selectlist-item[value='EVENT_SCRIPTS']") | ||
.click({force: true}); | ||
|
||
// select the component for which rule is to written i.e. Button here | ||
cy.getRuleEditorIframe().find(formsSelectors.ruleEditor.choiceModels.EVENT_AND_COMPARISON_OPERATOR + " .choice-view-default").should("exist"); | ||
cy.getRuleEditorIframe().find(formsSelectors.ruleEditor.choiceModels.EVENT_AND_COMPARISON_OPERATOR + " .choice-view-default").click(); | ||
|
||
// IS CLICKED option not existing in 'OPERATIONS' dropdown | ||
cy.getRuleEditorIframe().find(formsSelectors.ruleEditor.operator.IS_CLICKED).should("exist"); | ||
cy.getRuleEditorIframe().find(formsSelectors.ruleEditor.operator.IS_CLICKED).click(); | ||
|
||
// check and click on dropdown to view the actions available | ||
cy.getRuleEditorIframe().find(formsSelectors.ruleEditor.choiceModels.BLOCK_STATEMENT + " .choice-view-default").should("exist"); | ||
cy.getRuleEditorIframe().find(formsSelectors.ruleEditor.choiceModels.BLOCK_STATEMENT + " .choice-view-default").click(); | ||
|
||
// select HIDE action from dropdown | ||
cy.getRuleEditorIframe().find(formsSelectors.ruleEditor.operator.NAVIGATE_IN_PANEL).should("exist"); | ||
cy.getRuleEditorIframe().find(formsSelectors.ruleEditor.operator.NAVIGATE_IN_PANEL).click({force: true}); | ||
|
||
cy.getRuleEditorIframe().find(".PANEL_FOCUS_OPTION").should("exist"); | ||
cy.getRuleEditorIframe().find(".PANEL_FOCUS_OPTION").click(); | ||
|
||
cy.getRuleEditorIframe().find(".PANEL_FOCUS_OPTION coral-selectlist [value='PREVIOUS_ITEM']").click({force: true}); | ||
|
||
cy.getRuleEditorIframe().find(".terminal-view.PANEL.VARIABLE").should("be.visible"); | ||
cy.getRuleEditorIframe().find(".terminal-view.PANEL.VARIABLE").click(); | ||
|
||
cy.getRuleEditorIframe().find(".terminal-view.PANEL.VARIABLE coral-overlay.is-open .expression-selectlist coral-selectlist-item:first").click({force: true}); | ||
|
||
cy.getRuleEditorIframe().find(formsSelectors.ruleEditor.action.saveRule).should("exist"); | ||
cy.getRuleEditorIframe().find(formsSelectors.ruleEditor.action.saveRule).click(); | ||
|
||
// check if rule is created | ||
cy.getRuleEditorIframe().find(formsSelectors.ruleEditor.ruleSummary.CREATED_RULE).should("exist"); | ||
} | ||
}) |
Oops, something went wrong.