Skip to content

Commit

Permalink
fix: path fix for botton pane cypress (appsmithorg#37911)
Browse files Browse the repository at this point in the history
## Description
> [!TIP]  
> _Add a TL;DR when the description is longer than 500 words or
extremely technical (helps the content, marketing, and DevRel team)._
>
> _Please also include relevant motivation and context. List any
dependencies that are required for this change. Add links to Notion,
Figma or any other documents that might be relevant to the PR._


Fixes #`Issue Number`  
_or_  
Fixes `Issue URL`
> [!WARNING]  
> _If no issue exists, please create an issue first, and check with the
maintainers if the issue is valid._

## Automation

/ok-to-test tags="@tag.Sanity, @tag.Datasource"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/12135772830>
> Commit: 38cb59c
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=12135772830&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Sanity, @tag.Datasource`
> Spec:
> <hr>Tue, 03 Dec 2024 09:30:39 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
- Updated import statements for the `BottomPane` component to
`BottomTabs` across various test suites, enhancing component
organization.
  
- **Bug Fixes**
- Improved test cases validating the binding of JavaScript objects to
List widgets and ensuring accurate data reflection and pagination.

- **Chores**
- Removed outdated `Response` and `BottomPane` classes to streamline
codebase and eliminate unused functionality.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
albinAppsmith authored Dec 3, 2024
1 parent f746c53 commit 008a946
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as _ from "../../../../support/Objects/ObjectsCore";
import EditorNavigation, {
EntityType,
} from "../../../../support/Pages/EditorNavigation";
import BottomPane from "../../../../support/Pages/IDE/BottomPane";
import BottomTabs from "../../../../support/Pages/IDE/BottomTabs";

let valueToTest: any, jsName: any;

Expand All @@ -19,7 +19,7 @@ describe(
_.dataManager.dsValues[_.dataManager.defaultEnviorment].mockApiUrl,
);
_.apiPage.RunAPI();
BottomPane.response.switchResponseType("JSON");
BottomTabs.response.switchResponseType("JSON");
_.apiPage.ReadApiResponsebyKey("name");
cy.get("@apiResp").then((value) => {
valueToTest = value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
import EditorNavigation, {
EntityType,
} from "../../../../support/Pages/EditorNavigation";
import BottomPane from "../../../../support/Pages/IDE/BottomPane";
import BottomTabs from "../../../../support/Pages/IDE/BottomTabs";

let dsName: any;
let queryName: string;
Expand Down Expand Up @@ -44,10 +44,10 @@ describe(

EditorNavigation.SelectEntityByName(queryName, EntityType.Query);

BottomPane.response.switchToResponseTab();
BottomPane.response.openResponseTypeMenu();
BottomTabs.response.switchToResponseTab();
BottomTabs.response.openResponseTypeMenu();
agHelper.AssertElementVisibility(
BottomPane.response.locators.responseTypeMenuItem("TABLE"),
BottomTabs.response.locators.responseTypeMenuItem("TABLE"),
);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
import EditorNavigation, {
EntityType,
} from "../../../../support/Pages/EditorNavigation";
import BottomPane from "../../../../support/Pages/IDE/BottomPane";
import BottomTabs from "../../../../support/Pages/IDE/BottomTabs";

describe(
"Layout OnLoad Actions tests",
Expand Down Expand Up @@ -56,7 +56,7 @@ describe(
);

apiPage.RunAPI();
BottomPane.response.switchResponseType("JSON");
BottomTabs.response.switchResponseType("JSON");

apiPage.CreateAndFillApi(
"http://host.docker.internal:5001/v1/favqs/qotd",
Expand All @@ -65,7 +65,7 @@ describe(
);
apiPage.EnterHeader("dependency", "{{RandomUser.data}}"); //via Params tab
apiPage.RunAPI();
BottomPane.response.switchResponseType("JSON");
BottomTabs.response.switchResponseType("JSON");

apiPage.CreateAndFillApi(
"http://host.docker.internal:5001/v1/boredapi/activity",
Expand All @@ -74,7 +74,7 @@ describe(
);
apiPage.EnterHeader("dependency", "{{InspiringQuotes.data.data}}");
apiPage.RunAPI();
BottomPane.response.switchResponseType("JSON");
BottomTabs.response.switchResponseType("JSON");

apiPage.CreateAndFillApi(
"http://host.docker.internal:5001/v1/genderize/sampledata",
Expand All @@ -83,7 +83,7 @@ describe(
);
apiPage.EnterParams("name", "{{RandomUser.data[0].name}}"); //via Params tab
apiPage.RunAPI();
BottomPane.response.switchResponseType("JSON");
BottomTabs.response.switchResponseType("JSON");

//Adding dependency in right order matters!
EditorNavigation.SelectEntityByName("Image1", EntityType.Widget);
Expand Down Expand Up @@ -163,7 +163,7 @@ describe(
value: "{{RandomUser.data[0].name}}",
}); // verifies Bug 10055
apiPage.RunAPI();
BottomPane.response.switchResponseType("JSON");
BottomTabs.response.switchResponseType("JSON");

deployMode.DeployApp(
locators._widgetInDeployed("textwidget"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
apiPage,
} from "../../../../support/Objects/ObjectsCore";
import { Widgets } from "../../../../support/Pages/DataSources";
import BottomPane from "../../../../support/Pages/IDE/BottomPane";
import BottomTabs from "../../../../support/Pages/IDE/BottomTabs";

let datasourceName;

Expand Down Expand Up @@ -70,7 +70,7 @@ describe(
dataSources.EnterQuery(`{"find": "listingAndReviews","limit": 10}`);
agHelper.FocusElement(locators._codeMirrorTextArea);
dataSources.RunQuery();
BottomPane.response.validateRecordCount({ count: 10, operator: "lte" });
BottomTabs.response.validateRecordCount({ count: 10, operator: "lte" });
cy.deleteQueryUsingContext();
});

Expand All @@ -92,23 +92,23 @@ describe(
fieldValue: "listingAndReviews",
});
dataSources.RunQuery();
BottomPane.response.validateRecordCount({ count: 10, operator: "lte" });
BottomTabs.response.validateRecordCount({ count: 10, operator: "lte" });

agHelper.EnterValue("{beds : {$lte: 2}}", {
propFieldName: "",
directInput: false,
inputFieldName: "Query",
});
dataSources.RunQuery();
BottomPane.response.validateRecordCount({ count: 10, operator: "lte" });
BottomTabs.response.validateRecordCount({ count: 10, operator: "lte" });

agHelper.EnterValue("{number_of_reviews: -1}", {
propFieldName: "",
directInput: false,
inputFieldName: "Sort",
}); //sort descending
dataSources.RunQuery();
BottomPane.response.validateRecordCount({ count: 10, operator: "lte" });
BottomTabs.response.validateRecordCount({ count: 10, operator: "lte" });

agHelper.EnterValue("{house_rules: 1, description:1}", {
propFieldName: "",
Expand All @@ -130,7 +130,7 @@ describe(
"Response is not as expected for Find commmand with multiple conditions",
);
});
BottomPane.response.validateRecordCount({ count: 5, operator: "lte" });
BottomTabs.response.validateRecordCount({ count: 5, operator: "lte" });

agHelper.EnterValue("2", {
propFieldName: "",
Expand All @@ -144,7 +144,7 @@ describe(
"Response is not as expected for Find commmand with multiple conditions",
);
});
BottomPane.response.validateRecordCount({ count: 5, operator: "lte" });
BottomTabs.response.validateRecordCount({ count: 5, operator: "lte" });
cy.deleteQueryUsingContext();
});

Expand Down Expand Up @@ -432,7 +432,7 @@ describe(
);

dataSources.RunQuery();
BottomPane.response.validateRecordCount({ count: 10, operator: "lte" });
BottomTabs.response.validateRecordCount({ count: 10, operator: "lte" });

dataSources.AssertTableInVirtuosoList(datasourceName, "NonAsciiTest");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference types="Cypress" />

import BottomPane from "../../../../support/Pages/IDE/BottomPane";
import BottomTabs from "../../../../support/Pages/IDE/BottomTabs";

const queryLocators = require("../../../../locators/QueryEditor.json");
const generatePage = require("../../../../locators/GeneratePage.json");
Expand Down Expand Up @@ -195,7 +195,7 @@ describe(
cy.typeValueNValidate(fileName, formControls.s3ListPrefix);
dataSources.RunQuery({ toValidateResponse: false });

BottomPane.response.selectResponseResponseTypeFromMenu("JSON");
BottomTabs.response.selectResponseResponseTypeFromMenu("JSON");

cy.wait("@postExecute").then(({ response }) => {
expect(response.body.data.isExecutionSuccess).to.eq(true);
Expand Down
18 changes: 9 additions & 9 deletions app/client/cypress/support/Pages/DataSources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import PageList from "./PageList";
import { anvilLocators } from "./Anvil/Locators";
import { PluginActionForm } from "./PluginActionForm";
import ApiEditor from "../../locators/ApiEditor";
import BottomPane from "./IDE/BottomPane";
import BottomTabs from "./IDE/BottomTabs";

export const DataSourceKVP = {
Postgres: "PostgreSQL",
Expand Down Expand Up @@ -1150,13 +1150,13 @@ export class DataSources {
this.RunQuery();
if (tableCheck) {
this.agHelper.AssertElementVisibility(
BottomPane.response.getResponseTypeSelector("TABLE"),
BottomTabs.response.getResponseTypeSelector("TABLE"),
);
this.agHelper.AssertElementVisibility(
BottomPane.response.getResponseTypeSelector("JSON"),
BottomTabs.response.getResponseTypeSelector("JSON"),
);
this.agHelper.AssertElementVisibility(
BottomPane.response.getResponseTypeSelector("RAW"),
BottomTabs.response.getResponseTypeSelector("RAW"),
);
}
}
Expand All @@ -1168,23 +1168,23 @@ export class DataSources {
}: {
count?: number;
operator?: Parameters<
typeof BottomPane.response.validateRecordCount
typeof BottomTabs.response.validateRecordCount
>[0]["operator"];
responseTypes?: ("TABLE" | "JSON" | "RAW")[];
} = {}) {
this.RunQuery();

BottomPane.response.openResponseTypeMenu();
BottomTabs.response.openResponseTypeMenu();

responseTypes.forEach((responseType) => {
this.agHelper.AssertElementVisibility(
BottomPane.response.locators.responseTypeMenuItem(responseType),
BottomTabs.response.locators.responseTypeMenuItem(responseType),
);
});

BottomPane.response.closeResponseTypeMenu();
BottomTabs.response.closeResponseTypeMenu();

BottomPane.response.validateRecordCount({
BottomTabs.response.validateRecordCount({
count,
operator,
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Response } from "./Response";

class BottomPane {
class BottomTabs {
public readonly response: Response;

constructor() {
this.response = new Response();
}
}

export default new BottomPane();
export default new BottomTabs();
21 changes: 0 additions & 21 deletions app/client/cypress/support/Pages/IDE/Bottompane/Response.ts

This file was deleted.

11 changes: 0 additions & 11 deletions app/client/cypress/support/Pages/IDE/Bottompane/index.ts

This file was deleted.

0 comments on commit 008a946

Please sign in to comment.