Feature/edit form widget 2

This commit is contained in:
Pushpa B 2020-04-03 09:29:52 +00:00
parent b10aa1b366
commit 47f8f63f46
8 changed files with 89 additions and 8 deletions

View File

@ -1,4 +1,4 @@
{
"appname": "Test app"
"appname": "Cypress Automation"
}

View File

@ -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();
});
});

View File

@ -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();
});
});

View File

@ -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();
});
});

View File

@ -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();
});
});

View File

@ -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"
}

View File

@ -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']"
}

View File

@ -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();