Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Cypress | Replace static waits from Helpers + Flaky fixes #29856

Merged
merged 36 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
f4129a9
removed wait from Theme & Api helprs
Aishwarya-U-R Dec 26, 2023
a2c76cc
run all
Aishwarya-U-R Dec 26, 2023
e36ef53
Merge branch 'release' into test/dynamicwaitremove
Aishwarya-U-R Dec 26, 2023
0eed853
added check inside block
Aishwarya-U-R Dec 26, 2023
e512d74
Merge branch 'release' into test/dynamicwaitremove
Aishwarya-U-R Dec 26, 2023
c3480db
removed comment
Aishwarya-U-R Dec 26, 2023
1eb4ce7
GitSyncedApps_spec fix
Aishwarya-U-R Dec 26, 2023
b004e64
Merge branch 'release' into test/dynamicwaitremove
Aishwarya-U-R Dec 26, 2023
f0ff9de
CreateNewAppInNewWorkspace remove static wait
Aishwarya-U-R Dec 26, 2023
2264ded
Merge branch 'release' into test/dynamicwaitremove
Aishwarya-U-R Dec 26, 2023
c6565da
Merge branch 'release' into test/dynamicwaitremove
Aishwarya-U-R Dec 27, 2023
c0ec902
run only
Aishwarya-U-R Dec 27, 2023
588616b
trial fix
Aishwarya-U-R Dec 27, 2023
c08c136
trial fix
Aishwarya-U-R Dec 27, 2023
bf0e0e2
trial fix
Aishwarya-U-R Dec 27, 2023
9229e4f
run all
Aishwarya-U-R Dec 27, 2023
1ddefd8
Merge branch 'release' into test/dynamicwaitremove
Aishwarya-U-R Dec 27, 2023
c4fc56e
/GitDiscardChange/DiscardChanges_spec.js fix
Aishwarya-U-R Dec 27, 2023
8884c44
run limit
Aishwarya-U-R Dec 27, 2023
99c96c4
Merge branch 'release' into test/dynamicwaitremove
Aishwarya-U-R Dec 27, 2023
5fa1d63
run all
Aishwarya-U-R Dec 27, 2023
67572ce
Merge branch 'release' into test/dynamicwaitremove
Aishwarya-U-R Dec 27, 2023
0f6be30
eslint check remove
Aishwarya-U-R Jan 3, 2024
2905212
Merge branch 'release' into test/dynamicwaitremove
Aishwarya-U-R Jan 3, 2024
ccf6250
removed wait
Aishwarya-U-R Jan 4, 2024
f7600f3
EnterURL() added 1 sec wait
Aishwarya-U-R Jan 4, 2024
d9f7562
another trial
Aishwarya-U-R Jan 4, 2024
a6acf2e
revert
Aishwarya-U-R Jan 4, 2024
3bc5e4f
BugTests/ApiBugs_Spec.ts fix
Aishwarya-U-R Jan 4, 2024
ebca66d
/Dropdown/Dropdown_onOptionChange_spec.js fix
Aishwarya-U-R Jan 4, 2024
6b0ab34
Merge branch 'release' into test/dynamicwaitremove
Aishwarya-U-R Jan 4, 2024
2310f7b
ApiTests/API_Search_spec.js flaky fix
Aishwarya-U-R Jan 4, 2024
155ea88
Dropdown/Dropdown_onOptionChange_spec.js fix
Aishwarya-U-R Jan 4, 2024
bae36c4
Merge branch 'release' into test/dynamicwaitremove
Aishwarya-U-R Jan 4, 2024
cb6d11d
CreateAndFillApi()
Aishwarya-U-R Jan 4, 2024
d02920e
revert
Aishwarya-U-R Jan 5, 2024
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 @@ -9,7 +9,6 @@ const explorer = require("../../../../../locators/explorerlocators.json");
const apiwidget = require("../../../../../locators/apiWidgetslocator.json");
const dynamicInputLocators = require("../../../../../locators/DynamicInput.json");
import gitSyncLocators from "../../../../../locators/gitSyncLocators";
import ApiEditor from "../../../../../locators/ApiEditor";
import homePageLocators from "../../../../../locators/HomePage";
import datasource from "../../../../../locators/DatasourcesEditor.json";

Expand Down Expand Up @@ -135,17 +134,10 @@ describe("Git sync apps", { tags: ["@tag.Git"] }, function () {
apiPage.RunAPI();
apiPage.ResponseStatusCheck("200 OK");
// curl import
dataSources.NavigateToDSCreateNew();
cy.get(ApiEditor.curlImage).click({ force: true });
cy.get("textarea").type(
'curl -d \'{"name":"morpheus","job":"leader"}\' -H Content-Type:application/json -X POST ' +
dataSources.FillCurlNImport(
`curl -d \'{"name":"morpheus","job":"leader"}\' -H Content-Type:application/json -X POST '` +
datasourceFormData["echoApiUrl"],
{
force: true,
parseSpecialCharSequences: false,
},
);
cy.importCurl();
cy.RunAPI();
apiPage.ResponseStatusCheck("200 OK");
cy.get("@curlImport").then((response) => {
Expand Down
6 changes: 4 additions & 2 deletions app/client/cypress/limited-tests.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# 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
#cypress/e2e/Regression/ClientSide/Git/GitSync/GitSyncedApps_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.
14 changes: 7 additions & 7 deletions app/client/cypress/support/Pages/ApiPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ export class ApiPage {
private _paginationTypeLabels = ".t--apiFormPaginationType label";
_saveAsDS = ".t--store-as-datasource";
_responseStatus = ".t--response-status-code";
private _importedDataButton = ".t--show-imported-datas";
public _responseTabHeader = "[data-testid=t--tab-headers]";
public _autoGeneratedHeaderInfoIcon = (key: string) =>
`.t--auto-generated-${key}-info`;
Expand All @@ -87,6 +86,7 @@ export class ApiPage {
public _editorDS = ".t--datasource-editor";
public _addMoreHeaderFieldButton = ".t--addApiHeader";
public jsonBody = `.t--apiFormPostBody`;
private _entityName = ".t--entity-name";

CreateApi(
apiName = "",
Expand Down Expand Up @@ -115,8 +115,11 @@ export class ApiPage {
// });
// }); // to check if Api1 = Api1 when Create Api invoked

if (apiName) this.agHelper.RenameWithInPane(apiName);
cy.get(this._resourceUrl).should("be.visible");
if (apiName) {
this.agHelper.RenameWithInPane(apiName);
this.agHelper.GetNAssertContains(this._entityName, apiName);
}
this.agHelper.AssertElementVisibility(this._resourceUrl);
if (apiVerb != "GET") this.SelectAPIVerb(apiVerb);
}

Expand All @@ -129,7 +132,6 @@ export class ApiPage {
) {
this.CreateApi(apiName, apiVerb, aftDSSaved);
this.EnterURL(url);
this.agHelper.Sleep(2000); // Added because api name edit takes some time to reflect in api sidebar after the call passes.
this.AssertRunButtonDisability();
if (queryTimeout != 10000) this.SetAPITimeout(queryTimeout);
}
Expand All @@ -145,8 +147,7 @@ export class ApiPage {
inputFieldName: "",
apiOrQuery: "api",
});
//this.agHelper.GetNClick(this._resourceUrl);
this.agHelper.Sleep();
this.agHelper.Sleep(500); //Is needed for the entered url value to be registered, else failing locally & CI
if (evaluatedValue) {
this.agHelper.VerifyEvaluatedValue(evaluatedValue);
}
Expand Down Expand Up @@ -429,7 +430,6 @@ export class ApiPage {
this.CreateGraphqlApi(apiName);
this.EnterURL(url);
this.agHelper.AssertAutoSave();
//this.agHelper.Sleep(2000);// Added because api name edit takes some time to reflect in api sidebar after the call passes.
this.AssertRunButtonDisability();
if (queryTimeout != 10000) this.SetAPITimeout(queryTimeout);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class ThemeSettings {
type == "Primary"
? this.locators._colorRingPrimary
: this.locators._colorRingBackground;
this.agHelper.Sleep(200); //for themes to complete opening
this.agHelper.AssertContains("Theme settings");
this.agHelper.GetNClick(colorType);
if (typeof colorIndex == "number") {
this.agHelper.GetNClick(this.locators._colorPickerV2Popover);
Expand Down
5 changes: 2 additions & 3 deletions app/client/cypress/support/WorkspaceCommands.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,7 @@ Cypress.Commands.add("CreateNewAppInNewWorkspace", () => {
localStorage.setItem("appName", appName);

// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(4000);
cy.get("#loading").should("not.exist");
agHelper.AssertElementAbsence("#loading", Cypress.config().pageLoadTimeout);

cy.url().then((url) => {
if (url.indexOf("/applications") > -1) {
Expand All @@ -292,7 +291,7 @@ Cypress.Commands.add("CreateNewAppInNewWorkspace", () => {
}
});
});
cy.get("#sidebar").should("be.visible");
agHelper.AssertElementVisibility("#sidebar");
assertHelper.AssertNetworkResponseData("@getPluginForm"); //for auth rest api
assertHelper.AssertNetworkResponseData("@getPluginForm"); //for graphql

Expand Down
Loading