test: Cypress | Flaky fixes (#25691)
## Description
- This PR fixes below specs:
- BugTests/DatasourceSchema_spec.ts
- /Dropdown/Dropdown_onOptionChange_spec.js
- Improved homePage.CreateNewWorkspace()
#### Type of change
- Script fix (non-breaking change which fixes an issue)
## Testing
>
#### How Has This Been Tested?
- [X] Cypress
## Checklist:
#### QA activity:
- [X] Added `Test Plan Approved` label after Cypress tests were reviewed
This commit is contained in:
parent
b17c4ab083
commit
722f84b26b
|
|
@ -10,10 +10,9 @@ import {
|
||||||
|
|
||||||
describe("Content Management System App", function () {
|
describe("Content Management System App", function () {
|
||||||
before(() => {
|
before(() => {
|
||||||
homePage.NavigateToHome();
|
|
||||||
agHelper.GenerateUUID();
|
agHelper.GenerateUUID();
|
||||||
cy.get("@guid").then((uid) => {
|
cy.get("@guid").then((uid) => {
|
||||||
homePage.CreateNewWorkspace("EchoApiCMS" + uid);
|
homePage.CreateNewWorkspace("EchoApiCMS" + uid, true);
|
||||||
homePage.CreateAppInWorkspace("EchoApiCMS" + uid, "EchoApiCMSApp");
|
homePage.CreateAppInWorkspace("EchoApiCMS" + uid, "EchoApiCMSApp");
|
||||||
agHelper.AddDsl("CMSdsl");
|
agHelper.AddDsl("CMSdsl");
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -12,10 +12,9 @@ describe("Shopping cart App", function () {
|
||||||
let datasourceName: string, repoName: any;
|
let datasourceName: string, repoName: any;
|
||||||
|
|
||||||
before(() => {
|
before(() => {
|
||||||
homePage.NavigateToHome();
|
|
||||||
agHelper.GenerateUUID();
|
agHelper.GenerateUUID();
|
||||||
cy.get("@guid").then((uid) => {
|
cy.get("@guid").then((uid) => {
|
||||||
homePage.CreateNewWorkspace("MongoDBShop" + uid);
|
homePage.CreateNewWorkspace("MongoDBShop" + uid, true);
|
||||||
homePage.CreateAppInWorkspace("MongoDBShop" + uid, "MongoDBShopApp");
|
homePage.CreateAppInWorkspace("MongoDBShop" + uid, "MongoDBShopApp");
|
||||||
agHelper.AddDsl("mongoAppdsl");
|
agHelper.AddDsl("mongoAppdsl");
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,26 @@
|
||||||
import { featureFlagIntercept } from "../../../../support/Objects/FeatureFlags";
|
import { featureFlagIntercept } from "../../../../support/Objects/FeatureFlags";
|
||||||
import { ObjectsRegistry } from "../../../../support/Objects/Registry";
|
import {
|
||||||
|
agHelper,
|
||||||
const agHelper = ObjectsRegistry.AggregateHelper,
|
entityItems,
|
||||||
dataSources = ObjectsRegistry.DataSources,
|
dataSources,
|
||||||
ee = ObjectsRegistry.EntityExplorer;
|
entityExplorer,
|
||||||
|
homePage,
|
||||||
|
} from "../../../../support/Objects/ObjectsCore";
|
||||||
|
|
||||||
let guid;
|
let guid;
|
||||||
let dataSourceName: string;
|
let dataSourceName: string;
|
||||||
describe("Datasource form related tests", function () {
|
describe("Datasource form related tests", function () {
|
||||||
|
before(() => {
|
||||||
|
homePage.CreateNewWorkspace("FetchSchemaOnce", true);
|
||||||
|
homePage.CreateAppInWorkspace("FetchSchemaOnce");
|
||||||
|
});
|
||||||
|
|
||||||
it("1. Bug - 17238 Verify datasource structure refresh on save - invalid datasource", () => {
|
it("1. Bug - 17238 Verify datasource structure refresh on save - invalid datasource", () => {
|
||||||
agHelper.GenerateUUID();
|
agHelper.GenerateUUID();
|
||||||
cy.get("@guid").then((uid) => {
|
cy.get("@guid").then((uid) => {
|
||||||
guid = uid;
|
guid = uid;
|
||||||
dataSourceName = "Postgres " + guid;
|
dataSourceName = "Postgres " + guid;
|
||||||
ee.ExpandCollapseEntity("Datasources");
|
entityExplorer.ExpandCollapseEntity("Datasources");
|
||||||
dataSources.NavigateToDSCreateNew();
|
dataSources.NavigateToDSCreateNew();
|
||||||
dataSources.CreatePlugIn("PostgreSQL");
|
dataSources.CreatePlugIn("PostgreSQL");
|
||||||
agHelper.RenameWithInPane(dataSourceName, false);
|
agHelper.RenameWithInPane(dataSourceName, false);
|
||||||
|
|
@ -36,14 +43,16 @@ describe("Datasource form related tests", function () {
|
||||||
|
|
||||||
it("2. Verify if schema was fetched once #18448", () => {
|
it("2. Verify if schema was fetched once #18448", () => {
|
||||||
agHelper.RefreshPage();
|
agHelper.RefreshPage();
|
||||||
ee.ExpandCollapseEntity("Datasources");
|
entityExplorer.ExpandCollapseEntity("Datasources");
|
||||||
ee.ExpandCollapseEntity(dataSourceName, false);
|
entityExplorer.ExpandCollapseEntity(dataSourceName, false);
|
||||||
cy.intercept("GET", dataSources._getStructureReq).as("getDSStructure");
|
entityExplorer.ExpandCollapseEntity("Datasources");
|
||||||
ee.ExpandCollapseEntity("Datasources");
|
entityExplorer.ExpandCollapseEntity(dataSourceName);
|
||||||
ee.ExpandCollapseEntity(dataSourceName);
|
|
||||||
agHelper.Sleep(1500);
|
agHelper.Sleep(1500);
|
||||||
agHelper.VerifyCallCount(`@getDatasourceStructure`, 1);
|
agHelper.VerifyCallCount(`@getDatasourceStructure`, 1);
|
||||||
dataSources.DeleteQuery("Query1");
|
agHelper.ActionContextMenuWithInPane({
|
||||||
|
action: "Delete",
|
||||||
|
entityType: entityItems.Query,
|
||||||
|
});
|
||||||
dataSources.DeleteDatasouceFromWinthinDS(dataSourceName);
|
dataSources.DeleteDatasouceFromWinthinDS(dataSourceName);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -61,7 +70,7 @@ describe("Datasource form related tests", function () {
|
||||||
dataSources.CreateMockDB("Users");
|
dataSources.CreateMockDB("Users");
|
||||||
dataSources.CreateQueryAfterDSSaved();
|
dataSources.CreateQueryAfterDSSaved();
|
||||||
dataSources.VerifyTableSchemaOnQueryEditor("public.users");
|
dataSources.VerifyTableSchemaOnQueryEditor("public.users");
|
||||||
ee.ExpandCollapseEntity("public.users");
|
entityExplorer.ExpandCollapseEntity("public.users");
|
||||||
dataSources.VerifyColumnSchemaOnQueryEditor("id");
|
dataSources.VerifyColumnSchemaOnQueryEditor("id");
|
||||||
dataSources.FilterAndVerifyDatasourceSchemaBySearch(
|
dataSources.FilterAndVerifyDatasourceSchemaBySearch(
|
||||||
"gender",
|
"gender",
|
||||||
|
|
|
||||||
|
|
@ -9,10 +9,9 @@ let tempBranch3: any;
|
||||||
|
|
||||||
describe("Git Bugs", function () {
|
describe("Git Bugs", function () {
|
||||||
before(() => {
|
before(() => {
|
||||||
_.homePage.NavigateToHome();
|
|
||||||
_.agHelper.GenerateUUID();
|
_.agHelper.GenerateUUID();
|
||||||
cy.get("@guid").then((uid) => {
|
cy.get("@guid").then((uid) => {
|
||||||
_.homePage.CreateNewWorkspace("GitBugs" + uid);
|
_.homePage.CreateNewWorkspace("GitBugs" + uid, true);
|
||||||
_.homePage.CreateAppInWorkspace("GitBugs" + uid);
|
_.homePage.CreateAppInWorkspace("GitBugs" + uid);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,7 @@ let ee = ObjectsRegistry.EntityExplorer,
|
||||||
|
|
||||||
describe("Entity explorer API pane related testcases", function () {
|
describe("Entity explorer API pane related testcases", function () {
|
||||||
it("1. Empty Message validation for Widgets/API/Queries", function () {
|
it("1. Empty Message validation for Widgets/API/Queries", function () {
|
||||||
homePage.NavigateToHome();
|
homePage.CreateNewWorkspace("EmptyMsgCheck", true);
|
||||||
homePage.CreateNewWorkspace("EmptyMsgCheck");
|
|
||||||
homePage.CreateAppInWorkspace("EmptyMsgCheck");
|
homePage.CreateAppInWorkspace("EmptyMsgCheck");
|
||||||
ee.ExpandCollapseEntity("Widgets");
|
ee.ExpandCollapseEntity("Widgets");
|
||||||
agHelper.AssertElementVisible(
|
agHelper.AssertElementVisible(
|
||||||
|
|
|
||||||
|
|
@ -32,11 +32,10 @@ describe("Fork application with multiple datasources", function () {
|
||||||
it("1. Bug Id: 24708 - fork and test the forked application", function () {
|
it("1. Bug Id: 24708 - fork and test the forked application", function () {
|
||||||
// Create a new workspace and fork application
|
// Create a new workspace and fork application
|
||||||
const appname: string = localStorage.getItem("AppName") || "randomApp";
|
const appname: string = localStorage.getItem("AppName") || "randomApp";
|
||||||
homePage.NavigateToHome();
|
|
||||||
agHelper.GenerateUUID();
|
agHelper.GenerateUUID();
|
||||||
cy.get("@guid").then((uid) => {
|
cy.get("@guid").then((uid) => {
|
||||||
workspaceId = "forkApp" + uid;
|
workspaceId = "forkApp" + uid;
|
||||||
homePage.CreateNewWorkspace(workspaceId);
|
homePage.CreateNewWorkspace(workspaceId, true);
|
||||||
agHelper.PressEscape();
|
agHelper.PressEscape();
|
||||||
cy.log("------------------" + workspaceId);
|
cy.log("------------------" + workspaceId);
|
||||||
homePage.ForkApplication(appname, workspaceId);
|
homePage.ForkApplication(appname, workspaceId);
|
||||||
|
|
|
||||||
|
|
@ -8,13 +8,12 @@ let currentWorkspace: string, currentAppName: string, forkWorkspaceName: string;
|
||||||
|
|
||||||
describe("Fork application across workspaces", function () {
|
describe("Fork application across workspaces", function () {
|
||||||
it("Bug 24702: Signed user should be able to fork a public forkable app & Check if the forked application has the same dsl as the original", function () {
|
it("Bug 24702: Signed user should be able to fork a public forkable app & Check if the forked application has the same dsl as the original", function () {
|
||||||
homePage.NavigateToHome();
|
|
||||||
// Create new workspace to create App in
|
// Create new workspace to create App in
|
||||||
agHelper.GenerateUUID();
|
agHelper.GenerateUUID();
|
||||||
cy.get("@guid").then((uid) => {
|
cy.get("@guid").then((uid) => {
|
||||||
currentWorkspace = "CurrentWorkspace " + uid;
|
currentWorkspace = "CurrentWorkspace " + uid;
|
||||||
currentAppName = "MongoQueryApp " + uid;
|
currentAppName = "MongoQueryApp " + uid;
|
||||||
homePage.CreateNewWorkspace(currentWorkspace);
|
homePage.CreateNewWorkspace(currentWorkspace, true);
|
||||||
homePage.CreateAppInWorkspace(currentWorkspace, currentAppName);
|
homePage.CreateAppInWorkspace(currentWorkspace, currentAppName);
|
||||||
|
|
||||||
// Create datasource and query
|
// Create datasource and query
|
||||||
|
|
@ -23,12 +22,11 @@ describe("Fork application across workspaces", function () {
|
||||||
|
|
||||||
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
||||||
cy.wait(2000);
|
cy.wait(2000);
|
||||||
homePage.NavigateToHome();
|
|
||||||
|
|
||||||
agHelper.GenerateUUID();
|
agHelper.GenerateUUID();
|
||||||
cy.get("@guid").then((uid) => {
|
cy.get("@guid").then((uid) => {
|
||||||
forkWorkspaceName = "ForkApplication" + uid;
|
forkWorkspaceName = "ForkApplication" + uid;
|
||||||
homePage.CreateNewWorkspace(forkWorkspaceName);
|
homePage.CreateNewWorkspace(forkWorkspaceName, true);
|
||||||
homePage.FilterApplication(currentAppName);
|
homePage.FilterApplication(currentAppName);
|
||||||
|
|
||||||
agHelper.Sleep(500);
|
agHelper.Sleep(500);
|
||||||
|
|
|
||||||
|
|
@ -19,11 +19,10 @@ describe("Import and validate older app (app created in older versions of Appsmi
|
||||||
keyId: any,
|
keyId: any,
|
||||||
workspaceName: any;
|
workspaceName: any;
|
||||||
before(() => {
|
before(() => {
|
||||||
homePage.NavigateToHome();
|
|
||||||
agHelper.GenerateUUID();
|
agHelper.GenerateUUID();
|
||||||
cy.get("@guid").then((uid) => {
|
cy.get("@guid").then((uid) => {
|
||||||
workspaceName = "GitImport_" + uid;
|
workspaceName = "GitImport_" + uid;
|
||||||
homePage.CreateNewWorkspace(workspaceName);
|
homePage.CreateNewWorkspace(workspaceName, true);
|
||||||
});
|
});
|
||||||
//Import App From Gitea
|
//Import App From Gitea
|
||||||
gitSync.ImportAppFromGit(workspaceName, appRepoName, true);
|
gitSync.ImportAppFromGit(workspaceName, appRepoName, true);
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ describe("Dropdown Widget", function () {
|
||||||
entityExplorer.ExpandCollapseEntity("Container3", "Widgets");
|
entityExplorer.ExpandCollapseEntity("Container3", "Widgets");
|
||||||
entityExplorer.SelectEntityByName("Dropdown1", "Widgets");
|
entityExplorer.SelectEntityByName("Dropdown1", "Widgets");
|
||||||
propPane.UpdatePropertyFieldValue(
|
propPane.UpdatePropertyFieldValue(
|
||||||
"Options",
|
"Source Data",
|
||||||
JSON.stringify(this.dataSet.input),
|
JSON.stringify(this.dataSet.input),
|
||||||
);
|
);
|
||||||
//creating the Modal and verify Modal name //to fix below
|
//creating the Modal and verify Modal name //to fix below
|
||||||
|
|
|
||||||
|
|
@ -3,3 +3,5 @@
|
||||||
|
|
||||||
# To run only limited tests - give the spec names in below format:
|
# To run only limited tests - give the spec names in below format:
|
||||||
cypress/e2e/Regression/ClientSide/Widgets/Dropdown/Dropdown_onOptionChange_spec.js
|
cypress/e2e/Regression/ClientSide/Widgets/Dropdown/Dropdown_onOptionChange_spec.js
|
||||||
|
cypress/e2e/Regression/ClientSide/Widgets/Button/Button_onClickAction_spec.js
|
||||||
|
cypress/e2e/Regression/ClientSide/BugTests/DatasourceSchema_spec.ts
|
||||||
|
|
|
||||||
|
|
@ -180,7 +180,6 @@ export class DataSources {
|
||||||
_gsScopeOptions = ".ads-v2-select__dropdown .rc-select-item-option";
|
_gsScopeOptions = ".ads-v2-select__dropdown .rc-select-item-option";
|
||||||
private _queryTimeout =
|
private _queryTimeout =
|
||||||
"//input[@name='actionConfiguration.timeoutInMillisecond']";
|
"//input[@name='actionConfiguration.timeoutInMillisecond']";
|
||||||
_getStructureReq = "/api/v1/datasources/*/structure?ignoreCache=true";
|
|
||||||
_editDatasourceFromActiveTab = (dsName: string) =>
|
_editDatasourceFromActiveTab = (dsName: string) =>
|
||||||
".t--datasource-name:contains('" + dsName + "')";
|
".t--datasource-name:contains('" + dsName + "')";
|
||||||
private _suggestedWidget = (widgetType: string) =>
|
private _suggestedWidget = (widgetType: string) =>
|
||||||
|
|
@ -1265,7 +1264,6 @@ export class DataSources {
|
||||||
schema: string,
|
schema: string,
|
||||||
isUpdate = false,
|
isUpdate = false,
|
||||||
) {
|
) {
|
||||||
cy.intercept("GET", this._getStructureReq).as("getDSStructure");
|
|
||||||
if (isUpdate) {
|
if (isUpdate) {
|
||||||
this.UpdateDatasource();
|
this.UpdateDatasource();
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1275,7 +1273,7 @@ export class DataSources {
|
||||||
entityNameinLeftSidebar: dataSourceName,
|
entityNameinLeftSidebar: dataSourceName,
|
||||||
action: "Refresh",
|
action: "Refresh",
|
||||||
});
|
});
|
||||||
cy.wait("@getDSStructure").then(() => {
|
cy.wait("@getDatasourceStructure").then(() => {
|
||||||
cy.get(".bp3-collapse-body").contains(schema);
|
cy.get(".bp3-collapse-body").contains(schema);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,11 @@ export class HomePage {
|
||||||
this.agHelper.GetNClick(this._homeTab);
|
this.agHelper.GetNClick(this._homeTab);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CreateNewWorkspace(workspaceNewName: string) {
|
public CreateNewWorkspace(
|
||||||
|
workspaceNewName: string,
|
||||||
|
toNavigateToHome = false,
|
||||||
|
) {
|
||||||
|
if (toNavigateToHome) this.NavigateToHome();
|
||||||
let oldName = "";
|
let oldName = "";
|
||||||
this.agHelper.GetNClick(this._newWorkSpaceLink);
|
this.agHelper.GetNClick(this._newWorkSpaceLink);
|
||||||
this.assertHelper.AssertNetworkStatus("createWorkspace", 201);
|
this.assertHelper.AssertNetworkStatus("createWorkspace", 201);
|
||||||
|
|
@ -255,6 +259,7 @@ export class HomePage {
|
||||||
//Maps to CreateAppForWorkspace in command.js
|
//Maps to CreateAppForWorkspace in command.js
|
||||||
public CreateAppInWorkspace(workspaceName: string, appname = "") {
|
public CreateAppInWorkspace(workspaceName: string, appname = "") {
|
||||||
cy.xpath(this._existingWorkspaceCreateNewApp(workspaceName))
|
cy.xpath(this._existingWorkspaceCreateNewApp(workspaceName))
|
||||||
|
.last()
|
||||||
.scrollIntoView()
|
.scrollIntoView()
|
||||||
.should("be.visible")
|
.should("be.visible")
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
|
|
|
||||||
|
|
@ -864,7 +864,8 @@ Cypress.Commands.add(
|
||||||
(forSuccess, forFailure, actionType, actionValue, idx = 0) => {
|
(forSuccess, forFailure, actionType, actionValue, idx = 0) => {
|
||||||
propPane.SelectActionByTitleAndValue(actionType, actionValue);
|
propPane.SelectActionByTitleAndValue(actionType, actionValue);
|
||||||
|
|
||||||
agHelper.GetNClick(propPane._actionCallbacks);
|
agHelper.Sleep();
|
||||||
|
agHelper.GetNClick(propPane._actionCallbacks, 0, true);
|
||||||
|
|
||||||
// add a success callback
|
// add a success callback
|
||||||
cy.get(propPane._actionAddCallback("success")).click().wait(500);
|
cy.get(propPane._actionAddCallback("success")).click().wait(500);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user