diff --git a/packages/insomnia-test/tests/cloud-sync/branch-history-isolation-across-workspaces.spec.ts b/packages/insomnia-test/tests/cloud-sync/branch-history-isolation-across-workspaces.spec.ts index 93763070a4..7cf25a7399 100644 --- a/packages/insomnia-test/tests/cloud-sync/branch-history-isolation-across-workspaces.spec.ts +++ b/packages/insomnia-test/tests/cloud-sync/branch-history-isolation-across-workspaces.spec.ts @@ -8,13 +8,13 @@ test("Verify branch, commit, merge, and restore actions on one Cloud-synced work }) => { const { workspaceFlow, httpRequestFlow, mcpClientFlow, cloudSyncFlow } = user.flowManager; - const { httpRequestPage, mcpClientPage, cloudSyncPage } = user.pageManager; + const { httpRequestPage, mcpClientPage, cloudSyncPage, cloudSyncBranchesDialogPage } = user.pageManager; await cloudSyncFlow.fetch("My Collection R1"); const collectionX = await workspaceFlow.getCollection({ name: "My Collection R1", }); - await httpRequestFlow.get("New Request", collectionX); + await httpRequestFlow.get("New Request"); await httpRequestPage.setUrl(faker.internet.url()); const branchX = faker.git.branch(); await cloudSyncFlow.createBranch(branchX); @@ -25,7 +25,6 @@ test("Verify branch, commit, merge, and restore actions on one Cloud-synced work await user.page.reload(); const requestXAfterRestore = await httpRequestFlow.get( "New Request", - collectionX, ); await cloudSyncFlow.fetch("My MCP Client"); @@ -40,16 +39,16 @@ test("Verify branch, commit, merge, and restore actions on one Cloud-synced work await user.page.reload(); const clientYAfterRestore = await mcpClientFlow.get("My MCP Client"); - await httpRequestFlow.get("New Request", collectionX); + await httpRequestFlow.get("New Request"); await cloudSyncPage.openBranchesDialog(); - const branchXListedOnX = await cloudSyncPage.isLocalBranchListed(branchX); - const branchYListedOnX = await cloudSyncPage.isLocalBranchListed(branchY); - await cloudSyncPage.closeBranchesDialog(); + const branchXListedOnX = await cloudSyncBranchesDialogPage.isLocalBranchListed(branchX); + const branchYListedOnX = await cloudSyncBranchesDialogPage.isLocalBranchListed(branchY); + await cloudSyncBranchesDialogPage.closeBranchesDialog(); await mcpClientFlow.get("My MCP Client"); await cloudSyncPage.openBranchesDialog(); - const branchYListedOnY = await cloudSyncPage.isLocalBranchListed(branchY); - const branchXListedOnY = await cloudSyncPage.isLocalBranchListed(branchX); - await cloudSyncPage.closeBranchesDialog(); + const branchYListedOnY = await cloudSyncBranchesDialogPage.isLocalBranchListed(branchY); + const branchXListedOnY = await cloudSyncBranchesDialogPage.isLocalBranchListed(branchX); + await cloudSyncBranchesDialogPage.closeBranchesDialog(); expect(requestXAfterRestore?.url).toBe(""); expect(clientYAfterRestore?.url).toBe(""); diff --git a/packages/insomnia-test/tests/cloud-sync/branches.spec.ts b/packages/insomnia-test/tests/cloud-sync/branches.spec.ts index b5091cfec9..2b2a66ef95 100644 --- a/packages/insomnia-test/tests/cloud-sync/branches.spec.ts +++ b/packages/insomnia-test/tests/cloud-sync/branches.spec.ts @@ -7,31 +7,31 @@ test("Verify fetching a remote branch, checking out, deleting a local branch, an user, }) => { const { cloudSyncFlow } = user.flowManager; - const { cloudSyncPage } = user.pageManager; + const { cloudSyncPage, cloudSyncBranchesDialogPage } = user.pageManager; await cloudSyncFlow.fetch("My MCP Client"); await cloudSyncPage.openBranchesDialog(); - await cloudSyncPage.fetchRemoteBranch("develop"); + await cloudSyncBranchesDialogPage.fetchRemoteBranch("develop"); await expect - .poll(() => cloudSyncPage.isLocalBranchListed("develop"), { + .poll(() => cloudSyncBranchesDialogPage.isLocalBranchListed("develop"), { timeout: DEFAULT_TIMEOUT, }) .toBe(true); - await cloudSyncPage.checkoutLocalBranch("master"); - await cloudSyncPage.deleteLocalBranch("develop"); + await cloudSyncBranchesDialogPage.checkoutLocalBranch("master"); + await cloudSyncBranchesDialogPage.deleteLocalBranch("develop"); - await cloudSyncPage.waitForLocalBranchRemoved("develop"); + await cloudSyncBranchesDialogPage.waitForLocalBranchRemoved("develop"); const newBranch = faker.git.branch(); - await cloudSyncPage.createBranch(newBranch); + await cloudSyncBranchesDialogPage.createBranch(newBranch); await expect - .poll(() => cloudSyncPage.isLocalBranchListed(newBranch), { + .poll(() => cloudSyncBranchesDialogPage.isLocalBranchListed(newBranch), { timeout: DEFAULT_TIMEOUT, }) .toBe(true); - expect(await cloudSyncPage.isLocalBranchDeleteDisabled(newBranch)).toBe(true); - await cloudSyncPage.closeBranchesDialog(); + expect(await cloudSyncBranchesDialogPage.isLocalBranchDeleteDisabled(newBranch)).toBe(true); + await cloudSyncBranchesDialogPage.closeBranchesDialog(); }); diff --git a/packages/insomnia-test/tests/cloud-sync/concurrent-workspace-creation-race.spec.ts b/packages/insomnia-test/tests/cloud-sync/concurrent-workspace-creation-race.spec.ts index 6bde5920fe..22c70b5e20 100644 --- a/packages/insomnia-test/tests/cloud-sync/concurrent-workspace-creation-race.spec.ts +++ b/packages/insomnia-test/tests/cloud-sync/concurrent-workspace-creation-race.spec.ts @@ -4,8 +4,9 @@ import path from "node:path"; import { faker } from "@faker-js/faker"; import { expect } from "@playwright/test"; -import { getCloudSyncGraphQLRequestLog, MOCK_API_SERVER, resetCloudSyncState, SESSION_ID, setCloudSyncGraphQLDelay, test } from "../../misc/fixtures"; +import { MOCK_API_SERVER, resetCloudSyncState, SESSION_ID, test } from "../../misc/fixtures"; import { Collection } from "../../models/collection"; +import { getCloudSyncGraphQLRequestLog, setCloudSyncGraphQLDelay } from "./support/cloud-sync-mock"; // Every Cloud Sync workspace used to share one VCS singleton, so creating a sibling // collection Y could repoint the singleton's `_backendProject` mid-flight, diff --git a/packages/insomnia-test/tests/cloud-sync/delete-unsynced-remote-file.spec.ts b/packages/insomnia-test/tests/cloud-sync/delete-unsynced-remote-file.spec.ts index 191b870f8c..e6e8e1391b 100644 --- a/packages/insomnia-test/tests/cloud-sync/delete-unsynced-remote-file.spec.ts +++ b/packages/insomnia-test/tests/cloud-sync/delete-unsynced-remote-file.spec.ts @@ -5,8 +5,9 @@ import { faker } from "@faker-js/faker"; import { expect } from "@playwright/test"; import { HttpMethod } from "../../enums/http-method"; -import { getCloudSyncProjectInfo, HTTP_SERVER, resetCloudSyncState, setCloudSyncArchiveFailure, test } from "../../misc/fixtures"; +import { HTTP_SERVER, resetCloudSyncState, test } from "../../misc/fixtures"; import { Collection } from "../../models/collection"; +import { getCloudSyncProjectInfo, setCloudSyncArchiveFailure } from "./support/cloud-sync-mock"; test.afterAll(async () => { await resetCloudSyncState(); @@ -17,7 +18,7 @@ test("Verify the dashboard can delete a never-pulled unsynced remote file and a }) => { const { workspaceFlow, httpRequestFlow, cloudSyncFlow, appFlow } = user.flowManager; - const { cloudSyncPage } = user.pageManager; + const { cloudSyncPage, cloudSyncFileDeletePage } = user.pageManager; const project = await workspaceFlow.getProject({ name: "Personal Workspace", @@ -25,12 +26,12 @@ test("Verify the dashboard can delete a never-pulled unsynced remote file and a await cloudSyncFlow.openProjectDashboard(project!); const mcpClientInfoBefore = await getCloudSyncProjectInfo("My MCP Client"); - await cloudSyncPage.openFileDeleteDialog("My MCP Client"); - const deleteDialogText = await cloudSyncPage.getFileDeleteDialogText(); + await cloudSyncFileDeletePage.openFileDeleteDialog("My MCP Client"); + const deleteDialogText = await cloudSyncFileDeletePage.getFileDeleteDialogText(); const logLines = await appFlow.captureMainProcessLog(async () => { - await cloudSyncPage.confirmFileDelete(); + await cloudSyncFileDeletePage.confirmFileDelete(); await expect - .poll(() => cloudSyncPage.isFileCardVisible("My MCP Client")) + .poll(() => cloudSyncFileDeletePage.isFileCardVisible("My MCP Client")) .toBe(false); }); const mcpClientInfoAfter = await getCloudSyncProjectInfo("My MCP Client"); @@ -38,15 +39,15 @@ test("Verify the dashboard can delete a never-pulled unsynced remote file and a const ghostInfoBefore = await getCloudSyncProjectInfo("Ghost Collection"); await cloudSyncFlow.deleteUnsyncedFile("Ghost Collection"); await expect - .poll(() => cloudSyncPage.isFileCardVisible("Ghost Collection")) + .poll(() => cloudSyncFileDeletePage.isFileCardVisible("Ghost Collection")) .toBe(false); const ghostInfoAfter = await getCloudSyncProjectInfo("Ghost Collection"); await setCloudSyncArchiveFailure(true); await cloudSyncFlow.deleteUnsyncedFile("My Environment"); - await cloudSyncPage.waitForFileDeleteFailureToast("My Environment"); + await cloudSyncFileDeletePage.waitForFileDeleteFailureToast("My Environment"); const environmentStillVisible = - await cloudSyncPage.isFileCardVisible("My Environment"); + await cloudSyncFileDeletePage.isFileCardVisible("My Environment"); const environmentInfoAfterFailure = await getCloudSyncProjectInfo("My Environment"); await setCloudSyncArchiveFailure(false); diff --git a/packages/insomnia-test/tests/cloud-sync/discard-changes-isolation-across-workspaces.spec.ts b/packages/insomnia-test/tests/cloud-sync/discard-changes-isolation-across-workspaces.spec.ts index 9e9f995029..559996e40b 100644 --- a/packages/insomnia-test/tests/cloud-sync/discard-changes-isolation-across-workspaces.spec.ts +++ b/packages/insomnia-test/tests/cloud-sync/discard-changes-isolation-across-workspaces.spec.ts @@ -14,7 +14,7 @@ test("Verify discarding changes on one Cloud-synced workspace does not affect an const collectionX = await workspaceFlow.getCollection({ name: "My Collection R1", }); - const requestXBefore = await httpRequestFlow.get("New Request", collectionX); + const requestXBefore = await httpRequestFlow.get("New Request"); const editedUrlX = faker.internet.url(); await httpRequestPage.setUrl(editedUrlX); @@ -27,7 +27,6 @@ test("Verify discarding changes on one Cloud-synced workspace does not affect an const requestXAfterDiscard = await httpRequestFlow.get( "New Request", - collectionX, ); expect(clientYAfterDiscard?.url).toBe(clientYBefore?.url); diff --git a/packages/insomnia-test/tests/cloud-sync/discard-commit-push-and-restore.spec.ts b/packages/insomnia-test/tests/cloud-sync/discard-commit-push-and-restore.spec.ts index 68f28fda7b..622cd4867c 100644 --- a/packages/insomnia-test/tests/cloud-sync/discard-commit-push-and-restore.spec.ts +++ b/packages/insomnia-test/tests/cloud-sync/discard-commit-push-and-restore.spec.ts @@ -14,14 +14,14 @@ test("Verify discarding changes, committing and pushing, and restoring an earlie const collection = await workspaceFlow.getCollection({ name: "My Collection R1", }); - await httpRequestFlow.get("New Request", collection); + await httpRequestFlow.get("New Request"); await httpRequestPage.setBody({ mimeType: ContentType.Plain, text: faker.lorem.slug(), }); await cloudSyncFlow.discardAllChanges(); await user.page.reload(); - await httpRequestFlow.get("New Request", collection); + await httpRequestFlow.get("New Request"); await expect .poll(() => httpRequestPage.getBody(), { timeout: DEFAULT_TIMEOUT }) @@ -36,7 +36,7 @@ test("Verify discarding changes, committing and pushing, and restoring an earlie await cloudSyncFlow.restoreSnapshot("Initial Snapshot"); await user.page.reload(); - await httpRequestFlow.get("New Request", collection); + await httpRequestFlow.get("New Request"); const bodyAfterRestore = await httpRequestPage.getBody(); expect(isCommitDisabled).toBe(true); diff --git a/packages/insomnia-test/tests/cloud-sync/invalid-branch-names.spec.ts b/packages/insomnia-test/tests/cloud-sync/invalid-branch-names.spec.ts index 4d1b36cf4e..55b3d17726 100644 --- a/packages/insomnia-test/tests/cloud-sync/invalid-branch-names.spec.ts +++ b/packages/insomnia-test/tests/cloud-sync/invalid-branch-names.spec.ts @@ -28,25 +28,25 @@ test("Verify creating a branch with an invalid or already-used name is rejected user, }) => { const { cloudSyncFlow } = user.flowManager; - const { cloudSyncPage } = user.pageManager; + const { cloudSyncPage, cloudSyncBranchesDialogPage } = user.pageManager; await cloudSyncFlow.fetch("My Collection R1"); await cloudSyncPage.openBranchesDialog(); for (const { name, error } of INVALID_NAMES) { - await cloudSyncPage.createBranch(name); - await cloudSyncPage.waitForBranchCreationError(error); + await cloudSyncBranchesDialogPage.createBranch(name); + await cloudSyncBranchesDialogPage.waitForBranchCreationError(error); } const existingBranch = faker.git.branch(); - await cloudSyncPage.createBranch(existingBranch); + await cloudSyncBranchesDialogPage.createBranch(existingBranch); await expect - .poll(() => cloudSyncPage.isLocalBranchListed(existingBranch)) + .poll(() => cloudSyncBranchesDialogPage.isLocalBranchListed(existingBranch)) .toBe(true); - await cloudSyncPage.createBranch(existingBranch); - await cloudSyncPage.waitForBranchCreationError( + await cloudSyncBranchesDialogPage.createBranch(existingBranch); + await cloudSyncBranchesDialogPage.waitForBranchCreationError( `Branch already exists by name ${existingBranch}`, ); for (const { name } of INVALID_NAMES) { - await cloudSyncPage.waitForLocalBranchRemoved(name); + await cloudSyncBranchesDialogPage.waitForLocalBranchRemoved(name); } }); diff --git a/packages/insomnia-test/tests/cloud-sync/merge-conflict-resolution.spec.ts b/packages/insomnia-test/tests/cloud-sync/merge-conflict-resolution.spec.ts index 3414e3ae23..2f3845eb00 100644 --- a/packages/insomnia-test/tests/cloud-sync/merge-conflict-resolution.spec.ts +++ b/packages/insomnia-test/tests/cloud-sync/merge-conflict-resolution.spec.ts @@ -12,13 +12,13 @@ for (const { version, chosenIndex } of [ user, }) => { const { workspaceFlow, httpRequestFlow, cloudSyncFlow } = user.flowManager; - const { httpRequestPage, cloudSyncPage } = user.pageManager; + const { httpRequestPage, cloudSyncPage, cloudSyncBranchesDialogPage } = user.pageManager; await cloudSyncFlow.fetch("My Collection R1"); const collection = await workspaceFlow.getCollection({ name: "My Collection R1", }); - await httpRequestFlow.get("New Request", collection); + await httpRequestFlow.get("New Request"); const branch = faker.git.branch(); const branchBody = faker.lorem.slug(); @@ -30,10 +30,10 @@ for (const { version, chosenIndex } of [ await cloudSyncFlow.commit("New Request", faker.lorem.sentence()); await cloudSyncPage.openBranchesDialog(); - await cloudSyncPage.checkoutLocalBranch("master"); - await cloudSyncPage.closeBranchesDialog(); + await cloudSyncBranchesDialogPage.checkoutLocalBranch("master"); + await cloudSyncBranchesDialogPage.closeBranchesDialog(); await user.page.reload(); - await httpRequestFlow.get("New Request", collection); + await httpRequestFlow.get("New Request"); const currentBody = faker.lorem.slug(); await httpRequestPage.setBody({ mimeType: ContentType.Plain, @@ -46,7 +46,7 @@ for (const { version, chosenIndex } of [ version, ); await user.page.reload(); - await httpRequestFlow.get("New Request", collection); + await httpRequestFlow.get("New Request"); const bodies = [currentBody, branchBody]; expect(conflicts).toEqual(["New Request"]); diff --git a/packages/insomnia-test/tests/cloud-sync/restore-snapshot-removes-added-request.spec.ts b/packages/insomnia-test/tests/cloud-sync/restore-snapshot-removes-added-request.spec.ts index dd39615a54..8ca0400d1c 100644 --- a/packages/insomnia-test/tests/cloud-sync/restore-snapshot-removes-added-request.spec.ts +++ b/packages/insomnia-test/tests/cloud-sync/restore-snapshot-removes-added-request.spec.ts @@ -26,16 +26,16 @@ test("Verify restoring an earlier snapshot removes a request added and committed // The restore lands asynchronously and a reload before then aborts it, so // wait for the live sidebar to reflect it before reloading. await expect - .poll(() => httpRequestFlow.get(addedName, collection), { + .poll(() => httpRequestFlow.get(addedName), { timeout: DEFAULT_TIMEOUT, }) .toBeUndefined(); await user.page.reload(); await expect - .poll(() => httpRequestFlow.get(addedName, collection), { + .poll(() => httpRequestFlow.get(addedName), { timeout: DEFAULT_TIMEOUT, }) .toBeUndefined(); - expect(await httpRequestFlow.get("New Request", collection)).toBeDefined(); + expect(await httpRequestFlow.get("New Request")).toBeDefined(); }); diff --git a/packages/insomnia-test/tests/cloud-sync/unrelated-action-during-collection-creation.spec.ts b/packages/insomnia-test/tests/cloud-sync/unrelated-action-during-collection-creation.spec.ts index b0fd3b1dd4..1b221c8855 100644 --- a/packages/insomnia-test/tests/cloud-sync/unrelated-action-during-collection-creation.spec.ts +++ b/packages/insomnia-test/tests/cloud-sync/unrelated-action-during-collection-creation.spec.ts @@ -4,9 +4,10 @@ import path from "node:path"; import { faker } from "@faker-js/faker"; import { expect } from "@playwright/test"; -import { getCloudSyncGraphQLRequestLog, MOCK_API_SERVER, resetCloudSyncState, SESSION_ID, setCloudSyncGraphQLDelay, test } from "../../misc/fixtures"; +import { MOCK_API_SERVER, resetCloudSyncState, SESSION_ID, test } from "../../misc/fixtures"; import { Collection } from "../../models/collection"; import type { Environment } from "../../models/environment"; +import { getCloudSyncGraphQLRequestLog, setCloudSyncGraphQLDelay } from "./support/cloud-sync-mock"; test.afterAll(async () => { await setCloudSyncGraphQLDelay(0); diff --git a/packages/insomnia-test/tests/cloud-sync/unsynced-file-delete-button-visibility.spec.ts b/packages/insomnia-test/tests/cloud-sync/unsynced-file-delete-button-visibility.spec.ts index c1f7e7d7f3..ff48aff881 100644 --- a/packages/insomnia-test/tests/cloud-sync/unsynced-file-delete-button-visibility.spec.ts +++ b/packages/insomnia-test/tests/cloud-sync/unsynced-file-delete-button-visibility.spec.ts @@ -3,13 +3,13 @@ import { expect } from "@playwright/test"; import { test } from "../../misc/fixtures"; import { Collection } from "../../models/collection"; -import { DialogDismissMethod } from "../../pages/cloud-sync.page"; +import { DialogDismissMethod } from "../../pages/cloud-sync-file-delete.page"; test("Verify the dashboard's unsynced-file delete button only appears on unsynced cards, is revealed on hover and keyboard focus, and cancelling its dialog leaves the file intact", async ({ user, }) => { const { workspaceFlow, cloudSyncFlow, appFlow } = user.flowManager; - const { cloudSyncPage } = user.pageManager; + const { cloudSyncPage, cloudSyncFileDeletePage } = user.pageManager; const project = await workspaceFlow.getProject({ name: "Personal Workspace" }); const localCollection = await workspaceFlow.createCollection( @@ -21,46 +21,46 @@ test("Verify the dashboard's unsynced-file delete button only appears on unsynce await cloudSyncPage.backToAllProjects(); await cloudSyncFlow.openProjectDashboard(project!); - const syncedHasButton = await cloudSyncPage.hasFileDeleteButton( + const syncedHasButton = await cloudSyncFileDeletePage.hasFileDeleteButton( "My Collection R1", ); - const localOnlyHasButton = await cloudSyncPage.hasFileDeleteButton( + const localOnlyHasButton = await cloudSyncFileDeletePage.hasFileDeleteButton( (localCollection as Collection).name, ); - const unsyncedHasButton = await cloudSyncPage.hasFileDeleteButton( + const unsyncedHasButton = await cloudSyncFileDeletePage.hasFileDeleteButton( "My Environment", ); - const revealedBeforeHover = await cloudSyncPage.isFileDeleteButtonRevealed( + const revealedBeforeHover = await cloudSyncFileDeletePage.isFileDeleteButtonRevealed( "My Environment", ); - await cloudSyncPage.hoverFile("My Environment"); - const revealedOnHover = await cloudSyncPage.isFileDeleteButtonRevealed( + await cloudSyncFileDeletePage.hoverFile("My Environment"); + const revealedOnHover = await cloudSyncFileDeletePage.isFileDeleteButtonRevealed( "My Environment", ); - await cloudSyncPage.hoverFile((localCollection as Collection).name); - const revealedAfterUnhover = await cloudSyncPage.isFileDeleteButtonRevealed( + await cloudSyncFileDeletePage.hoverFile((localCollection as Collection).name); + const revealedAfterUnhover = await cloudSyncFileDeletePage.isFileDeleteButtonRevealed( "My Environment", ); - await cloudSyncPage.focusFile("My Environment"); - const revealedOnFocus = await cloudSyncPage.isFileDeleteButtonRevealed( + await cloudSyncFileDeletePage.focusFile("My Environment"); + const revealedOnFocus = await cloudSyncFileDeletePage.isFileDeleteButtonRevealed( "My Environment", ); const logLines = await appFlow.captureMainProcessLog(async () => { - await cloudSyncPage.openFileDeleteDialog("My Environment"); - await cloudSyncPage.dismissFileDeleteDialog(DialogDismissMethod.XButton); - await cloudSyncPage.openFileDeleteDialog("My Environment"); - await cloudSyncPage.dismissFileDeleteDialog(DialogDismissMethod.Escape); - await cloudSyncPage.openFileDeleteDialog("My Environment"); - await cloudSyncPage.dismissFileDeleteDialog( + await cloudSyncFileDeletePage.openFileDeleteDialog("My Environment"); + await cloudSyncFileDeletePage.dismissFileDeleteDialog(DialogDismissMethod.XButton); + await cloudSyncFileDeletePage.openFileDeleteDialog("My Environment"); + await cloudSyncFileDeletePage.dismissFileDeleteDialog(DialogDismissMethod.Escape); + await cloudSyncFileDeletePage.openFileDeleteDialog("My Environment"); + await cloudSyncFileDeletePage.dismissFileDeleteDialog( DialogDismissMethod.ClickOutside, ); }); const archivedLines = logLines.filter((line) => /Archived remote project/.test(line), ); - const fileStillPresent = await cloudSyncPage.isFileCardVisible( + const fileStillPresent = await cloudSyncFileDeletePage.isFileCardVisible( "My Environment", ); diff --git a/packages/insomnia-test/tests/git-sync/commit-needs-staged-changes-and-message.spec.ts b/packages/insomnia-test/tests/git-sync/commit-needs-staged-changes-and-message.spec.ts index 40a90640db..b46e3320c9 100644 --- a/packages/insomnia-test/tests/git-sync/commit-needs-staged-changes-and-message.spec.ts +++ b/packages/insomnia-test/tests/git-sync/commit-needs-staged-changes-and-message.spec.ts @@ -10,7 +10,7 @@ test('Verify committing with nothing staged prompts to stage all, and cancelling user, }) => { const { preferencesFlow, workspaceFlow } = user.flowManager; - const { gitSyncPage } = user.pageManager; + const { gitSyncPage, gitCommitDialogPage, gitHistoryDialogPage } = user.pageManager; await preferencesFlow.addGitCredential(GIT_CREDENTIAL); const project = await workspaceFlow.cloneGitProject( @@ -21,23 +21,23 @@ test('Verify committing with nothing staged prompts to stage all, and cancelling await workspaceFlow.createCollection(project, new Collection(faker.string.alphanumeric(10)), fileName); await gitSyncPage.openHistory(); - const initialCommit = await gitSyncPage.getLatestCommit(); - await gitSyncPage.closeHistory(); + const initialCommit = await gitHistoryDialogPage.getLatestCommit(); + await gitHistoryDialogPage.closeHistory(); await gitSyncPage.openCommitDialog(); - await gitSyncPage.commitStaged(faker.string.alphanumeric(10)); - const promptText = await gitSyncPage.getStageAllPromptText(); - await gitSyncPage.cancelStageAllPrompt(); - const stagedAfterCancel = await gitSyncPage.getStagedChanges(); - await gitSyncPage.stageChange(`${fileName}.yaml`); - await gitSyncPage.commitStaged(); - const dialogOpenWithoutMessage = await gitSyncPage.isCommitDialogOpen(); - const stagedWithoutMessage = await gitSyncPage.getStagedChanges(); - await gitSyncPage.closeCommitDialog(); + await gitCommitDialogPage.commitStaged(faker.string.alphanumeric(10)); + const promptText = await gitCommitDialogPage.getStageAllPromptText(); + await gitCommitDialogPage.cancelStageAllPrompt(); + const stagedAfterCancel = await gitCommitDialogPage.getStagedChanges(); + await gitCommitDialogPage.stageChange(`${fileName}.yaml`); + await gitCommitDialogPage.commitStaged(); + const dialogOpenWithoutMessage = await gitCommitDialogPage.isCommitDialogOpen(); + const stagedWithoutMessage = await gitCommitDialogPage.getStagedChanges(); + await gitCommitDialogPage.closeCommitDialog(); await gitSyncPage.openHistory(); - const latestCommit = await gitSyncPage.getLatestCommit(); - await gitSyncPage.closeHistory(); + const latestCommit = await gitHistoryDialogPage.getLatestCommit(); + await gitHistoryDialogPage.closeHistory(); expect(promptText).toContain('There are no staged changes to commit'); expect(stagedAfterCancel).toEqual([]); @@ -48,7 +48,7 @@ test('Verify committing with nothing staged prompts to stage all, and cancelling test('Verify confirming the stage-all prompt stages every change and commits it', async ({ user }) => { const { preferencesFlow, workspaceFlow } = user.flowManager; - const { gitSyncPage } = user.pageManager; + const { gitSyncPage, gitCommitDialogPage, gitHistoryDialogPage } = user.pageManager; await preferencesFlow.addGitCredential(GIT_CREDENTIAL); const project = await workspaceFlow.cloneGitProject( @@ -68,11 +68,11 @@ test('Verify confirming the stage-all prompt stages every change and commits it' const message = faker.string.alphanumeric(10); await gitSyncPage.openCommitDialog(); - await gitSyncPage.commitStaged(message); - await gitSyncPage.confirmStageAllPrompt(); + await gitCommitDialogPage.commitStaged(message); + await gitCommitDialogPage.confirmStageAllPrompt(); await gitSyncPage.openHistory(); - const latestCommit = await gitSyncPage.getLatestCommit(); - await gitSyncPage.closeHistory(); + const latestCommit = await gitHistoryDialogPage.getLatestCommit(); + await gitHistoryDialogPage.closeHistory(); expect(latestCommit?.message).toBe(message); }); diff --git a/packages/insomnia-test/tests/git-sync/disabled-via-feature-flag.spec.ts b/packages/insomnia-test/tests/git-sync/disabled-via-feature-flag.spec.ts index 5afe53c8a3..89c0be672e 100644 --- a/packages/insomnia-test/tests/git-sync/disabled-via-feature-flag.spec.ts +++ b/packages/insomnia-test/tests/git-sync/disabled-via-feature-flag.spec.ts @@ -15,10 +15,10 @@ test.afterAll(async () => { test( "Verify selecting the Git project type shows the disabled-feature banner, hides the setup form, and disables Scan for files when Git Sync is disabled by org feature flag", async ({ user }) => { - const { workspacePage, projectSettingsPage } = user.pageManager; + const { workspacePage, projectSettingsPage, projectPage } = user.pageManager; - await workspacePage.clickNewProject(); - await workspacePage.clickProjectTypeTile(ProjectType.Git); + await projectPage.clickNewProject(); + await projectPage.clickProjectTypeTile(ProjectType.Git); let bannerText: string | undefined; await expect diff --git a/packages/insomnia-test/tests/git-sync/disabled-via-storage-rule.spec.ts b/packages/insomnia-test/tests/git-sync/disabled-via-storage-rule.spec.ts index 653e0a7db1..723d9b581e 100644 --- a/packages/insomnia-test/tests/git-sync/disabled-via-storage-rule.spec.ts +++ b/packages/insomnia-test/tests/git-sync/disabled-via-storage-rule.spec.ts @@ -15,9 +15,9 @@ test.afterAll(async () => { test( "Verify the create-project dialog shows a storage-restriction banner and disables the Git project type when Git Sync is disabled by org storage rule", async ({ user }) => { - const { workspacePage, projectSettingsPage } = user.pageManager; + const { workspacePage, projectSettingsPage, projectPage } = user.pageManager; - await workspacePage.clickNewProject(); + await projectPage.clickNewProject(); let bannerText: string | undefined; await expect diff --git a/packages/insomnia-test/tests/git-sync/pull-conflict-resolution.spec.ts b/packages/insomnia-test/tests/git-sync/pull-conflict-resolution.spec.ts index dd5c3fc089..116c01b7f8 100644 --- a/packages/insomnia-test/tests/git-sync/pull-conflict-resolution.spec.ts +++ b/packages/insomnia-test/tests/git-sync/pull-conflict-resolution.spec.ts @@ -14,7 +14,7 @@ for (const { version, keepsLocal } of [ user, }) => { const { gitSyncFlow, preferencesFlow, workspaceFlow } = user.flowManager; - const { gitSyncPage, workspacePage } = user.pageManager; + const { gitSyncPage, workspacePage, gitBranchesDialogPage } = user.pageManager; await preferencesFlow.addGitCredential(GIT_CREDENTIAL); const project = await workspaceFlow.cloneGitProject( @@ -31,7 +31,7 @@ for (const { version, keepsLocal } of [ await gitSyncFlow.commit(faker.string.alphanumeric(10)); await pushServerFile({ path: `${fileName}.yaml`, content: buildCollectionFile(remoteCollection.name) }); await gitSyncFlow.pull(); - await gitSyncPage.resolveMergeConflicts(version); + await gitBranchesDialogPage.resolveMergeConflicts(version); const keptCollection = keepsLocal ? localCollection : remoteCollection; await expect diff --git a/packages/insomnia-test/tests/konnect/configure-and-sync.spec.ts b/packages/insomnia-test/tests/konnect/configure-and-sync.spec.ts index 2cb03e473f..1e1e8f8bd1 100644 --- a/packages/insomnia-test/tests/konnect/configure-and-sync.spec.ts +++ b/packages/insomnia-test/tests/konnect/configure-and-sync.spec.ts @@ -14,9 +14,9 @@ test.afterAll(async () => { test( 'Verify configuring a Konnect PAT closes the settings modal, shows the Sync Konnect button, and leaves the Projects tab usable', async ({ user }) => { - const { konnectPage, workspacePage } = user.pageManager; + const { konnectPage, workspacePage, projectPage } = user.pageManager; - await workspacePage.switchOrganization('Control Planes'); + await projectPage.switchOrganization('Control Planes'); await konnectPage.openTab(); const introVisibleBeforeConfigure = await konnectPage.isIntroCardVisible(); await konnectPage.clickConfigure(); @@ -39,9 +39,9 @@ test( test( 'Verify the initial Konnect sync creates the control plane project and a collection for each gateway service', async ({ user }) => { - const { konnectPage, workspacePage } = user.pageManager; + const { konnectPage, workspacePage, projectPage } = user.pageManager; - await workspacePage.switchOrganization('Control Planes'); + await projectPage.switchOrganization('Control Planes'); await konnectPage.openTab(); await konnectPage.clickConfigure(); await konnectPage.setPat(`kpat_${faker.string.alphanumeric(20)}`); @@ -69,9 +69,9 @@ test( test( 'Verify syncing Konnect again after the first sync completes without errors', async ({ user }) => { - const { konnectPage, workspacePage } = user.pageManager; + const { konnectPage, workspacePage, projectPage } = user.pageManager; - await workspacePage.switchOrganization('Control Planes'); + await projectPage.switchOrganization('Control Planes'); await konnectPage.openTab(); await konnectPage.clickConfigure(); await konnectPage.setPat(`kpat_${faker.string.alphanumeric(20)}`);