Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.