Skip to content

Commit

Permalink
fixing cypress tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ankitakinger committed Dec 1, 2024
1 parent 5ef06c8 commit 2985ea9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ describe(
// Create api that causes an error
_.apiPage.CreateAndFillApi("https://fakeapi/user");
});
it("it shows error message", () => {
it("it shows error message in response tab", () => {
_.apiPage.RunAPI(false);
_.debuggerHelper.AssertOpen(PageType.API);
_.apiPage.ResponseStatusCheck("PE-RST-5000");
});
it("it shows debug button and navigates", () => {
it("it shows error messages in error tab", () => {
_.apiPage.DebugError();
_.debuggerHelper.AssertSelectedTab(
Cypress.env("MESSAGES").DEBUGGER_ERRORS(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@ describe(
//Create and run query.

_.dataSources.EnterQuery(
"SELECT * FROM users ORDER BY id LIMIT 10;",
"SELECT * FROM public.users ORDER BY id LIMIT 10;",
1000,
);
_.dataSources.RunQuery();
//Verify if bottom bar is open on executing query.
_.debuggerHelper.AssertOpen(PageType.Query);
//Verify if response atb is selected on executing query.
//Verify if response tab is selected on executing query.
_.debuggerHelper.AssertSelectedTab(
Cypress.env("MESSAGES").DEBUGGER_RESPONSE(),
);
Expand Down Expand Up @@ -140,13 +140,13 @@ describe(
_.debuggerHelper.AssertClosed();
//Create and run query.
_.dataSources.EnterQuery(
"SELECT * FROM users ORDER BY id LIMIT 10;",
"SELECT * FROM public.users ORDER BY id LIMIT 10;",
1000,
);
_.dataSources.RunQuery();
//Verify if bottom bar is open on executing query.
_.debuggerHelper.AssertOpen(PageType.Query);
//Verify if response atb is selected on executing query.
//Verify if response tab is selected on executing query.
_.debuggerHelper.AssertSelectedTab(
Cypress.env("MESSAGES").DEBUGGER_RESPONSE(),
);
Expand Down
6 changes: 2 additions & 4 deletions app/client/cypress/support/Pages/ApiPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ export class ApiPage {
private _paginationTypeLabels = ".t--apiFormPaginationType label";
_saveAsDS = ".t--store-as-datasource";
_responseStatus = ".t--response-status-code";
public _responseTabHeader = "[data-testid=t--tab-HEADERS_TAB]";
public _headersTabContent = ".t--headers-tab";
public _responseTabError = "[data-testid=t--tab-ERROR_TAB]";
public _autoGeneratedHeaderInfoIcon = (key: string) =>
`.t--auto-generated-${key}-info`;
_nextCursorValue = ".t--apiFormPaginationNextCursorValue";
Expand Down Expand Up @@ -471,8 +470,7 @@ export class ApiPage {
}

DebugError() {
this.agHelper.GetNClick(this._responseTabHeader);
cy.get(this._headersTabContent).contains("Debug").click();
this.agHelper.GetNClick(this._responseTabError);
}

public FillCurlNImport(value: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export const StatusBar = styled.div`
padding: 8px;
border-bottom: 1px solid var(--ads-v2-color-border);
z-index: var(--ads-v2-z-index-1);
background: var(--ads-v2-color-bg);
`;

export const StatusBarInfo = styled.div`
Expand Down

0 comments on commit 2985ea9

Please sign in to comment.