Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
f5f411c
CurrencyInputIssue_Spec removed wait
Aishwarya-U-R Dec 6, 2023
47a8863
Merge branch 'release' into test/dynamicwaitremove
Aishwarya-U-R Dec 7, 2023
f959ed1
GetElement improved
Aishwarya-U-R Dec 7, 2023
0471309
Merge branch 'release' into test/dynamicwaitremove
Aishwarya-U-R Dec 7, 2023
476f5de
run all
Aishwarya-U-R Dec 7, 2023
6c033a4
removed empty ReusableHelper
Aishwarya-U-R Dec 7, 2023
d6083ca
Table.ts methods fix
Aishwarya-U-R Dec 7, 2023
873cc7f
Merge branch 'release' into test/dynamicwaitremove
Aishwarya-U-R Dec 7, 2023
5e1ab82
/Widgets/Multiselect/RTL_support.ts fix
Aishwarya-U-R Dec 7, 2023
4d24400
Merge branch 'release' into test/dynamicwaitremove
Aishwarya-U-R Dec 7, 2023
ac71070
fix
Aishwarya-U-R Dec 7, 2023
4810bdd
eleWidth call fix
Aishwarya-U-R Dec 7, 2023
9f080bb
fix lint
Aishwarya-U-R Dec 7, 2023
185138c
skipping dscrudbindings
Aishwarya-U-R Dec 7, 2023
ae2c5de
fix lint
Aishwarya-U-R Dec 7, 2023
544d7d3
Merge branch 'release' into test/dynamicwaitremove
Aishwarya-U-R Dec 8, 2023
1bccc01
TableV2_Widget_API_Pagination_spec fix
Aishwarya-U-R Dec 8, 2023
57d3c28
TableV2_Widget_API_Pagination_spec remove wait
Aishwarya-U-R Dec 8, 2023
26ca80b
Debugger/Widget_property_navigation_spec.ts update
Aishwarya-U-R Dec 8, 2023
6ab788c
/Radio/Radio2_spec.ts update
Aishwarya-U-R Dec 8, 2023
d478a29
S3_1 spec fix
Aishwarya-U-R Dec 8, 2023
f4271c6
Merge branch 'release' into test/dynamicwaitremove
Aishwarya-U-R Dec 8, 2023
607863f
Merge branch 'release' into test/dynamicwaitremove
Aishwarya-U-R Dec 8, 2023
4c42c2d
Library_spec.ts reference fix
Aishwarya-U-R Dec 9, 2023
4fb8205
Merge branch 'release' into test/dynamicwaitremove
Aishwarya-U-R Dec 9, 2023
e21f3c8
skip ForkTemplateToGitConnectedApp.js for limited run
Aishwarya-U-R Dec 9, 2023
71cbb0e
remove only
Aishwarya-U-R Dec 9, 2023
f710a35
run only ApiTests/API_Unique_name_spec.js
Aishwarya-U-R Dec 9, 2023
282611e
removed wait /Widgets/Modal/Modal_spec.ts
Aishwarya-U-R Dec 9, 2023
c4a449a
run limit
Aishwarya-U-R Dec 9, 2023
8c092d0
run limit
Aishwarya-U-R Dec 9, 2023
a50d27d
run modal spec
Aishwarya-U-R Dec 9, 2023
d0615d5
run modal spec
Aishwarya-U-R Dec 9, 2023
f28f80c
run both
Aishwarya-U-R Dec 9, 2023
fbb0f5c
run all
Aishwarya-U-R Dec 9, 2023
bb303d4
Merge branch 'release' into test/dynamicwaitremove
Aishwarya-U-R Dec 9, 2023
7b07fc3
WaitUntilEleDisappear improve
Aishwarya-U-R Dec 11, 2023
a929615
Merge branch 'release' into test/dynamicwaitremove
Aishwarya-U-R Dec 11, 2023
247b49c
clean up
Aishwarya-U-R Dec 11, 2023
073b86e
remove comment
Aishwarya-U-R Dec 11, 2023
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 @@ -11,14 +11,14 @@ describe("Currency Input Issue", function () {
it("1. Import application json &should check that the widget input is not showing any error", function () {
agHelper.VisitNAssert("/applications", "getReleaseItems");
homePage.ImportApp("CurrencyInputIssueExport.json");
cy.wait("@importNewApplication").then((interception) => {
agHelper.Sleep();
cy.wait("@importNewApplication", {timeout: }).then((interception) => {
//agHelper.Sleep();
const { isPartialImport } = interception.response.body.data;
if (isPartialImport) {
cy.get(reconnectDatasourceModal.SkipToAppBtn).click({
force: true,
});
cy.wait(2000);
//cy.wait(2000);
} else {
homePage.AssertImportToast();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ describe.skip("Modal Widget test cases", function () {
entityExplorer.DragDropWidgetNVerify(draggableWidgets.MODAL, 300, 300);
EditorNavigation.SelectEntityByName("Button1", EntityType.Widget);
propPane.EnterJSContext("onClick", "{{showModal('Modal1');}}");
agHelper.Sleep();
//agHelper.Sleep();
deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.BUTTON));
agHelper.Sleep(2000); //Wait for widgets to settle
agHelper.WaitUntilEleAppear(
locators._widgetInDeployed(draggableWidgets.BUTTON),
); //Wait for widgets to settle

//agHelper.Sleep(2000);

//Verify that the Modal widget opens correctly when configured on a button click.
agHelper.ClickButton("Submit");
Expand Down
4 changes: 2 additions & 2 deletions app/client/cypress/limited-tests.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# To run only limited tests - give the spec names in below format:
cypress/e2e/Regression/ClientSide/Templates/Fork_Template_spec.js
#cypress/e2e/Regression/ClientSide/Templates/Fork_Template_spec.js


# For running all specs - uncomment below:
#cypress/e2e/**/**/*
cypress/e2e/**/**/*

#ci-test-limit uses this file to run minimum of specs. Do not run entire suite with this command.
9 changes: 0 additions & 9 deletions app/client/cypress/support/Objects/Registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import { Onboarding } from "../Pages/Onboarding";
import { AutoLayout } from "../Pages/AutoLayout";
import { DataManager } from "./DataManager";
import { AssertHelper } from "../Pages/AssertHelper";
import { ReusableHelper } from "./ReusableHelper";
import { Tabs } from "../Pages/Tabs";
import { GsheetHelper } from "../Pages/GSheetHelper";
import { CommunityTemplates } from "../Pages/CommunityTemplates";
Expand All @@ -47,14 +46,6 @@ export class ObjectsRegistry {
return ObjectsRegistry.assertHelper__;
}

private static reusableHelper__: ReusableHelper;
static get ReusableHelper(): ReusableHelper {
if (ObjectsRegistry.reusableHelper__ === undefined) {
ObjectsRegistry.reusableHelper__ = new ReusableHelper();
}
return ObjectsRegistry.reusableHelper__;
}

private static jsEditor__: JSEditor;
static get JSEditor(): JSEditor {
if (ObjectsRegistry.jsEditor__ === undefined) {
Expand Down
1 change: 0 additions & 1 deletion app/client/cypress/support/Objects/ReusableHelper.ts

This file was deleted.

64 changes: 43 additions & 21 deletions app/client/cypress/support/Pages/AggregateHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import "cypress-wait-until";
import { v4 as uuidv4 } from "uuid";
import { ObjectsRegistry } from "../Objects/Registry";
import type CodeMirror from "codemirror";
import { ReusableHelper } from "../Objects/ReusableHelper";
import type { EntityItemsType } from "./AssertHelper";
import { EntityItems } from "./AssertHelper";

Expand Down Expand Up @@ -35,7 +34,7 @@ const DEFAULT_ENTERVALUE_OPTIONS = {
inputFieldName: "",
};

export class AggregateHelper extends ReusableHelper {
export class AggregateHelper {
private locator = ObjectsRegistry.CommonLocators;
private assertHelper = ObjectsRegistry.AssertHelper;

Expand Down Expand Up @@ -214,7 +213,10 @@ export class AggregateHelper extends ReusableHelper {

public CheckForPageSaveError() {
// Wait for "saving" status to disappear
this.GetElement(this.locator._statusSaving, 30000).should("not.exist");
this.AssertElementAbsence(
this.locator._statusSaving,
Cypress.config("defaultCommandTimeout"),
);
// Check for page save error
cy.get("body").then(($ele) => {
if ($ele.find(this.locator._saveStatusError).length) {
Expand Down Expand Up @@ -271,7 +273,8 @@ export class AggregateHelper extends ReusableHelper {

public GetElement(
selector: ElementType,
timeout = Cypress.config().defaultCommandTimeout,
exists: "exist" | "not.exist" | "noVerify" = "exist",
timeout = Cypress.config("defaultCommandTimeout"),
) {
let locator;
if (typeof selector == "string") {
Expand All @@ -285,7 +288,11 @@ export class AggregateHelper extends ReusableHelper {
timeout,
});
} else locator = cy.wrap(selector);
return locator;
return exists === "noVerify"
? locator // Return the locator without verification if exists is "noVerify"
: exists === "exist"
? locator.should("have.length.at.least", 1)
: locator.should("have.length", 0);
}

public GetNAssertElementText(
Expand Down Expand Up @@ -320,7 +327,7 @@ export class AggregateHelper extends ReusableHelper {

public ValidateToastMessage(text: string, index = 0, length = 1) {
if (index != 0) {
this.GetElement(this.locator._toastMsg)
this.GetElement(this.locator._toastMsg, "noVerify")
.should("have.length.at.least", length)
.eq(index)
.should("contain.text", text);
Expand Down Expand Up @@ -492,10 +499,7 @@ export class AggregateHelper extends ReusableHelper {
}

public WaitUntilEleAppear(selector: string) {
const locator = selector.includes("//")
? cy.xpath(selector)
: cy.get(selector);
locator.waitUntil(
this.GetElement(selector).waitUntil(
($ele) =>
cy
.wrap($ele)
Expand All @@ -505,8 +509,8 @@ export class AggregateHelper extends ReusableHelper {
.should("be.gte", 1),
{
errorMsg: "Element did not appear even after 10 seconds",
timeout: 10000,
interval: 1000,
timeout: Cypress.config().pageLoadTimeout,
interval: 2000,
},
);

Expand Down Expand Up @@ -1249,6 +1253,7 @@ export class AggregateHelper extends ReusableHelper {
setTimeout(() => {
input.setValue(value);
setTimeout(() => {
input.execCommand("goLineStart");
// Move cursor to the end of the line
input.execCommand("goLineEnd");
}, 1000);
Comment thread
Aishwarya-U-R marked this conversation as resolved.
Expand Down Expand Up @@ -1455,7 +1460,7 @@ export class AggregateHelper extends ReusableHelper {

public AssertElementAbsence(selector: ElementType, timeout = 0) {
//Should not exists - cannot take indexes
return this.GetElement(selector, timeout).should("not.exist");
return this.GetElement(selector, "not.exist", timeout).should("not.exist");
Comment thread
Aishwarya-U-R marked this conversation as resolved.
}

public GetText(
Expand Down Expand Up @@ -1495,7 +1500,7 @@ export class AggregateHelper extends ReusableHelper {
index = 0,
timeout = Cypress.config("defaultCommandTimeout"),
) {
return this.GetElement(selector, timeout)
return this.GetElement(selector, "exist", timeout)
.eq(index)
.scrollIntoView()
.should(visibility == true ? "be.visible" : "not.be.visible");
Expand All @@ -1512,12 +1517,23 @@ export class AggregateHelper extends ReusableHelper {
});
}

public AssertElementExist(selector: ElementType, index = 0, timeout = 20000) {
return this.GetElement(selector, timeout).eq(index).should("exist");
public AssertElementExist(
selector: ElementType,
index = 0,
timeout = Cypress.config("defaultCommandTimeout"),
) {
return this.GetElement(selector, "exist", timeout)
.eq(index)
.should("exist");
}

public ScrollIntoView(selector: ElementType, index = 0, timeout = 20000) {
return this.GetElement(selector, timeout)
public ScrollIntoView(
selector: ElementType,
index = 0,
timeout = Cypress.config("defaultCommandTimeout"),
) {
return this.GetElement(selector, "exist", timeout)
.should("have.length.at.least", 1)
.eq(index)
.then(($element) => {
if (
Expand All @@ -1538,8 +1554,14 @@ export class AggregateHelper extends ReusableHelper {
index: number | null = null,
) {
if (index)
return this.GetElement(selector).eq(index).should("have.length", length);
else return this.GetElement(selector).should("have.length", length);
return this.GetElement(selector, "noVerify")
.eq(index)
.should("have.length", length);
else
return this.GetElement(selector, "noVerify").should(
"have.length",
length,
);
}

public FocusElement(selector: ElementType) {
Expand All @@ -1562,7 +1584,7 @@ export class AggregateHelper extends ReusableHelper {
text: string | number | RegExp,
exists: "exist" | "not.exist" = "exist",
) {
return this.GetElement(selector).contains(text).should(exists);
return this.GetElement(selector, "noVerify").contains(text).should(exists);
}

public AssertURL(url: string) {
Expand Down
4 changes: 1 addition & 3 deletions app/client/cypress/support/Pages/AssertHelper.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import "cypress-wait-until";
import { ObjectsRegistry } from "../Objects/Registry";
import { ReusableHelper } from "../Objects/ReusableHelper";

export const EntityItems = {
Page: 0,
Expand All @@ -13,7 +11,7 @@ export const EntityItems = {

export type EntityItemsType = (typeof EntityItems)[keyof typeof EntityItems];

export class AssertHelper extends ReusableHelper {
export class AssertHelper {
public _modifierKey = Cypress.platform === "darwin" ? "meta" : "ctrl";

public isMac = Cypress.platform === "darwin";
Expand Down