Something went wrong. Try again.
An auto tiler for macOS
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253import AppKitimport ParcelCoreimport Testing
@testable import ParcelTestSupport
extension RealAppEndToEndTests { @Test(arguments: [true, false]) func gripSelectionAndMRUCloseKeepRealFixtureFrames(automaticTiling: Bool) async throws { var configuration = E2EConfiguration() configuration.windowCap = 1 try await withSession(configuration: configuration) { session in try Data((configuration.source + "[appearance]\nstack-controls='persistent'\n").utf8).write( to: session.configURL) let (fixture, _) = try await session.addFixture(arguments: [ "--windows", "3", "--title", "Segmented Grip Fixture", ]) try await session.startApp() let windows = try await session.settledWindows(for: fixture, count: 3) let workspace = try await session.workspace(for: windows) let stack = try #require(workspace.tiles?.stacks.first) let before = try session.frames(for: fixture) if !automaticTiling { try await session.command("toggle-automatic-tiling") } let selected = stack.windows[1] let closing = stack.windows[0] try await session.command("e2e-stack-input", "select", String(selected.rawValue)) try await waitUntil("a grip click raises its actual native fixture window") { let snapshot = try await fixture.snapshot() let target = snapshot.windows.first { $0.number == selected.rawValue } return try target?.index == snapshot.focusedWindow && NSWorkspace.shared.frontmostApplication?.processIdentifier == fixture.process.processIdentifier && (try session.frames(for: fixture)) == before } try await session.command("e2e-stack-input", "select", String(closing.rawValue)) try await waitUntil("another segment click raises its native fixture window") { let snapshot = try await fixture.snapshot() return try snapshot.windows.first { $0.number == closing.rawValue }?.index == snapshot.focusedWindow && (try session.frames(for: fixture)) == before } let snapshot = try await fixture.snapshot() let native = try #require(snapshot.windows.first { $0.number == closing.rawValue }) _ = try await fixture.control(FixtureControl(action: "close", window: native.index)) let expected = before.filter { $0.key != closing.rawValue } try await waitUntil("close raises the MRU fixture survivor without rearranging the tile") { let snapshot = try await fixture.snapshot() return try !snapshot.windows.contains { $0.number == closing.rawValue } && snapshot.windows.first { $0.number == selected.rawValue }?.index == snapshot.focusedWindow && (try session.frames(for: fixture)) == expected } } }}