-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/release' into chore/remove-serve…
…r-side-filtering-flag
- Loading branch information
Showing
64 changed files
with
890 additions
and
277 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
218 changes: 218 additions & 0 deletions
218
app/client/cypress/e2e/Regression/ClientSide/Widgets/Filepicker/FilePicker3_spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,218 @@ | ||
import { | ||
agHelper, | ||
locators, | ||
entityExplorer, | ||
deployMode, | ||
propPane, | ||
} from "../../../../../support/Objects/ObjectsCore"; | ||
|
||
describe("Verify file picker widget", () => { | ||
before(() => { | ||
agHelper.AddDsl("filepickerDsl"); | ||
}); | ||
it("1. Verify property visibility", () => { | ||
const basicProperties = [ | ||
"allowedfiletypes", | ||
"dataformat", | ||
`maxno\\.offiles`, | ||
]; | ||
|
||
const labelProperties = ["text"]; | ||
|
||
const validationProperties = ["required", "maxfilesize\\(mb\\)"]; | ||
|
||
const generalProperties = ["visible", "disable", "animateloading"]; | ||
|
||
const eventsProperties = ["onfilesselected"]; | ||
|
||
const styleColorProperties = ["buttoncolor"]; | ||
|
||
const styleBorderProperties = ["borderradius", "boxshadow"]; | ||
|
||
entityExplorer.SelectEntityByName("FilePicker1", "Widgets"); | ||
|
||
propPane.AssertPropertyVisibility(basicProperties, "basic"); | ||
propPane.AssertPropertyVisibility(labelProperties, "label"); | ||
propPane.AssertPropertyVisibility(validationProperties, "validation"); | ||
propPane.AssertPropertyVisibility(generalProperties, "general"); | ||
propPane.AssertPropertyVisibility(eventsProperties, "events"); | ||
propPane.MoveToTab("Style"); | ||
propPane.AssertPropertyVisibility(styleColorProperties, "color"); | ||
propPane.AssertPropertyVisibility(styleBorderProperties, "borderandshadow"); | ||
}); | ||
|
||
it("2. Verify Renaming, duplication and deletion", () => { | ||
// Rename and verify | ||
entityExplorer.RenameEntityFromExplorer( | ||
"FilePicker1", | ||
"NewFilePicker", | ||
true, | ||
); | ||
agHelper.AssertElementVisibility(locators._widgetName("NewFilePicker")); | ||
|
||
// Copy and paste widget using cmd+c and cmd+v | ||
entityExplorer.CopyPasteWidget("NewFilePicker"); | ||
entityExplorer.AssertEntityPresenceInExplorer("NewFilePickerCopy"); | ||
entityExplorer.DeleteWidgetFromEntityExplorer("NewFilePickerCopy"); | ||
|
||
// Copy paste from property pane and delete from property pane | ||
propPane.CopyPasteWidgetFromPropertyPane("NewFilePicker"); | ||
propPane.DeleteWidgetFromPropertyPane("NewFilePickerCopy"); | ||
entityExplorer.SelectEntityByName("NewFilePicker", "Widgets"); | ||
propPane.MoveToTab("Content"); | ||
}); | ||
|
||
it("3. Verify max number of files", () => { | ||
agHelper.AssertText(locators._buttonText, "text", "Select Files"); | ||
propPane.UpdatePropertyFieldValue("Max no. of files", "2"); | ||
agHelper.ClickButton("Select Files"); | ||
agHelper.UploadFile("AAAFlowerVase.jpeg"); | ||
// Verify Add more is visible | ||
agHelper.GetNClick(locators._buttonInDeployedMode, 0, true); | ||
agHelper.AssertElementVisibility(locators._fileUploadAddMore); | ||
agHelper.GetNClick(locators._fileUploadAddMore); | ||
|
||
// Verify Add more does not exist when max no. files are added | ||
agHelper.UploadFile("appsmithlogo.png"); | ||
agHelper.GetNClick(locators._buttonInDeployedMode, 0, true); | ||
agHelper.AssertElementAbsence(locators._fileUploadAddMore); | ||
agHelper.GetNClick(locators._fileUploadDashboardClose); | ||
|
||
agHelper.AssertText(locators._buttonText, "text", "2 files selected"); | ||
}); | ||
|
||
it("4. Verify Validation max file size supported", () => { | ||
propPane.UpdatePropertyFieldValue("Max file size(Mb)", "1"); | ||
agHelper.GetNClick(locators._buttonInDeployedMode, 0, true); | ||
agHelper.GetNClick('[title="Remove file"]'); | ||
agHelper.GetNClick(locators._fileUploadAddMore); | ||
agHelper | ||
.GetElement(locators._uploadFiles) | ||
.eq(0) | ||
.selectFile("cypress/fixtures/Appsmith.gif", { force: true }) | ||
.wait(3000); | ||
agHelper.AssertElementVisibility( | ||
locators._fileUploadErrorContains( | ||
"This file exceeds maximum allowed size of 1 MB ", | ||
), | ||
); | ||
agHelper.GetNClick(locators._fileUploadDashboardClose); | ||
}); | ||
|
||
it("5. Validate visible and disabled toggle", () => { | ||
propPane.TogglePropertyState("visible", "Off"); | ||
|
||
// Preview mode | ||
agHelper.GetNClick(locators._enterPreviewMode); | ||
agHelper.AssertElementAbsence( | ||
locators._widgetInDeployed("filepickerwidgetv2"), | ||
); | ||
agHelper.GetNClick(locators._exitPreviewMode); | ||
|
||
// Deploy mode | ||
deployMode.DeployApp(); | ||
agHelper.AssertElementAbsence( | ||
locators._widgetInDeployed("filepickerwidgetv2"), | ||
); | ||
deployMode.NavigateBacktoEditor(); | ||
|
||
entityExplorer.SelectEntityByName("NewFilePicker", "Widgets"); | ||
propPane.TogglePropertyState("visible", "On"); | ||
|
||
// Preview mode | ||
agHelper.GetNClick(locators._enterPreviewMode); | ||
agHelper.AssertElementVisibility( | ||
locators._widgetInDeployed("filepickerwidgetv2"), | ||
); | ||
agHelper.GetNClick(locators._exitPreviewMode); | ||
|
||
// Deploy mode | ||
deployMode.DeployApp(); | ||
agHelper.AssertElementVisibility( | ||
locators._widgetInDeployed("filepickerwidgetv2"), | ||
); | ||
deployMode.NavigateBacktoEditor(); | ||
|
||
// Visible JS mode | ||
entityExplorer.SelectEntityByName("NewFilePicker", "Widgets"); | ||
propPane.ToggleJSMode("Visible", true); | ||
propPane.UpdatePropertyFieldValue("Visible", "false"); | ||
|
||
deployMode.DeployApp(); | ||
agHelper.AssertElementAbsence( | ||
locators._widgetInDeployed("filepickerwidgetv2"), | ||
); | ||
deployMode.NavigateBacktoEditor(); | ||
|
||
entityExplorer.SelectEntityByName("NewFilePicker", "Widgets"); | ||
propPane.ToggleJSMode("Visible", true); | ||
propPane.UpdatePropertyFieldValue("Visible", "true"); | ||
propPane.ToggleJSMode("Visible", false); | ||
|
||
// Disabled | ||
propPane.TogglePropertyState("disable", "On"); | ||
agHelper.AssertAttribute( | ||
locators._widgetInDeployed("filepickerwidgetv2"), | ||
"disabled", | ||
"disabled", | ||
); | ||
|
||
// Preview mode | ||
agHelper.GetNClick(locators._enterPreviewMode); | ||
agHelper.AssertAttribute( | ||
locators._widgetInDeployed("filepickerwidgetv2"), | ||
"disabled", | ||
"disabled", | ||
); | ||
agHelper.GetNClick(locators._exitPreviewMode); | ||
|
||
// Deploy mode | ||
deployMode.DeployApp(); | ||
agHelper.AssertAttribute( | ||
locators._widgetInDeployed("filepickerwidgetv2"), | ||
"disabled", | ||
"disabled", | ||
); | ||
deployMode.NavigateBacktoEditor(); | ||
|
||
entityExplorer.SelectEntityByName("NewFilePicker", "Widgets"); | ||
propPane.TogglePropertyState("disable", "Off"); | ||
}); | ||
|
||
it("6. Verify onFilesSelected", () => { | ||
propPane.ToggleJSMode("onFilesSelected", true); | ||
propPane.UpdatePropertyFieldValue( | ||
"onFilesSelected", | ||
"{{showAlert('File Selected', '');}}", | ||
); | ||
deployMode.DeployApp(); | ||
agHelper.ClickButton("Select Files"); | ||
agHelper.UploadFile("appsmithlogo.png"); | ||
agHelper.ValidateToastMessage("File Selected"); | ||
deployMode.NavigateBacktoEditor(); | ||
}); | ||
|
||
it("7. Verify button color and border and shadows", () => { | ||
entityExplorer.SelectEntityByName("NewFilePicker", "Widgets"); | ||
// Verify button color picker opens up | ||
propPane.MoveToTab("Style"); | ||
agHelper.GetNClick(propPane._propertyControlColorPicker("buttoncolor")); | ||
agHelper.AssertElementVisibility(propPane._colorPickerV2Color); | ||
// Verify full color picker | ||
agHelper.AssertAttribute(propPane._colorPickerInput, "type", "text", 0); | ||
propPane.TogglePropertyState("buttoncolor", "On", ""); | ||
agHelper.AssertAttribute(propPane._colorPickerInput, "type", "color", 0); | ||
|
||
// Verify border | ||
agHelper.GetNClick(propPane._segmentedControl("0px")); | ||
agHelper.AssertCSS(locators._buttonInDeployedMode, "border-radius", "0px"); | ||
|
||
// Verify Box Shadow | ||
agHelper.GetNClick(`${propPane._segmentedControl("0")}:contains('Large')`); | ||
agHelper.AssertCSS( | ||
locators._buttonInDeployedMode, | ||
"box-shadow", | ||
"rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px", | ||
); | ||
}); | ||
}); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
app/client/src/ce/pages/AppViewer/KnowledgeBase/KBViewerFloatingButton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const KBViewerFloatingButton = () => { | ||
return null; | ||
}; |
3 changes: 0 additions & 3 deletions
3
app/client/src/ce/pages/AppViewer/KnowledgeBase/KBViewerNavButton.tsx
This file was deleted.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
app/client/src/ce/pages/Editor/KnowledgeBase/KBEditorMenuItem.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const KBEditorMenuItem = () => { | ||
return null; | ||
}; |
3 changes: 0 additions & 3 deletions
3
app/client/src/ce/pages/Editor/KnowledgeBase/KBEditorNavButton.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.