diff --git a/app/client/cypress/fixtures/inputdata.json b/app/client/cypress/fixtures/inputdata.json index 2bfedbc8f4..8838ee80c3 100644 --- a/app/client/cypress/fixtures/inputdata.json +++ b/app/client/cypress/fixtures/inputdata.json @@ -1,4 +1,4 @@ { - "appname": "Test app" + "appname": "Cypress Automation" } \ No newline at end of file diff --git a/app/client/cypress/integration/Smoke_TestSuite/FormWidgets/CheckBox_spec.js b/app/client/cypress/integration/Smoke_TestSuite/FormWidgets/CheckBox_spec.js index 54e58c60ce..24f7d0e9a7 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/FormWidgets/CheckBox_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/FormWidgets/CheckBox_spec.js @@ -18,10 +18,10 @@ context("Cypress test", function() { .type("{ctrl}{shift}{downarrow}") .should("be.empty") .clear({ force: true }) - .type("Test Input Label"); + .type("Test Checkbox"); cy.get(".CodeMirror textarea") .first() - .should("have.value", "Test Input Label"); + .should("have.value", "Test Checkbox"); cy.get(commonlocators.editPropCrossButton).click(); }); }); diff --git a/app/client/cypress/integration/Smoke_TestSuite/FormWidgets/DatePicker_spec.js b/app/client/cypress/integration/Smoke_TestSuite/FormWidgets/DatePicker_spec.js new file mode 100644 index 0000000000..6dbf32baf9 --- /dev/null +++ b/app/client/cypress/integration/Smoke_TestSuite/FormWidgets/DatePicker_spec.js @@ -0,0 +1,27 @@ +const commonlocators = require("../../../locators/commonlocators.json"); +const formWidgetsPage = require("../../../locators/FormWidgets.json"); + +context("Cypress test", function() { + it("DatePicker Widget Functionality", function() { + cy.NavigateToFormWidgets(); + cy.get(formWidgetsPage.datepickerWidget) + .first() + .trigger("mouseover"); + cy.get(formWidgetsPage.datepickerWidget) + .children(commonlocators.editicon) + .first() + .click({ force: true }); + //Checking the edit props for DatePicker and also the properties of DatePicker widget + cy.get(".CodeMirror textarea") + .first() + .focus() + .type("{ctrl}{shift}{downarrow}") + .should("be.empty") + .clear({ force: true }) + .type("From Date"); + cy.get(".CodeMirror textarea") + .first() + .should("have.value", "From Date"); + cy.get(commonlocators.editPropCrossButton).click(); + }); +}); diff --git a/app/client/cypress/integration/Smoke_TestSuite/FormWidgets/FilePicker_spec.js b/app/client/cypress/integration/Smoke_TestSuite/FormWidgets/FilePicker_spec.js new file mode 100644 index 0000000000..01c7cfb7a9 --- /dev/null +++ b/app/client/cypress/integration/Smoke_TestSuite/FormWidgets/FilePicker_spec.js @@ -0,0 +1,27 @@ +const commonlocators = require("../../../locators/commonlocators.json"); +const formWidgetsPage = require("../../../locators/FormWidgets.json"); + +context("Cypress test", function() { + it("FilePicker Widget Functionality", function() { + cy.NavigateToFormWidgets(); + cy.get(formWidgetsPage.filepickerWidget) + .first() + .trigger("mouseover"); + cy.get(formWidgetsPage.filepickerWidget) + .children(commonlocators.editicon) + .first() + .click({ force: true }); + //Checking the edit props for FilePicker and also the properties of FilePicker widget + cy.get(".CodeMirror textarea") + .first() + .focus() + .type("{ctrl}{shift}{downarrow}") + .should("be.empty") + .clear({ force: true }) + .type("Upload Files"); + cy.get(".CodeMirror textarea") + .first() + .should("have.value", "Upload Files"); + cy.get(commonlocators.editPropCrossButton).click(); + }); +}); diff --git a/app/client/cypress/integration/Smoke_TestSuite/FormWidgets/FormWidget_spec.js b/app/client/cypress/integration/Smoke_TestSuite/FormWidgets/FormWidget_spec.js new file mode 100644 index 0000000000..3d0db8fe43 --- /dev/null +++ b/app/client/cypress/integration/Smoke_TestSuite/FormWidgets/FormWidget_spec.js @@ -0,0 +1,27 @@ +const commonlocators = require("../../../locators/commonlocators.json"); +const formWidgetsPage = require("../../../locators/FormWidgets.json"); + +context("Cypress test", function() { + it("Form Widget Functionality", function() { + cy.NavigateToFormWidgets(); + cy.get(formWidgetsPage.formWidget) + .first() + .trigger("mouseover"); + cy.get(formWidgetsPage.formWidget) + .children(commonlocators.editicon) + .first() + .click({ force: true }); + //Checking the edit props for Form and also the properties of Form widget + cy.get(".CodeMirror textarea") + .first() + .focus() + .type("{ctrl}{shift}{downarrow}") + .should("be.empty") + .clear({ force: true }) + .type("Gray"); + cy.get(".CodeMirror textarea") + .first() + .should("have.value", "Gray"); + cy.get(commonlocators.editPropCrossButton).click(); + }); +}); diff --git a/app/client/cypress/locators/FormWidgets.json b/app/client/cypress/locators/FormWidgets.json index 1128cb670c..bbb3f793c8 100644 --- a/app/client/cypress/locators/FormWidgets.json +++ b/app/client/cypress/locators/FormWidgets.json @@ -5,7 +5,6 @@ "radioWidget": ".t--draggable-radiogroupwidget", "radioOnSelectionChangeDropdown": ".t--property-control-onselectionchange", "datepickerWidget":".t--draggable-datepickerwidget", - "filepickerWidget":".t--draggable-filepickerwidget" - - + "filepickerWidget":".t--draggable-filepickerwidget", + "formWidget":".t--draggable-formwidget" } \ No newline at end of file diff --git a/app/client/cypress/locators/HomePage.json b/app/client/cypress/locators/HomePage.json index 2a51f315ca..636a48d0f7 100644 --- a/app/client/cypress/locators/HomePage.json +++ b/app/client/cypress/locators/HomePage.json @@ -2,6 +2,7 @@ "searchInput": "input[type='text']", "appEditIcon": ".t--application-edit-link", "publishButton":".t--application-publish-btn", - "publishCrossButton":"span[icon='small-cross']" + "publishCrossButton":"span[icon='small-cross']", + "homePageID":"//div[@id='root']" } \ No newline at end of file diff --git a/app/client/cypress/support/commands.js b/app/client/cypress/support/commands.js index 37dcd03753..fb48798a9f 100644 --- a/app/client/cypress/support/commands.js +++ b/app/client/cypress/support/commands.js @@ -37,7 +37,7 @@ Cypress.Commands.add("NavigateToFormWidgets", () => { }); Cypress.Commands.add("PublishtheApp", () => { - cy.xpath("//div[@id='root']").contains("All changes saved"); + cy.xpath(homePage.homePageID).contains("All changes saved"); cy.get(homePage.publishButton).click(); cy.window().then(win => { cy.get(homePage.publishCrossButton).click();