fix: path fix for botton pane cypress (#37911)

## 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: 38cb59c58431f43609c34b8e7b65e229a4922bd1
> <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 -->
This commit is contained in:
albinAppsmith 2024-12-03 15:04:54 +05:30 committed by GitHub
parent f746c53702
commit 008a94673d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 33 additions and 65 deletions

View File

@ -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;
@ -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;

View File

@ -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;
@ -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"),
);
});
});

View File

@ -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",
@ -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",
@ -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",
@ -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",
@ -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);
@ -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"),

View File

@ -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;
@ -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();
});
@ -92,7 +92,7 @@ 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: "",
@ -100,7 +100,7 @@ describe(
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: "",
@ -108,7 +108,7 @@ describe(
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: "",
@ -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: "",
@ -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();
});
@ -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");

View File

@ -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");
@ -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);

View File

@ -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",
@ -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"),
);
}
}
@ -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,
});

View File

@ -1,6 +1,6 @@
import { Response } from "./Response";
class BottomPane {
class BottomTabs {
public readonly response: Response;
constructor() {
@ -8,4 +8,4 @@ class BottomPane {
}
}
export default new BottomPane();
export default new BottomTabs();

View File

@ -1,21 +0,0 @@
class Response {
private ResponseTab = "//button[@data-testid='t--tab-RESPONSE_TAB']";
public switchToResponseTab(): void {
cy.xpath(this.ResponseTab).click({ force: true });
}
public getResponseTypeSelector(type: string): string {
return `//div[@data-testid='t--response-tab-segmented-control']//span[text()='${type}']`;
}
public switchResponseType(type: string): void {
this.switchToResponseTab();
cy.xpath(this.getResponseTypeSelector(type)).click({ force: true });
}
// TODO: Implement this method when response UI is ready
public validateRecordCount(count: number): void {}
}
export { Response };

View File

@ -1,11 +0,0 @@
import { Response } from "./Response";
class BottomPane {
public readonly response: Response;
constructor() {
this.response = new Response();
}
}
export default new BottomPane();