Skip to content

Commit

Permalink
Addressed review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
shadabbuchh committed Jan 30, 2025
1 parent 695c92f commit 09e3929
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
agHelper,
debuggerHelper,
homePage,
} from "../../../../support/Objects/ObjectsCore";
Expand All @@ -10,8 +11,6 @@ import {
import FileTabs from "../../../../support/Pages/IDE/FileTabs";
import PageList from "../../../../support/Pages/PageList";

let repoName;

describe(
"Additional API tests",
{ tags: ["@tag.Datasource", "@tag.Git"] },
Expand Down Expand Up @@ -61,7 +60,7 @@ describe(
// Click on the entity link in the log entry at index 2
debuggerHelper.ClicklogEntityLink(false, 2);
// Assert that the correct tab ("Api3") opens
FileTabs.assertActiveTab("Api3");
agHelper.AssertClassExists(FileTabs.locators.tabName("Api3"), "active");
});

it("4. Validate whether closed tab opens up after clicking on link from logs", () => {
Expand All @@ -77,7 +76,7 @@ describe(
// Click on the entity link in the log entry at index 1
debuggerHelper.ClicklogEntityLink(false, 1);
// Assert that the correct tab ("Api2") reopens
FileTabs.assertActiveTab("Api2");
agHelper.AssertClassExists(FileTabs.locators.tabName("Api2"), "active");
});
},
);
27 changes: 14 additions & 13 deletions app/client/cypress/support/Pages/ApiPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,10 @@ export class ApiPage {
// Navigate to the source page and select the API item
EditorNavigation.NavigateToPage(sourcePage);
PageLeftPane.selectItem(apiName);
FileTabs.assertActiveTab(apiName);
this.agHelper.AssertClassExists(
FileTabs.locators.tabName(apiName),
"active",
);

PageList.ShowList();
cy.get(PageList.numberOfPages).then(($el) => {
Expand Down Expand Up @@ -593,18 +596,16 @@ export class ApiPage {
// Navigate to the source page and select the API item
EditorNavigation.NavigateToPage(sourcePage);
PageLeftPane.selectItem(apiName);
FileTabs.assertActiveTab(apiName);

// Open the 'More Actions' menu and select the action
cy.get(this.moreActionsTrigger).should("be.visible").click();
cy.contains("Delete")
.should("be.visible")
.trigger("click", { force: true });
cy.contains("Are you sure?")
.should("be.visible")
.trigger("click", { force: true });

// Validate the absence of the deleted API
this.agHelper.AssertClassExists(
FileTabs.locators.tabName(apiName),
"active",
);

this.agHelper.GetNClick(this.moreActionsTrigger);
this.agHelper.ContainsNClick("Delete", 0, true);
this.agHelper.ContainsNClick("Are you sure?", 0, true);

// Validate the absence of the API from the source page
PageLeftPane.assertAbsence(apiName);
}
}
6 changes: 0 additions & 6 deletions app/client/cypress/support/Pages/IDE/FileTabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@ class FileTabs {
});
}

assertActiveTab(expectedTabName: string) {
cy.get(this.locators.tabName(expectedTabName))
.should("exist")
.and("have.class", "active");
}

closeTab(name: string) {
const tab = this.locators.tabName(name);
ObjectsRegistry.AggregateHelper.HoverElement(tab);
Expand Down

0 comments on commit 09e3929

Please sign in to comment.