Skip to content

Commit

Permalink
Add cypress test for listview (ToolJet#4070)
Browse files Browse the repository at this point in the history
* Add data-cy

* Add utils

* Add spec and constants

* Fix commented lines.

* Added missing preview
  • Loading branch information
emidhun authored Sep 23, 2022
1 parent ddf28a1 commit 4d42efa
Show file tree
Hide file tree
Showing 12 changed files with 524 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cypress-tests/cypress/constants/selectors/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export const commonWidgetSelector = {
boxShadowDefaultParam: ["x", "y", "blur", "spread"],
colourPickerParent: "[data-cy='color-picker-parent']",
inputBoxShadow: "[data-cy= 'input-box-shadow']",
boxShadowColorPicker: "[data-cy='box-shadow-color-picker']",
boxShadowColorPicker: "[data-cy='box-shadow-picker']",
textInputWidget: '[data-cy="draggable-widget-textinput1"]',
previewButton: `[data-cy="preview-link-button"]`,
};
Empty file.
11 changes: 8 additions & 3 deletions cypress-tests/cypress/constants/texts/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const commonWidgetText = {
parameterShowOnMobile: "Show on mobile",
parameterVisibility: "Visibility",
parameterDisable: "Disable",
parameterBorderRadius: "Border radius",
parameterBorderRadius: "Border Radius",
borderRadiusInput: ["{{", "20}}"],
parameterOptionLabels: "Option labels",
parameterBoxShadow: "Box Shadow",
Expand All @@ -81,17 +81,22 @@ export const commonWidgetText = {
addEventHandlerLink: "+ Add event handler",
inspectorComponentLabel: "components",
componentValueLabel: "Value",
labelDefaultValue: "Default value",
labelDefaultValue: "Default Value",
parameterLabel: "Label",

datepickerDocumentationLink: "Datepicker documentation",
text1: "text1",
textinput1: "textinput1",
toggleswitch1: "toggleswitch1",
toggleSwitch: "Toggle Switch",
button1: "button1",
image1: "image1",
};

export const createBackspaceText = (text) => {
let backspace = "{end}";
[...text].forEach((c) => (backspace += "{backspace}"));
[...text].forEach((c) => {
backspace += "{backspace}{del}";
});
return backspace;
};
7 changes: 7 additions & 0 deletions cypress-tests/cypress/constants/texts/listview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export const listviewText = {
defaultWidgetName: "Listview1",
showBottomBorder: "Show bottom border",
rowHeight: "Row height",
noEventHandlerMessage: "This listview doesn't have any event handlers",
listData: "List data",
};
Loading

0 comments on commit 4d42efa

Please sign in to comment.