-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Editor tests for renaming, copying, moving, and deleting APIs
- Loading branch information
1 parent
b62c875
commit 5acb13b
Showing
5 changed files
with
191 additions
and
3 deletions.
There are no files selected for viewing
83 changes: 83 additions & 0 deletions
83
app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_Additional_Tests_spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
import { | ||
debuggerHelper, | ||
homePage, | ||
} from "../../../../support/Objects/ObjectsCore"; | ||
import { apiPage } from "../../../../support/Objects/ObjectsCore"; | ||
import { | ||
PageLeftPane, | ||
PagePaneSegment, | ||
} from "../../../../support/Pages/EditorNavigation"; | ||
import FileTabs from "../../../../support/Pages/IDE/FileTabs"; | ||
import PageList from "../../../../support/Pages/PageList"; | ||
|
||
let repoName; | ||
|
||
describe( | ||
"Additional API tests", | ||
{ tags: ["@tag.Datasource", "@tag.Git"] }, | ||
() => { | ||
it("1. Validate renaming & copying API from editor", () => { | ||
// Create first API | ||
apiPage.CreateApi(); | ||
// Rename the API | ||
apiPage.renameFromEditor("changedName"); | ||
// Create second API | ||
apiPage.CreateApi("secondApi", "GET"); | ||
// Add a new blank page to the application | ||
PageList.AddNewPage("New blank page"); | ||
// Copy the API to the same page | ||
apiPage.performActionFromEditor("copy", "changedName", "Page1", "Page1"); | ||
// Copy the API to a different page | ||
apiPage.performActionFromEditor("copy", "secondApi", "Page1", "Page2"); | ||
}); | ||
|
||
it("2. Validate moving & deleting API from editor", () => { | ||
// Create a new application | ||
homePage.NavigateToHome(); | ||
homePage.CreateNewApplication(); | ||
// Create first API | ||
apiPage.CreateApi("ApiToBeMoved", "GET"); | ||
apiPage.CreateApi("ApiNotToBeMoved", "GET"); | ||
// Having only one page in the app, check if the API is moved to the same page | ||
apiPage.performActionFromEditor("move", "ApiToBeMoved", "Page1", "Page1"); | ||
// Add a new blank page to the application | ||
PageList.AddNewPage("New blank page"); | ||
// Move the API to a different page & check if the source page does not have the API anymore | ||
apiPage.performActionFromEditor("move", "ApiToBeMoved", "Page1", "Page2"); | ||
apiPage.performActionFromEditor("move", "ApiToBeMoved", "Page2", "Page1"); | ||
apiPage.deleteAPIFromEditor("ApiToBeMoved", "Page1"); | ||
}); | ||
|
||
it("3. Validate whether correct tab opens up after clicking on link from logs", () => { | ||
// Create a new application | ||
homePage.NavigateToHome(); | ||
homePage.CreateNewApplication(); | ||
for (let i = 0; i < 4; i++) { | ||
apiPage.CreateApi(``, "GET"); | ||
} | ||
debuggerHelper.OpenDebugger(); | ||
//Navigate to the "Logs" tab in the debugger | ||
debuggerHelper.ClickLogsTab(); | ||
// 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"); | ||
}); | ||
|
||
it("4. Validate whether closed tab opens up after clicking on link from logs", () => { | ||
// Close all the tabs (Api1 to Api4) | ||
for (let i = 1; i < 5; i++) { | ||
FileTabs.closeTab(`Api${i}`); | ||
} | ||
// Switch to the "UI" segment in the page left pane | ||
PageLeftPane.switchSegment(PagePaneSegment.UI); | ||
debuggerHelper.OpenDebugger(); | ||
// Navigate to the "Logs" tab in the debugger | ||
debuggerHelper.ClickLogsTab(); | ||
// 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"); | ||
}); | ||
}, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# To run only limited tests - give the spec names in below format: | ||
#cypress/e2e/Regression/ClientSide/VisualTests/JSEditorIndent_spec.js | ||
cypress/e2e/Regression/ServerSide/ApiTests/API_Additional_Tests_spec.ts | ||
# For running all specs - uncomment below: | ||
#cypress/e2e/**/**/* | ||
cypress/e2e/Regression/ClientSide/Anvil/Widgets/* | ||
#cypress/e2e/Regression/ClientSide/Anvil/Widgets/* | ||
|
||
#ci-test-limit uses this file to run minimum of specs. Do not run entire suite with this command. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters