test: added test for recaptcha (#11805)

* Added test for Recaptcha

* updated test
This commit is contained in:
NandanAnantharamu 2022-03-24 14:59:29 +05:30 committed by GitHub
parent bed11f4eca
commit c7f3b86d8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 125 additions and 0 deletions

View File

@ -0,0 +1,87 @@
{
"dsl": {
"widgetName": "MainContainer",
"backgroundColor": "none",
"rightColumn": 1056,
"snapColumns": 64,
"detachFromLayout": true,
"widgetId": "0",
"topRow": 0,
"bottomRow": 800,
"containerStyle": "none",
"snapRows": 125,
"parentRowSpace": 1,
"type": "CANVAS_WIDGET",
"canExtend": true,
"version": 52,
"minHeight": 780,
"parentColumnSpace": 1,
"dynamicBindingPathList": [],
"leftColumn": 0,
"children": [
{
"isVisible": true,
"animateLoading": true,
"text": "Submit",
"buttonColor": "#03B365",
"buttonVariant": "PRIMARY",
"placement": "CENTER",
"widgetName": "Button1",
"isDisabled": false,
"isDefaultClickDisabled": true,
"recaptchaType": "V3",
"version": 1,
"type": "BUTTON_WIDGET",
"hideCard": false,
"displayName": "Button",
"key": "b3xxd5tj9s",
"iconSVG": "/static/media/icon.cca02633.svg",
"widgetId": "56yla62kkw",
"renderMode": "CANVAS",
"isLoading": false,
"parentColumnSpace": 16.3125,
"parentRowSpace": 10,
"leftColumn": 19,
"rightColumn": 35,
"topRow": 10,
"bottomRow": 14,
"parentId": "0"
},
{
"isVisible": true,
"text": "{{Button1.recaptchaToken}}",
"fontSize": "PARAGRAPH",
"fontStyle": "BOLD",
"textAlign": "LEFT",
"textColor": "#231F20",
"truncateButtonColor": "#FFC13D",
"widgetName": "Text1",
"shouldScroll": false,
"shouldTruncate": false,
"version": 1,
"animateLoading": true,
"type": "TEXT_WIDGET",
"hideCard": false,
"displayName": "Text",
"key": "6cg9oqz0if",
"iconSVG": "/static/media/icon.97c59b52.svg",
"widgetId": "iymasdikx5",
"renderMode": "CANVAS",
"isLoading": false,
"parentColumnSpace": 16.3125,
"parentRowSpace": 10,
"leftColumn": 19,
"rightColumn": 35,
"topRow": 26,
"bottomRow": 30,
"parentId": "0",
"dynamicBindingPathList": [
{
"key": "text"
}
],
"dynamicTriggerPathList": []
}
]
}
}

View File

@ -0,0 +1,38 @@
const commonlocators = require("../../../../locators/commonlocators.json");
const formWidgetsPage = require("../../../../locators/FormWidgets.json");
const dsl = require("../../../../fixtures/buttonRecaptchaDsl.json");
const pages = require("../../../../locators/Pages.json");
const widgetsPage = require("../../../../locators/Widgets.json");
const publish = require("../../../../locators/publishWidgetspage.json");
const testdata = require("../../../../fixtures/testdata.json");
describe("Binding the Button widget with Text widget using Recpatcha v3", function() {
before(() => {
cy.addDsl(dsl);
});
it("Validate the Button binding with Text Widget with Recaptcha Token", function() {
cy.get("button")
.contains("Submit")
.should("be.visible")
.click({ force: true });
cy.SearchEntityandOpen("Text1");
cy.get(".t--draggable-textwidget .bp3-ui-text").should("be.visible");
cy.get(".t--draggable-textwidget .bp3-ui-text").should("have.value", "");
cy.SearchEntityandOpen("Button1");
cy.get(".t--property-control-googlerecaptchaversion .bp3-popover-target")
.last()
.should("be.visible")
.click({ force: true });
cy.get(".t--dropdown-option:contains('reCAPTCHA v2')").click({
force: true,
});
cy.get("button")
.contains("Submit")
.should("be.visible")
.click({ force: true });
cy.SearchEntityandOpen("Text1");
cy.get(".t--draggable-textwidget .bp3-ui-text").should("be.visible");
cy.get(".t--draggable-textwidget .bp3-ui-text").should("have.value", "");
});
});