-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Map widget automation (#27901)
## Description - Map widget automation #### Type of change - Added spec to verify the map widget with all the possible settings - Updated the workflows to include map widget spec for hosted runs and not run for normal runs ## Testing > #### How Has This Been Tested? - [x] Cypress > > ## Checklist: #### QA activity: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-) have been covered - [ ] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-) - [ ] Test plan has been peer reviewed by project stakeholders and other QA members - [ ] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [ ] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed --------- Co-authored-by: Aishwarya UR <aishwarya@appsmith.com>
- Loading branch information
1 parent
04b8594
commit b865ea3
Showing
24 changed files
with
202 additions
and
4 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
164 changes: 164 additions & 0 deletions
164
app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/MapWidget_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,164 @@ | ||
/// <reference types="Cypress" /> | ||
import { | ||
agHelper, | ||
entityExplorer, | ||
propPane, | ||
draggableWidgets, | ||
deployMode, | ||
locators, | ||
} from "../../../../../support/Objects/ObjectsCore"; | ||
|
||
const location = [ | ||
{ | ||
lat: 28.7040592, | ||
long: 77.10249019999999, | ||
title: "Delhi, India", | ||
}, | ||
{ | ||
lat: 28.4594965, | ||
long: 77.0266383, | ||
title: "Gurugram, Haryana, India", | ||
}, | ||
{ | ||
lat: 40.7127753, | ||
long: -74.0059728, | ||
title: "New York, NY, USA", | ||
}, | ||
]; | ||
|
||
describe("Map Widget", function () { | ||
it("1.Drag Map Widget and Verify the Map Widget with Initial Location", () => { | ||
//Add map and verify | ||
entityExplorer.DragDropWidgetNVerify(draggableWidgets.MAP, 200, 200); | ||
deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.MAP)); | ||
agHelper.VerifySnapshot(locators._root, "mapsimple"); | ||
deployMode.NavigateBacktoEditor(); | ||
entityExplorer.SelectEntityByName("Map1", "Widgets"); | ||
|
||
// Add Initial location and verify | ||
propPane.TypeTextIntoField("Initial location", "New York, NY, USA"); | ||
agHelper.PressEnter(); | ||
deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.MAP)); | ||
agHelper.VerifySnapshot(locators._root, "mapWithInitalLocation"); | ||
deployMode.NavigateBacktoEditor(); | ||
entityExplorer.SelectEntityByName("Map1", "Widgets"); | ||
|
||
// convert Initial location to JS, update and verify | ||
propPane.EnterJSContext("Initial location", JSON.stringify(location[0])); | ||
deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.MAP)); | ||
agHelper.VerifySnapshot(locators._root, "mapWithinItalLocationAsJS"); | ||
deployMode.NavigateBacktoEditor(); | ||
entityExplorer.SelectEntityByName("Map1", "Widgets"); | ||
}); | ||
|
||
it("2.Verify the Map Widget with Default markers", () => { | ||
// With single default marker | ||
propPane.TypeTextIntoField( | ||
"Default Markers", | ||
JSON.stringify(location.slice(0, 1)), | ||
); | ||
deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.MAP)); | ||
agHelper.VerifySnapshot(locators._root, "mapWithDefaultMarker1"); | ||
deployMode.NavigateBacktoEditor(); | ||
entityExplorer.SelectEntityByName("Map1", "Widgets"); | ||
|
||
// With multiple default marker | ||
propPane.TypeTextIntoField( | ||
"Default Markers", | ||
JSON.stringify(location.slice(0, 2)), | ||
); | ||
deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.MAP)); | ||
agHelper.VerifySnapshot(locators._root, "mapWithDefaultMarker2"); | ||
deployMode.NavigateBacktoEditor(); | ||
entityExplorer.SelectEntityByName("Map1", "Widgets"); | ||
}); | ||
|
||
it("3.Verify the Map Widget with zoom level", () => { | ||
// With multiple default marker | ||
propPane.SetZoomLevel(70); | ||
deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.MAP)); | ||
agHelper.VerifySnapshot(locators._root, "mapWithDefaultZoomOut"); | ||
deployMode.NavigateBacktoEditor(); | ||
entityExplorer.SelectEntityByName("Map1", "Widgets"); | ||
|
||
// Zoom in and verify | ||
propPane.SetZoomLevel(30); | ||
deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.MAP)); | ||
agHelper.VerifySnapshot(locators._root, "mapWithDefaultZoomIn"); | ||
deployMode.NavigateBacktoEditor(); | ||
entityExplorer.SelectEntityByName("Map1", "Widgets"); | ||
}); | ||
|
||
it("4.1 Verify the Map Widget with different general settings", () => { | ||
// With visibility off | ||
propPane.TogglePropertyState("Visible", "Off"); | ||
deployMode.DeployApp(); | ||
agHelper.VerifySnapshot(locators._root, "mapWithVisibilityOff"); | ||
deployMode.NavigateBacktoEditor(); | ||
entityExplorer.SelectEntityByName("Map1", "Widgets"); | ||
|
||
// Convert visibility to JS and set the visibility "On" and verify | ||
propPane.EnterJSContext("Visible", "true"); | ||
deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.MAP)); | ||
agHelper.VerifySnapshot(locators._root, "mapWithVisibilityOnWithJS"); | ||
deployMode.NavigateBacktoEditor(); | ||
entityExplorer.SelectEntityByName("Map1", "Widgets"); | ||
|
||
// Toggle off Enable pick location and verify | ||
propPane.TogglePropertyState("Enable pick location", "Off"); | ||
deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.MAP)); | ||
agHelper.VerifySnapshot(locators._root, "mapWithPickLocationOff"); | ||
deployMode.NavigateBacktoEditor(); | ||
entityExplorer.SelectEntityByName("Map1", "Widgets"); | ||
|
||
// Toggle off Map & marker centering and verify | ||
propPane.TogglePropertyState("Map & marker centering", "Off"); | ||
deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.MAP)); | ||
agHelper.VerifySnapshot(locators._root, "mapWithMapNMarkerCenteringOff"); | ||
deployMode.NavigateBacktoEditor(); | ||
entityExplorer.SelectEntityByName("Map1", "Widgets"); | ||
}); | ||
|
||
it("4.2 Verify the Map Widget with different general settings", () => { | ||
// Toggle On Enabling clustering and verify | ||
propPane.TogglePropertyState("Enable clustering", "On"); | ||
deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.MAP)); | ||
agHelper.VerifySnapshot(locators._root, "mapWithEnablingClusteringON"); | ||
deployMode.NavigateBacktoEditor(); | ||
entityExplorer.SelectEntityByName("Map1", "Widgets"); | ||
|
||
// Convert Enabling clustering and disable it and verify | ||
propPane.EnterJSContext("Enable clustering", "false"); | ||
deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.MAP)); | ||
agHelper.VerifySnapshot(locators._root, "mapWithEnablingClusteringOff"); | ||
deployMode.NavigateBacktoEditor(); | ||
entityExplorer.SelectEntityByName("Map1", "Widgets"); | ||
|
||
// Toggle off Enable search location and verify | ||
propPane.TogglePropertyState("Enable search location", "Off"); | ||
deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.MAP)); | ||
agHelper.VerifySnapshot(locators._root, "mapWithEnableSearchLocationOff"); | ||
deployMode.NavigateBacktoEditor(); | ||
entityExplorer.SelectEntityByName("Map1", "Widgets"); | ||
}); | ||
|
||
it("5 Verify the style changes", () => { | ||
// Change border radius and verify | ||
propPane.MoveToTab("Style"); | ||
propPane.EnterJSContext("Border radius", "1.5rem"); | ||
deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.MAP)); | ||
agHelper.VerifySnapshot(locators._root, "mapWithBorderRadius"); | ||
deployMode.NavigateBacktoEditor(); | ||
entityExplorer.SelectEntityByName("Map1", "Widgets"); | ||
|
||
// Change box shadow and verify | ||
const boxShadow = | ||
"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)"; | ||
propPane.MoveToTab("Style"); | ||
propPane.EnterJSContext("Box shadow", boxShadow); | ||
deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.MAP)); | ||
agHelper.VerifySnapshot(locators._root, "mapWithBoxShadow"); | ||
deployMode.NavigateBacktoEditor(); | ||
entityExplorer.SelectEntityByName("Map1", "Widgets"); | ||
}); | ||
}); |
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
Binary file added
BIN
+261 KB
app/client/cypress/snapshots/MapWidget_Spec.ts/mapWithBorderRadius.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+262 KB
app/client/cypress/snapshots/MapWidget_Spec.ts/mapWithBoxShadow.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+191 KB
app/client/cypress/snapshots/MapWidget_Spec.ts/mapWithDefaultMarker1.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+190 KB
app/client/cypress/snapshots/MapWidget_Spec.ts/mapWithDefaultMarker2.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+247 KB
app/client/cypress/snapshots/MapWidget_Spec.ts/mapWithDefaultZoomIn.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+239 KB
app/client/cypress/snapshots/MapWidget_Spec.ts/mapWithDefaultZoomOut.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+259 KB
...ent/cypress/snapshots/MapWidget_Spec.ts/mapWithEnableSearchLocationOff.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+249 KB
...client/cypress/snapshots/MapWidget_Spec.ts/mapWithEnablingClusteringON.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+248 KB
...lient/cypress/snapshots/MapWidget_Spec.ts/mapWithEnablingClusteringOff.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+245 KB
app/client/cypress/snapshots/MapWidget_Spec.ts/mapWithInitalLocation.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+251 KB
...ient/cypress/snapshots/MapWidget_Spec.ts/mapWithMapNMarkerCenteringOff.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+251 KB
app/client/cypress/snapshots/MapWidget_Spec.ts/mapWithPickLocationOff.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10.1 KB
app/client/cypress/snapshots/MapWidget_Spec.ts/mapWithVisibilityOff.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+247 KB
app/client/cypress/snapshots/MapWidget_Spec.ts/mapWithVisibilityOnWithJS.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+194 KB
app/client/cypress/snapshots/MapWidget_Spec.ts/mapWithinItalLocationAsJS.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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