Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -44,6 +44,8 @@ describe(
testdata.baseUrl,
testdata.echoMethod,
testdata.Put,
false,
0
);
});
cy.ResponseCheck("updatedAt");
Expand All @@ -68,6 +70,8 @@ describe(
testdata.baseUrl,
testdata.echoMethod,
testdata.Post,
false,
0
);
});
cy.ResponseCheck("createdAt");
Expand All @@ -92,6 +96,8 @@ describe(
testdata.baseUrl,
testdata.echoMethod,
testdata.Patch,
false,
0
);
});
cy.ResponseCheck("updatedAt");
Expand All @@ -116,6 +122,8 @@ describe(
testdata.baseUrl,
testdata.echoMethod,
testdata.Delete,
false,
0
);
});
});
Expand All @@ -132,6 +140,8 @@ describe(
testdata.baseUrl,
testdata.methods,
testdata.Get,
false,
0
);

apiPage.SelectPaneTab("Pagination");
Expand All @@ -149,6 +159,8 @@ describe(
testdata.baseUrl,
testdata.next,
testdata.Get,
false,
0
);

apiPage.SelectPaneTab("Pagination");
Expand All @@ -165,6 +177,8 @@ describe(
testdata.baseUrl,
testdata.prev,
testdata.Get,
false,
0
);
});

Expand All @@ -179,6 +193,8 @@ describe(
testdata.baseUrl,
testdata.queryAndValue,
testdata.Get,
false,
0
);
});

Expand All @@ -194,6 +210,7 @@ describe(
testdata.methods,
testdata.Get,
true,
0
);
cy.ResponseCheck("Invalid value for Content-Type");
});
Expand Down
4 changes: 3 additions & 1 deletion app/client/cypress/limited-tests.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# To run only limited tests - give the spec names in below format:
cypress/e2e/Regression/ClientSide/Templates/Fork_Template_spec.js
cypress/e2e/Regression/ServerSide/ApiTests/API_All_Verb_spec.js
cypress/e2e/Regression/ClientSide/ExplorerTests/API_Pane_spec.js
cypress/e2e/Regression/ServerSide/ApiTests/API_Edit_spec.js

# For running all specs - uncomment below:
#cypress/e2e/**/**/*
Expand Down
1 change: 1 addition & 0 deletions app/client/cypress/locators/ApiEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ export default {
slashCommandButton: ".commands-button",
apiResponseObject: ".object-key",
apiDebuggerLink: ".debugger-entity-link",
apiLogResultPointer : "div.debugger-list div.cursor-pointer button div",
};
11 changes: 8 additions & 3 deletions app/client/cypress/support/ApiCommands.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,18 @@ Cypress.Commands.add("SaveAndRunAPI", () => {

Cypress.Commands.add(
"validateRequest",
(apiName, baseurl, path, verb, error = false) => {
(apiName, baseurl, path, verb, error = false, index = 0) => {
cy.get(".ads-v2-tabs__list").contains("Logs").click();
cy.get("[data-testid=t--debugger-search]").clear().type(apiName);
agHelper.PressEnter(2000);
if (!error) {
cy.get(ApiEditor.apiResponseObject).last().contains("request").click();
}
agHelper.IsElementVisibleWithEq(ApiEditor.apiResponseObject, index).then(isVisible => {
if (!isVisible) {
agHelper.GetNClick(ApiEditor.apiLogResultPointer, index, true);
}
cy.get(ApiEditor.apiResponseObject).last().contains("request").click();
});
}
cy.get(".string-value").contains(baseurl.concat(path));
cy.get(".string-value").contains(verb);
cy.get("[data-testid=t--tab-response]").first().click({ force: true });
Expand Down
10 changes: 10 additions & 0 deletions app/client/cypress/support/Pages/AggregateHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1552,6 +1552,16 @@ export class AggregateHelper {
) as Cypress.Chainable<boolean>;
}

IsElementVisibleWithEq(selector: ElementType, eq: number = 0) {
Comment thread
sagar-qa007 marked this conversation as resolved.
return this.GetElement(selector)
.eq(eq)
.then(($element) => {
const isVisible = Cypress.$($element).length > 0 ? true : false;
console.log(`Element visibility: ${isVisible}`);
return isVisible;
}) as Cypress.Chainable<boolean>;
}

public FailIfErrorToast(error: string) {
cy.get("body").then(($ele) => {
if ($ele.find(this.locator._toastMsg).length > 0) {
Expand Down