fix: ButtonGroup_MenuButton_Width_spec cypress test (#22412)

Fixes a flaky cypress test
This commit is contained in:
Pawan Kumar 2023-04-14 15:38:18 +05:30 committed by GitHub
parent f7eefec296
commit 8cefcc212d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 8 deletions

View File

@ -114,7 +114,7 @@
"renderMode": "CANVAS", "renderMode": "CANVAS",
"isLoading": false, "isLoading": false,
"animateLoading": true, "animateLoading": true,
"parentColumnSpace": 17.9375, "parentColumnSpace": 11.9375,
"leftColumn": 1, "leftColumn": 1,
"buttonVariant": "PRIMARY", "buttonVariant": "PRIMARY",
"key": "qxtmv7r8yb" "key": "qxtmv7r8yb"
@ -214,7 +214,7 @@
"renderMode": "CANVAS", "renderMode": "CANVAS",
"isLoading": false, "isLoading": false,
"animateLoading": true, "animateLoading": true,
"parentColumnSpace": 17.9375, "parentColumnSpace": 11.9375,
"leftColumn": 1, "leftColumn": 1,
"buttonVariant": "PRIMARY", "buttonVariant": "PRIMARY",
"key": "qxtmv7r8yb" "key": "qxtmv7r8yb"
@ -306,7 +306,7 @@
"type": "BUTTON_GROUP_WIDGET", "type": "BUTTON_GROUP_WIDGET",
"hideCard": false, "hideCard": false,
"animateLoading": true, "animateLoading": true,
"parentColumnSpace": 17.9375, "parentColumnSpace": 11.9375,
"dynamicTriggerPathList": [], "dynamicTriggerPathList": [],
"leftColumn": 1, "leftColumn": 1,
"dynamicBindingPathList": [], "dynamicBindingPathList": [],

View File

@ -1,4 +1,5 @@
const dsl = require("../../../../../fixtures/ButtonGroup_MenuButton_Width_dsl.json"); const dsl = require("../../../../../fixtures/ButtonGroup_MenuButton_Width_dsl.json");
const commonlocators = require("../../../../../locators/commonlocators.json");
describe("In a button group widget, menu button width", function () { describe("In a button group widget, menu button width", function () {
before(() => { before(() => {
@ -6,7 +7,9 @@ describe("In a button group widget, menu button width", function () {
}); });
it("If target width is smaller than min-width, The menu button popover width should be set to minimum width", () => { it("If target width is smaller than min-width, The menu button popover width should be set to minimum width", () => {
const minWidth = 12 * 11.9375; cy.get(commonlocators.layoutControls).eq(3).click();
const minWidth = 12 * 12.3125;
const widgetId = "yxjq5sck7d"; const widgetId = "yxjq5sck7d";
// Get the default menu button // Get the default menu button
cy.get(`.appsmith_widget_${widgetId} div.t--buttongroup-widget`) cy.get(`.appsmith_widget_${widgetId} div.t--buttongroup-widget`)
@ -30,7 +33,7 @@ describe("In a button group widget, menu button width", function () {
}); });
it("If target width is bigger than min width, The menu button popover width should always be the same as the target width", () => { it("If target width is bigger than min width, The menu button popover width should always be the same as the target width", () => {
const minWidth = 12 * 11.9375; const minWidth = 12 * 12.3125;
const widgetId = "t5l24fccio"; const widgetId = "t5l24fccio";
// Get the default menu button // Get the default menu button
@ -55,7 +58,7 @@ describe("In a button group widget, menu button width", function () {
}); });
it("After converting a simple button to a menu button, The menu button popover width should always be the same as the target width", () => { it("After converting a simple button to a menu button, The menu button popover width should always be the same as the target width", () => {
const minWidth = 12 * 11.9375; const minWidth = 12 * 12.3125;
const widgetId = "t5l24fccio"; const widgetId = "t5l24fccio";
const menuButtonId = "groupButton1"; const menuButtonId = "groupButton1";
// Change the first button type to menu // Change the first button type to menu
@ -84,7 +87,7 @@ describe("In a button group widget, menu button width", function () {
}); });
it("If an existing menu button width changes, its popover width should always be the same as the changed target width", () => { it("If an existing menu button width changes, its popover width should always be the same as the changed target width", () => {
const minWidth = 12 * 11.9375; const minWidth = 12 * 12.3125;
const widgetId = "t5l24fccio"; const widgetId = "t5l24fccio";
cy.get(".t--property-pane-back-btn").click(); cy.get(".t--property-pane-back-btn").click();
// Change the first button text // Change the first button text