Skip to content
Open
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 @@ -82,7 +82,7 @@ describe("Content Management System App", function () {
.find("textarea")
.type("Task completed", { force: true });
cy.get(appPage.confirmButton).closest("div").click({ force: true });
cy.get(appPage.closeButton).closest("div").click({ force: true });
cy.get(appPage.closeButton).eq(0).closest("div").click({ force: true });
cy.xpath(appPage.pagebutton).click({ force: true });
//cy.xpath(appPage.datasourcesbutton).click({ force: true });
cy.CheckAndUnfoldEntityItem("Queries/JS");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ describe("Check debugger logs state when there are onPageLoad actions", function
before(() => {
cy.addDsl(dsl);
});

it("1. Check debugger logs state when there are onPageLoad actions", function () {
cy.openPropertyPane("tablewidget");
cy.testJsontext("tabledata", "{{TestApi.data.users}}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ const simpleListWithLargeDataDSL = require("../../../../../fixtures/Listv2/simpl
const ListV2WithNullPrimaryKeyDSL = require("../../../../../fixtures/Listv2/ListV2WithNullPrimaryKey.json");
const widgetsPage = require("../../../../../locators/Widgets.json");
const commonlocators = require("../../../../../locators/commonlocators.json");
import { ObjectsRegistry } from "../../../../../support/Objects/Registry";
import * as _ from "../../../../../support/Objects/ObjectsCore";

const propertyControl = ".t--property-control";
const agHelper = ObjectsRegistry.AggregateHelper;

const widgetSelector = (name) => `[data-widgetname-cy="${name}"]`;

Expand Down Expand Up @@ -43,11 +42,11 @@ const data = [

describe("List v2 - Data Identifier property", () => {
beforeEach(() => {
agHelper.RestoreLocalStorageCache();
_.agHelper.RestoreLocalStorageCache();
});

afterEach(() => {
agHelper.SaveLocalStorageCache();
_.agHelper.SaveLocalStorageCache();
});

it("1. is present in the property pane", () => {
Expand Down Expand Up @@ -176,21 +175,20 @@ describe("List v2 - Data Identifier property", () => {

it("8. pagination should work for non unique data identifier", () => {
cy.get(".rc-pagination").find("a").contains("2").click({ force: true });

cy.get(widgetsPage.containerWidget).should("have.length", 2);
});

it("9. Widgets get displayed when PrimaryKey doesn't exist - SSP", () => {
cy.addDsl(ListV2WithNullPrimaryKeyDSL);
cy.createAndFillApi(
_.apiPage.CreateAndFillApi(
"https://api.punkapi.com/v2/beers?page={{List1.pageNo}}&per_page={{List1.pageSize}}",
"",
);
cy.RunAPI();
cy.SearchEntityandOpen("List1");
cy.openPropertyPaneByWidgetName("Text2", "textwidget");

cy.testJsontext("text", "{{currentIndex}}");
_.apiPage.RunAPI();
_.entityExplorer.ExpandCollapseEntity("Widgets");
_.entityExplorer.ExpandCollapseEntity("List1");
_.entityExplorer.ExpandCollapseEntity("Container1");
_.entityExplorer.SelectEntityByName("Text2");
_.propPane.UpdatePropertyFieldValue("Text", "{{currentIndex}}");

cy.get(`${widgetSelector("Text2")} ${commonlocators.bodyTextStyle}`)
.first()
Expand All @@ -207,9 +205,11 @@ describe("List v2 - Data Identifier property", () => {
});

it("10. Widgets get displayed when PrimaryKey doesn't exist - Client-Side Pagination", () => {
cy.openPropertyPaneByWidgetName("Text4", "textwidget");

cy.testJsontext("text", "{{currentIndex}}");
_.entityExplorer.ExpandCollapseEntity("Widgets");
_.entityExplorer.ExpandCollapseEntity("List2");
_.entityExplorer.ExpandCollapseEntity("Container2");
_.entityExplorer.SelectEntityByName("Text4");
_.propPane.UpdatePropertyFieldValue("Text", "{{currentIndex}}");

cy.get(`${widgetSelector("Text4")} ${commonlocators.bodyTextStyle}`)
.first()
Expand All @@ -233,14 +233,10 @@ describe("List v2 - Data Identifier property", () => {
});

it("11. Non unique data identifier should throw error- (data type issue)", () => {
cy.openPropertyPaneByWidgetName("List2", "listwidgetv2");

testJsontextClear("items");

cy.testJsontext("items", JSON.stringify(data));

_.entityExplorer.SelectEntityByName("List2");
_.propPane.UpdatePropertyFieldValue("Items", JSON.stringify(data));
_.propPane.UpdatePropertyFieldValue("Data Identifier", "");
// clicking on the data identifier dropdown
testJsontextClear("dataidentifier");
cy.get(`${propertyControl}-dataidentifier`)
.find(".t--js-toggle")
.click({ force: true });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ describe("Validate Mongo Query Pane Validations", () => {
dataSources.CreateDataSource("Mongo", false);

agHelper.ValidateNetworkStatus("@getDatasourceStructure"); //Making sure table dropdown is populated
agHelper.Sleep();
agHelper.GetNClick(dataSources._selectTableDropdown);
agHelper.GetNClickByContains(dataSources._dropdownOption, "friends");

Expand Down
5 changes: 4 additions & 1 deletion app/client/cypress/support/ApiCommands.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ const commonlocators = require("../locators/commonlocators.json");
const apiwidget = require("../locators/apiWidgetslocator.json");
const explorer = require("../locators/explorerlocators.json");

import { ObjectsRegistry } from "../support/Objects/Registry";
let agHelper = ObjectsRegistry.AggregateHelper;

export const initLocalstorage = () => {
cy.window().then((window) => {
window.localStorage.setItem("ShowCommentsButtonToolTip", "");
Expand Down Expand Up @@ -59,7 +62,7 @@ Cypress.Commands.add("CreateAPI", (apiname) => {
cy.wait("@createNewApi");
cy.get(apiwidget.resourceUrl).should("be.visible");
if (apiname) {
cy.renameWithInPane(apiname);
agHelper.RenameWithInPane(apiname);
cy.WaitAutoSave();
}
// Added because api name edit takes some time to
Expand Down
2 changes: 2 additions & 0 deletions app/client/cypress/support/Objects/CommonLocators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ export class CommonLocators {
_loading = "#loading";
_spinner = ".bp3-spinner";
_runBtnSpinner = ".cs-spinner";
_querytargetNameEdit = "div.t--action-name-edit-field";
_dstargetNameEdit = "div.t--edit-datasource-name";
_queryName = ".t--action-name-edit-field span";
_queryNameTxt = ".t--action-name-edit-field input";
_emptyCanvasCta = "[data-cy='canvas-ctas']";
Expand Down
12 changes: 11 additions & 1 deletion app/client/cypress/support/Pages/AggregateHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,19 @@ export class AggregateHelper {
}

public RenameWithInPane(renameVal: string, IsQuery = true) {
const target = IsQuery
? this.locator._querytargetNameEdit
: this.locator._dstargetNameEdit;
const name = IsQuery ? this.locator._queryName : this.locator._dsName;
const text = IsQuery ? this.locator._queryNameTxt : this.locator._dsNameTxt;
this.GetNClick(name, 0, true);
this.GetElement(target)
.invoke("attr", "class")
.then((classes: any) => {
if (!classes.includes("bp3-editable-text-editing")) {
this.GetNClick(name, 0, true);
}
});

cy.get(text)
.clear({ force: true })
.type(renameVal, { force: true, delay: 0 })
Expand Down
3 changes: 2 additions & 1 deletion app/client/cypress/support/Pages/HomePage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ export class HomePage {
"//span[text()='Users will have access to all applications in this workspace']",
);
cy.xpath(this._email).click({ force: true }).type(email);
cy.xpath(this._selectRole).first().click({ force: true });
this.agHelper.PressEnter();
cy.xpath(this._selectRole).first().click();
this.agHelper.Sleep(500);
cy.xpath(this._userRole(role)).click({ force: true });
this.agHelper.ClickButton("Invite");
Expand Down
2 changes: 1 addition & 1 deletion app/client/cypress_ci.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"viewportHeight": 1100,
"viewportWidth": 1400,
"retries": {
"runMode": 1,
"runMode": 0,
"openMode": 0
}
}
10 changes: 5 additions & 5 deletions app/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
"rc-select": "^14.1.9",
"rc-tree-select": "^5.4.0",
"re-reselect": "^3.4.0",
"react": "^17.0.2",
"react": "^18.2.0",
"react-append-to-body": "^2.0.26",
"react-beautiful-dnd": "^12.2.0",
"react-custom-scrollbars": "^4.2.1",
Expand All @@ -138,7 +138,7 @@
"react-dnd-html5-backend": "^9.3.4",
"react-dnd-touch-backend": "^9.4.0",
"react-documents": "^1.0.4",
"react-dom": "^17.0.2",
"react-dom": "^18.2.0",
"react-full-screen": "^1.1.0",
"react-fusioncharts": "^3.1.2",
"react-google-recaptcha": "^2.1.0",
Expand Down Expand Up @@ -233,7 +233,7 @@
"@types/react": "^17.0.2",
"@types/react-beautiful-dnd": "^11.0.4",
"@types/react-custom-scrollbars": "^4.0.7",
"@types/react-dom": "^17.0.2",
"@types/react-dom": "^18.0.11",
"@types/react-google-recaptcha": "^2.1.1",
"@types/react-helmet": "^5.0.14",
"@types/react-instantsearch-dom": "^6.3.0",
Expand All @@ -244,7 +244,7 @@
"@types/react-syntax-highlighter": "^13.5.2",
"@types/react-table": "^7.0.13",
"@types/react-tabs": "^2.3.1",
"@types/react-test-renderer": "^17.0.1",
"@types/react-test-renderer": "^18.0.0",
"@types/react-window": "^1.8.2",
"@types/redux-form": "^8.1.9",
"@types/redux-mock-store": "^1.0.2",
Expand Down Expand Up @@ -300,7 +300,7 @@
"prop-types": "^15.8.1",
"raw-loader": "^4.0.2",
"react-is": "^16.12.0",
"react-test-renderer": "^16.11.0",
"react-test-renderer": "^18.2.0",
"redux-devtools": "^3.5.0",
"redux-devtools-extension": "^2.13.8",
"redux-mock-store": "^1.5.4",
Expand Down
2 changes: 1 addition & 1 deletion app/client/packages/storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@storybook/react": "^6.5.16",
"@storybook/testing-library": "^0.0.13",
"@types/react": "^17.0.2",
"@types/react-dom": "^17.0.2",
"@types/react-dom": "^18.0.11",
"autoprefixer": "^9.0.0",
"babel-loader": "^8.3.0",
"postcss": "^8",
Expand Down
6 changes: 4 additions & 2 deletions app/client/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import "./wdyr";
import ReactDOM from "react-dom";
import { createRoot } from "react-dom/client";
import { Provider } from "react-redux";
import "./index.css";
import { ThemeProvider } from "styled-components";
Expand Down Expand Up @@ -67,7 +67,9 @@ const mapStateToProps = (state: AppState) => ({

const ThemedAppWithProps = connect(mapStateToProps)(ThemedApp);

ReactDOM.render(<App />, document.getElementById("root"));
const container = document.getElementById("root") as HTMLElement;
const root = createRoot(container);
root.render(<App />);

// expose store when run in Cypress
if ((window as any).Cypress) {
Expand Down
Loading