Compatibility
Upstream parity target: tester-army/e2e commit ee901b333ed12352418dfb07bda5eafe32e71c8d (docs(agents): show several personas running one suite (#1258)). On 2026-10-19 the 300 upstream commits from 94ddbfe to it were checked: each commit’s title and release note against this file, and against the port’s code where the note named a behavior. A commit that only changes docs, tests of code the port lacks, dependencies, or release notes needs no entry. The sections were not re-read line by line against upstream’s source, so a statement that no commit in that range touched is as it was at 94ddbfe. The packages upstream has are in Upstream packages.
Names are C# versions of the JavaScript API: agent.act is ActAsync, screen.getByRole is GetByRole, expect(locator).toContainText is Expect.That(locator).ToContainTextAsync, and unique() is Values.Unique.
Package map
Section titled “Package map”| JavaScript | .NET |
|---|---|
e2e and @e2e-dev/web |
E2E (WebEngine is Playwright, in the same package) |
NUnit [Test] |
E2E.NUnit.E2ETest. The fixture commits the replay cache from the NUnit result |
xUnit v3 [Fact] |
E2E.XUnit.V3.E2ETest. The fixture commits the replay cache from the xUnit result |
e2e.config.ts |
e2e.config.json, the same keys as JSON. E2ETest finds and applies it; fixture properties override it |
| Vercel AI SDK model | OpenAiCompatibleModel, OpenAiResponsesModel, AnthropicModel, GoogleModel, and BedrockModel, built from provider in JSON or ModelProviders in code. See Models |
e2e/oauth/chatgpt, copilot, grok, opencode-console |
E2E.OAuth.Subscriptions |
e2e login, e2e logout, e2e models, e2e guide, e2e mcp, e2e explore, e2e init, e2e-web install |
E2E.Cli, a .NET tool whose command is e2e. e2e init is ported in part: see Coding agents. e2e explore is ported in part: see Explore. e2e guide [topic] prints the bundled skill, as upstream; an unknown topic exits 2. e2e-web install is e2e install: see Browser install command. e2e mcp is ported apart from project tools: see MCP server |
@e2e-dev/acp |
E2E.Acp, AcpExecutor: a step executor over the Agent Client Protocol. See ACP |
@e2e-dev/kernel |
E2E.Kernel, KernelProvider: Kernel hosted browsers on the IBrowserProvider seam. See Kernel |
@e2e-dev/eas |
E2E.Expo, ExpoSimulators: see Expo Simulators |
@e2e-dev/limrun |
E2E.Limrun, LimrunSimulators: see Limrun |
@e2e-dev/github |
E2E.GitHub, GitHubReporter: ported in part, see GitHub reporter |
@e2e-dev/browserstack |
E2E.BrowserStack, BrowserStackDevices: see BrowserStack |
@e2e-dev/mobile/lease (agentDeviceLeases()) |
E2E.Mobile.Lease, AgentDeviceLeases, in the E2E.Mobile package: see BrowserStack |
@e2e-dev/decision, @e2e-dev/smol, @e2e-dev/lightpanda |
Not ported: see Upstream packages |
| — | E2E.TestMu.Mobile, TestMu AI mobile devices through Appium. Upstream’s @e2e-dev/testmu serves the same devices another way: see TestMu mobile |
| — | E2E.Mobile.NUnit and E2E.Mobile.XUnit.V3, MobileAppTest: a ready base class for a device test. Not in upstream: see MobileAppTest |
| — | E2E.Mobile.DevFlow, DevFlowAgents: .NET MAUI apps through the MAUI DevFlow agent. Not in upstream: see MAUI DevFlow |
| — | E2E.WinApp, WinAppEngine: Windows desktop apps through Windows UI Automation. Not in upstream: see WinApp engine |
| — | E2E.WinApp.NUnit and E2E.WinApp.XUnit.V3, WinAppTest: a ready base class for a Windows app test. Not in upstream: see WinAppTest |
@e2e-dev/testmu (testmuBrowsers(), browsers.ts) |
E2E.TestMu, TestMuBrowsers: TestMu AI hosted browsers on the IBrowserProvider seam. Ported in part: see TestMu |
| — | DocumentEngine, an in-memory page for hosts that do not want a browser |
Ported
Section titled “Ported”- NUnit
[Test],[SetUp],[TearDown],[OneTimeSetUp], and[OneTimeTearDown] Assert.Ignore,[Retry],[Timeout], and[Category]- Screen queries: role, text, label, test id, placeholder, display value,
filter(hasText,hasNotText,has, andhasNot),or,first,last,nth. A locator offers every query kind, scoped to its matches’ descendants. Every query takes aTextMatch: a string or a .NETRegex, tested against the whitespace-normalized text. A string matches the whole text, case-sensitively, unlessexactis false, which makes it a case-insensitive substring, as upstream.RoleOptionscarriesname,checked,disabled,selected,expanded,pressed, andlevel, andimgis read asimage. A role query never matches a hidden node; the other kinds keep hidden nodes unlessVisibleis set, as upstream.ScrollIntoViewAsyncacts on a hidden or disabled match, as upstream’sperformUntilreads no state (the web engine’s Playwright call needs no visibility); every other action still waits for an enabled match. A text query leaves out a match with no box (aRectwith a zero side; a node that reports noRectcounts as boxed) when a match with a box exists, because upstream’s web tree lists no box-less node and this tree does (a zero-sized input inside a label does not stand in for the label). A label’s text is listed when its control has no box.getByLabelmatches any node whose accessible name matches, as the upstream reference resolver does. On the web, upstream resolves text, label, andhasTextthrough Playwright on the real DOM, and the port reads the same things off its tree:getByTextandhasTextmatch the element’s DOM text (every descendant’s text in place, no separator between two blocks, a button input’s value, script and style text left out), so a placeholder, a title, anaria-label, or the control a label names is no text, and the label itself answers;getByLabelmatches the node’saria-label, the elements itsaria-labelledbynames, and its<label>text, not its content. A regular expression is tested against that text with whitespace collapsed, where Playwright tests the raw text. Options are C# objects (RoleOptions,TextMatchOptions) instead of object literals, andfilter({ hasText, hasNotText, has, hasNot })is the overloadsFilter(TextMatch)andFilter(Locator)plusFilter(hasText, hasNotText, has, hasNot), whose four parameters are optional and named (.NET-only: the named-argument form of upstream’s options object).hasNotText(tester-army/e2e#1037,a481fd3) drops a match whose subtree text matches, withhasText’s substring rules (an empty string matches everything, so it drops every match).hasNot(#1334,6c8e71f) drops a match whose subtree resolves the inner locator, resolved inside each match ashasis, and a display-valuehasNotisUNSUPPORTED_CAPABILITYin the core resolver ashasis. AFilter()with none of the four isINVALID_LOCATOR(filter() requires hasText, hasNotText, has, and/or hasNot). Upstream’s refusal of an unknown key (visible) or a non-object options has no port, since the parameters are typed. On iOS a plain React NativeViewhas no children in the tree, sohasNotkeeps every such row (see the mobile guide) Regular expressions use .NET syntax, not ECMAScript.GetByTestIdalso takesExact, which upstream’sgetByTestIddoes not.locator.or(other)(upstream #1049) isOr(Locator): aunionexpression that matches either branch once, in document order, and stays strict (LOCATOR_AMBIGUOUS; addFirst()when both may match). Both locators must come from the same screen and attempt, elseINVALID_LOCATOR.LocatorResolver.ResolveandDeviceLocator.ResolveExpressionresolve the union. Differences: the parameter is typed, so upstream’s refusal of a non-locator has no port (nullis anArgumentNullException); and upstream’sUNSUPPORTED_CAPABILITYfor a display-value branch has no port, since the port’s engines resolve over their tree. Web branches with different frame-selector chains fail withUNSUPPORTED_CAPABILITY(locator.or requires both branches in the same document) as upstream’sframeSelectorsdoes - Actions: tap, click (an alias of tap), doubleTap (
DblClickAsyncis an alias), fill (a string or aSecret), pressSequentially, press, check, uncheck, clear, selectOption, focus, scrollIntoView. They wait up to the action timeout for exactly one enabled, visible match.selectOptiontakes a string that matches an option value or label, or aSelectOptionwith exactly one ofLabel,Value, or a nonnegativeIndex(upstream’s{ label },{ value },{ index }; the document engine refusesIndex). Upstream’s plain string means a label only; the port keeps matching a value or a label.ActionOptions.Timeoutoverrides the wait per action (PressSequentiallyOptionsaddsDelay).PressSequentiallyAsyncis composed in core as upstream’slocator.pressSequentiallyis (LocatorEngine.PressSequentiallyAsync, upstream’spressSequentiallyinlocator/engine.ts): aFocusaction, thenIEngineSession.TypeTextAsync(upstream’skeyboard.type) in one call, or one call per code point with aDelay, all within one action deadline. A pause the deadline cuts short ends the typing withACTION_FAILED(typing N of M characters), and no character goes out past it. An engine that does not listfocus, or declares noKeyboard, isUNSUPPORTED_CAPABILITYbefore any node resolves. The publicLocatorAction.PressSequentiallyrecord is gone (#1159, a breaking change): an engine receivesFocus, thenTypeTextAsync. Differences: there is noSecretoverload (upstream’s refusal of aSecretwithINVALID_ARGUMENTis a compile error here), and C# types rule out a non-string text and a malformed delay; the keyboard call takes no operation context, so the deadline bounds the pauses and the calls’ starts, not the engine call itself. The web engine’s own Playwright wait still uses the configured action timeout - Locator reads:
textContent,inputValue,getAttribute,isVisible,isHidden,isEnabled,isDisabled,isChecked,boundingBox,count,all,allTextContents. A read of one node (textContent,inputValue,getAttribute,isEnabled,isDisabled,isChecked,boundingBox) waits for its one match until the action timeout, then reads once with no retry for a value (inputValueon a node with no value, such as a heading or a button, andisCheckedon a node with no checked state fail withACTION_FAILED, as upstream, tester-army/e2e#1552d2556bc; a field with no value reads"", and a checkable role with no state reported readsfalse. The port reads the state throughNodeStates.CheckedReported, whichCheckedsets, where upstream readsstates.checked !== undefined(.NET-only); the web engine reports it for a native checkbox or radio and anyaria-checkednode, the mobile engine when the platform spells a state, and the Windows engine for a toggle state or a radio);isVisible,isHidden,count,all, andallTextContentsanswer from the current screen at once. No read verifies an earlieract.textContentandallTextContentscollapse each whitespace run to one space and trim, as upstream. A single-node read fails withLOCATOR_NOT_FOUNDwhen nothing matches before the action timeout ends screen.tree()andscreen.debug()(commitd7ec0ec) areScreen.TreeAsyncandScreen.DebugAsync. One observation of the whole screen, rendered byFailureEvidence.Listing(the trace’s screen at failure, upstream’sprepareObservation): one node per line, children indented, secrets redacted, cut at the observation byte limit (262144). A node the page does not show is left out. A step of kindscreen.DebugAsyncwrites the text toConsole.Out, where a test framework picks it up. Differences:Timeoutbounds the read with a linked token and fails withOPERATION_TIMEOUT, where upstream passes it to the engine operation. ALocatorhas noTreeAsync, so upstream’s refusal on a locator is a compile error. On aFrameScreenthey refuse withINVALID_ARGUMENT, as upstream’s do. The same commit’s change to print test output without thelistreporter, and to keep stdout for--reporter json, is not ported: the port has no runner.screen-tree.test.tsisScreenTree/ScreenTreeTestsandScreenDebugTests(not ported: the refusal on a locator, the unknown option, andsdk-types.ts’s checks, which a typed API makes compile errors);screen-tree-secrets.test.tsisScreenTreeSecrets/ScreenTreeTests(through a session over a fake engine).run-user-output.test.ts’s two new cases are not ported with the runner change.- The last read of a wait gets grace (
fix: give the last read of a wait the time of the slowest one,57f9ed9, tester-army/e2e#1464).Locator.WaitForAsync, a locatorExpect, andToHaveScreenshotAsyncread through aReadWindow(Internal/Time.cs, upstream’sReadWindowininternal/time.ts;LocatorEngine.Readsis upstream’sLocatorEngine.reads;Screen.Readsforwards to it). Each engine locate runs until the wait’s deadline plus the slowest read the wait finished (the budgetIEngineSession.LocateAsyncgets), capped by the test timeout (Screen.BudgetDeadline, upstream’sbudget.deadline), so a screen that shows up during a slow last read passes.Time.PollReadsAsyncispollReads, andPollConditionAsyncispollConditionover a window with no cap. A read the deadline cut off isReadWindow.CutOff: anOPERATION_TIMEOUTof a read that started with under one poll tick, or under the slowest read, left (it replacescutOffAtDeadline). A negation counts as held only until the deadline.LocatorEngine.ResolveExactlyOneAsyncand the other waiting resolves end a wait whose last read was cut off after a read that found nothing asLOCATOR_NOT_FOUND, not asACTION_FAILED, and a retry the deadline cut off ends on the failure it was retrying (upstream’sresolveCountedandresolveOnce). An action whose deadline passed before it was sent fails withACTION_FAILED(upstream’slateAction). A capture ofToHaveScreenshotAsyncthat outlives its budget is anOPERATION_TIMEOUTthe poll judges as it judges any read; the message of a failure with no capture isthe last screenshot ran past the timeout. Differences: the port polls every 50 ms in the locator and 100 ms in screenshots where upstream polls every 100 ms. An engine is handed the read’s budget byIEngineSession.LocateAsync,ObserveAsync(TimeSpan, CancellationToken), andScreenshotAsync(TimeSpan, CancellationToken)(see the operation budget bullet in the mobile section); an engine that does not override the last two (the web and WinApp engines) drops it, so the window only times its read (a screenshot is cancelled at its budget).Locator.WaitForAsyncfails withLOCATOR_NOT_FOUND, as upstream. A positioned tap whose target became visible past the deadline isACTION_FAILEDtoo (LocatorEngine.PerformWithinAsync, upstream’sperformWithin). Tests:Time/PollConditionTests(the fivepollReadsandReadWindowits),LocatorWaitFor/ASlowLastReadTests,LocatorEngine/LocatorEngineResolveRetryContractTestsandLocatorEnginePerformContractTests(‘never sends an action whose target resolved past the deadline’), andScreenshotAssertions/ToHaveScreenshotTests(the two capture-timeout its). locator.waitForwithattached,detached,visible(default), andhidden, asWaitForAsync(new LocatorWaitForOptions { State, Timeout }). The timeout defaults to the action timeout.LocatorWaitForOptionsis named apart fromagent.waitFor’sWaitForOptions. A timeout fails withLOCATOR_NOT_FOUND(locator did not become <state>: <locator>), and a passingwaitForverifies an earlieract, as upstream (verifies: trueisScreen.NotifyVerified). The timeout carriesDetailsas upstream’s does (the locator, what it asked for, and how long it waited; see Trace page)- Locator expectations: visible, hidden, attached, enabled, disabled, checked, selected, expanded, focused, text, contained text, value, attribute, accessible name, and count. They poll until the assertion timeout, or the matcher’s own
timeout.Notinverts a matcher, which then passes after 1000 ms of continuous truth (or the whole budget when it is shorter). Text matchers take the sameTextMatchas queries,ignoreCase, and a list form. The boolean flags arevisible,attached,enabled, andisChecked(checkedis a C# keyword) toHaveScreenshotasExpect.That(Screen).ToHaveScreenshotAsync(name, options)and the same on a locator, withNotandExpect.Soft(locator); see Visual comparisonexpect.softfor every locator expectation, asExpect.Soft(locator), including.Notand the per-matchertimeout. AnASSERTION_FAILEDis kept and the body runs on; any other error still throws.E2ETestrecords each one on the NUnit result, as insideAssert.EnterMultipleScope, so the test fails when the body ends and lists every failure.E2E.XUnit.V3.E2ETestkeeps them on the session and fails the test when it is disposed. As upstream, a failed soft assertion outranks a skip:Assert.IgnoreorAssert.Inconclusiveafter one fails the test in NUnit, and the message keeps the skip reason beside the failures. In xUnit v3,Assert.Skipafter one fails the test the same way. Other hosts setE2ESessionOptions.OnSoftFailureor callE2ESession.CloseSoftFailuresexpect(browser)asExpect.That(Browser):ToHaveURLAsync(a string or aRegex, withignoreCaseandtimeout),ToHaveTitleAsync(aTextMatch, withtimeout), andToHaveClassAsync(locator, TextMatch),.Not, andExpect.Soft(Browser). Like the locator matchers, a passing one verifies the previousact, and.Notpasses after 1000 ms of the opposite. A read that outlasts the matcher’s deadline ends it, so a page that stops answering fails at the assertion timeoutexpect.pollasExpect.Poll(read, options), withTimeout,Interval, andMessage. A read that throws is retried. The matchers areToBeAsync,ToSatisfyAsync, and.Not;E2E.NUnitaddsToMatchAsyncfor any NUnit constraint, such asIs.GreaterThan(3). The default timeout is 5 seconds, not the configured assertion timeout, because the poll does not see the running test, and it does not stop at the test deadline unless a cancellation token is passed (aTimeoutof zero waits for that token)- A call’s
TimeoutofTimeSpan.Zerosets no deadline of its own, astimeout: 0does upstream (feat(e2e): timeout 0 means no step deadline,d2953bb, tester-army/e2e#1554). Locator actions,WaitForAsync, locator and browser matchers,ToHaveScreenshotAsync,Screen.TreeAsyncandDebugAsync,Browser.GotoAsync,WaitForResponseAsync,WaitForDownloadAsync, andWaitForDownloadsAsyncwait until the test deadline instead of failing at once. A negativeTimeSpanisTestExceptionINVALID_ARGUMENTon every one of them (it wasArgumentOutOfRangeExceptionon some); an infiniteTimeSpanis negative, so it is refused too.Time.CheckStepTimeout,StepDeadline, andStepBudget(Internal/Time.cs, .NET-only; upstream’scheckStepTimeoutandstepTimeout) hold the rule. Upstream hands an engine authorstepTimeoutand builds the operation from it; the port hands an engine aTimeSpanbudget, soStepBudgetgives it what is left of the test deadline (at most a day, and a day when nothing bounds the test).Expect.Pollhas no attempt: withTimeout = TimeSpan.Zeroit polls until the cancellation token ends, and with a token that cannot end it throwsConfigurationExceptionINVALID_CONFIG(upstream: outside a test). A negativePollOptions.Timeout(an infinite one is negative) and a zero or negativePollOptions.IntervalthrowConfigurationExceptionINVALID_CONFIGbefore the first read, as upstream’scheckOptionsinexpect/poll.tsdoes (PollExpectation<T>.CheckOptions; the messages report milliseconds, andTimeout.InfiniteTimeSpanreadsInfinity). Upstream’s NaN andInfinitycases have noTimeSpanvalue. Not ported: the contributed-fixtureFixtureOperation.timeoutrule andwithTimeouttaking an infinite budget, because the port has neither. agent.act,agent.assert,agent.waitFor,agent.extract.ActOptionshasParams,Timeout,MaxSteps,MaxModelCalls, andAgent;AssertOptionshasParams,Timeout, andAgent;WaitForOptionshasParams,Timeout,Interval,MaxModelCalls, andAgent;ExtractOptionshasTimeoutandAgent. See Agents- Act tools
observe,scroll,scroll_to, andback. They are offered when the engine declaresEngineCapabilities.ScrollorEngineCapabilities.History.scroll_towith a target scrolls it into view. With text, it pages the viewport, or the target list, until a node reading the text is listed, then scrolls it into view. It reads each screen once when it has visibly scrolled, and reads again until it holds still otherwise (tester-army/e2e#1570,34f85c3:Reading.ReadPage,PageMoved, andPageLanded, withSettleOptions<T>.SettledWhenandObservationFeed.ObserveAsync(mode, name, settledWhen, token), upstream’slook(mode, settledWhen)). A page has landed when a third of its lines, two at least, are new and it is no sparser than the page before; a page that reads the same, differs by a line or two (a counter), or is thinner (rows still drawing) is read until it holds, and so is one whose rows differ by a clock-like value alone. A single changing time value (12:05) beside other text does not count as the list moving, so a clock ticking beside a list no longer delays its end: the call fails withLOCATOR_NOT_FOUNDafter a few swipes, not 800 screens later. The page a swipe is compared with is read from the tree alone (each node’s name, text, and place); the scroll position that earlier ports added to it is not part of it, as upstream. It stops when the screen stops moving - Replay cache for a verified
act: role, name, test id, and path. Modes areself-finalized,agent-concluded, andmissed Values.UniqueandSecret.Values.Uniquerejects an empty or whitespace value, and a value that spells a placeholder (it contains{{param:). A secret value has at least 6 code points:Secret.CreatethrowsINVALID_ARGUMENT, a config secretINVALID_CONFIG, andCredentials.UserINVALID_CONFIGfor a shortE2E_USER_*_PASSWORD. The values of the secrets anactreceived inParamsare redacted from every later prompt of the attempt, including theassert,waitFor, andextractstatement and the agent’ssystemandcontext. A secret filled through a locator, or read withSecrets.Getand never passed toact, is not added to that list. Redaction matches any case, JSON escapes, HTML character references, percent encoding, and collapsed inner whitespace. A known marker is never rewritten. The same secrets are redacted from the node names and test ids anactrecords as targets and end anchors in its replay cache entry, and a target, on replay or from the model, is matched against the screen in that redacted form. The same secrets are redacted from the failed matcher messages of locators andExpect.That(Browser), atoHaveScreenshotfailure, alocator.waitFortimeout, the soft-failure aggregate, and the messages of the inner exceptions under them. Upstream redacts error text once, at its report boundary (serializeError), which the port has not, so each of these places redacts its own text. The aggregate redacts when the test ends, so a secret the attempt learned after a failure was kept is covered.expect.pollhas no session, so a poll failure redacts the secrets of every live session in the process, as upstream’ssetErrorRedactordoes for the process. A cause with a secret in its message is rebuilt with the redacted text and keeps its type and code when it is anEngineException,AgentException, orConfigurationException, otherwise it becomes aTestExceptionwith codeERROR, and loses its stack trace. A failed secret fill inWebEnginereports the Playwright message with the value and its fragments of 8 or more characters redacted. A node name cut at 256 characters, and a text or value cut at 512, that ends with the leading part of a secret (8 characters or more, or half of a shorter secret) shows that secret’s marker in its place, as upstream’sredactCutdoes, in the model’s snapshot, the recorded targets and anchors, and thelocateresult.StreamRedactorandRedactor.HoldFrom(upstream’sSecretLedger.holdFrom, withmaxFormLengthasMaxFormLength) hold back the tail of text written in pieces so a value split across two writes is still caught. The port’sRedactorplays upstream’sSecretLedgerhere (the port’s ownSecretLedgeronly wraps one for the MCP server), soStreamRedactortakes aRedactor(or aSecretLedger), and it takes bytes as aReadOnlySpan<byte>. Upstream uses them for what user code prints: a test worker’s stdout and stderr, and thee2e mcpprocess’s output. The port has no worker.e2e mcpreplacesConsole.OutandConsole.Errorwith writers intoMcpOutput(Mcp/Output.cs, upstream’smcp/output.ts): what user code prints reaches the operator’s stderr through oneStreamRedactorover the process’sSecretLedger, withWithholdDuringAsync(upstream’swithholdDuring, held while a config loads and withheld with a[warning] withheld N bytesline when the load fails),DuringCallAsync(upstream’sduringCall, releases a tail without a newline when the last tool call ends),Log,ReportandEnd. .NET-only:McpOutputWriterandOutputStream(upstream patchesprocess.stdout.write), andSessionHostOptions.Secrets(upstream’sprocessSecretsis a module global). An error nobody caught (AppDomain.UnhandledException) is logged redacted and ends the server with exit code 1. An unobserved task exception (TaskScheduler.UnobservedTaskException, which fires only when the GC finalizes the task) is logged redacted and does not end the server, since .NET never ended a process for it; upstream ends the server on an unhandled rejection except abandoned and stray ones, which the port has not. .NET-only: theStreamRedactorconstructors that take aFunc<Redactor>or aSecretLedger, so it sees secrets registered after it was created. The server’s own messages are redacted whole where they are writtenapp.open,app.back,app.restart,app.clearState, andapp.baseUrl(App.BaseUrl, with no trailing slash as upstream #1479:$"{App.BaseUrl}/api/users"joins with one slash, andOpenAsyncstill resolves a relative URL againstapp.urlas declared, so a base path keeps its last segment only with a trailing/;Urls.BaseUrlOfis upstream’sbaseUrlOf), and the contextplatform.app.restartandapp.clearStatereopen the base URL inside their own step, as upstream’ssteer, so noapp.openstep follows them- The
browserfixture subset:goto,reload,back,forward,url,title,waitForURL,evaluate,waitForResponse,route,unroute,unrouteAll,cookies,setCookies,clearCookies,setViewport,emulateMedia,addInitScript,keyboard.press,keyboard.type,keyboard.down,keyboard.up, andmouse.move,wheel,down,up presskeys are checked in core, as upstream’srequireKey(internal/keys.ts,Keys.RequireKey) does:Locator.PressAsyncchecks the key before the node is resolved (inLocatorEngine.CheckAction, upstream’scheckAction), and the agent’spressandpressKeycheck it in the dispatcher before the action is committed. A key outside the grammar (KeyGrammar.Parse, upstream’sparseKey: zero or more modifiers and one key joined by+) isINVALID_ARGUMENTon every engine, where the mobile and Windows engines alone refused it withUNSUPPORTED_CAPABILITY(those checks stay, as upstream’s engines keep theirs).Locator.PressAsyncno longer throws anArgumentExceptionfor an empty or blank key:""isINVALID_ARGUMENTlike any key outside the grammar, and" "is a space character key.Browser.Keyboard.PressAsynctakes any Playwright key (Alt+KeyA), as upstream’sbrowser.keyboarddoes, and is not checked. The agent’spressstill refuses an empty or blank key first withpress requires a key(a .NET-only pre-check).- Agent budgets:
ActOptions.MaxSteps,ActOptions.MaxModelCalls, andWaitForOptions.MaxModelCalls. A per-call budget can only lower the agent’s configured one. A higher or non-positive value throwsINVALID_ARGUMENT - An
actpast its action budget endsSTEP_BUDGET_EXHAUSTED, blocked. The model is told and may still conclude: a passing verdict, or a failure without a code, becomes the budget error. Replayed actions draw on the same budget.navigate,back,scroll, andscroll_totake a slot;observedoes not. Anactwhose tool loop uses every model turn without adonecall endsSTEP_NO_CONCLUSION, a failed verdict, as upstream’s does (see the tool loop bullet); an executor that records one model call more than the budget allows still endsSTEP_BUDGET_EXHAUSTED, blocked (agent.act exhausted its model-call budget of N) - As upstream, an
actguards against a model that repeats itself. The same call with the same input 3 times in a row, or a sequence of 2 to 4 calls twice, adds a warning. 5 identical calls, or a sequence 3 times, offers the model onlydone, so it still writes its own verdict. Thedonecall never counts. The failure streak is upstream’scheckFailureStreak(LoopGuards.CheckFailureStreak, tester-army/e2eloop-guards.tsatf4be1c4): 3 failed calls in a row add a notice, 5 offer the model onlydone, and a call that worked starts the count over. Differences: the loop knows from each tool’s result whether the call failed (GuardToolResult), so it does not parse result text (isFailedResultandextractToolResultsare not ported, and theits of thefailure streakdescribe that read text are not ported). The thresholds are upstream’sLoopGuardThresholdsandDEFAULT_LOOP_GUARD_THRESHOLDS(LoopGuards.DefaultLoopGuardThresholds), andCheckLoopGuardsandCheckFailureStreaktake an optionalthresholdsargument; the loop passes none, and the type is internal, so no public option exposes it. A turn with no tool call counts as a failure. An executor’s transcript is kept only underE2E_DEBUG=1, as upstream keeps it under--debug. ActResult.ModelCalls(0 for a full replay) andActResult.Actions(replayed and live actions, counting failed attempts)AgentException.BlockedandAgentException.Explanation(the same text asMessage)- OpenAI-compatible tool calling
Replay cache
Section titled “Replay cache”- A
Values.Uniquevalue is recorded as upstream’s placeholder,{{param:<pointer>}}for the value as typed and{{param:<pointer>|<encoding>}}for another spelling (CacheKeys.TemplateText,CacheKeys.ExpandText,CacheKeys.ParamPointer;PlaceholderPrefixis upstream’sPLACEHOLDER_PREFIX). The pointer is RFC 6901 and reaches a value at any depth of the params (/name,/a~1b,/owner/tags/1):ActParams.ValidateParamsis upstream’svalidateParamsand lists eachValues.Uniquewith its pointer, in dictionaries, lists and arrays (a value inside a plain object is found under the serializer’s property names, which the key’s pointers may not match). An entry written before this used U+0001 slots (\u0001name|uri\u0001); replay policy version 5 (and 6) keeps those entries from being read, so the step records again. A placeholder a call cannot fill (it names a param the call did not mark, an encoding the codec does not know, or a value that encoding cannot spell, as an unpaired surrogate has nourispelling) makes the entry a miss asinvalid-entry, as upstream’sexpandTextandexpandTracedo. The entry is expanded whole when it is read (CacheKeys.ExpandTrace, upstream’sexpandTrace, overTrace.MapTraceText, upstream’smapTraceTextincache/trace.ts), so the replay runs the expanded copy and a passing replay keeps the entry as stored. The texts it maps are the typed or selected value, the navigated URL, the scroll text, the upload paths, the target descriptors (Name,TestId), the anchors (Name,Text,TestId,Placeholder,Value), and the start and end routes; the marker of a secret fill is a name, not text, and is left alone, as upstream’stypeSecretmaps its target only. An end anchor that names a unique value is recorded with its slot like any other text (upstream’sdescribeDeltaskips none). A recording made before this lacks that anchor. A replay of it can hand the step back at the end check, because the screen’s alert or status naming the unique value is now an anchor the entry does not hold, and the step then records again (an anchor-recording change; upstream’sREPLAY_POLICY_VERSIONincache/relocate.tsis bumped for matching-rule changes, and its anchor changes such as #1447 did not touch it, so this change adds no bump of its own: the policy version stays at 6, which the placeholder grammar change set). A step records its texts raw, as it saw them (redacted), and the finished entry is templated once (CacheKeys.TemplateTrace, upstream’stemplateTrace): it returns no entry when a text already spells a placeholder or two marked params share a spelling (SpellingsDistinct, upstream’sspellingsDistinct), and the step then writes no recording. A target named throughValues.Uniqueis found again because the replay looks it up expanded. An action’s recordedSummaryis templated like the other texts (upstream’smapTraceTextmapssummary); the port records no verdict summary, so that part of upstream’s summary templating has nothing to template.RecordedAction.WithinandRecordedTarget.Withinare templated like the other descriptor texts (upstream’sDESCRIPTOR_TEXT_FIELDSlistswithin). An anchor’sTestIdandPlaceholderare templated now too, as upstream’sDESCRIPTOR_TEXT_FIELDSsay; a recording whose anchor held a unique value there was written with the value as it was. The key and the format of an entry are the same, and the replay policy version is not bumped. An anchor is compared with the screen’s own anchors after the entry is expanded, so both hold this run’s text. A param key that holds}}, a line break, or|does not round-trip, as in upstream’s regex andparsePlaceholder. Undercache.strict, a call whose unique value cannot be spelled in an encoding the entry uses fails asREPLAY_STALEwith the reasoninvalid-entry. Each value is looked for in recorded text in up to five spellings, each with its own placeholder: as typed, percent-encoded as a URL path spells it (|uri,encodeURIComponent, so a space is%20), form-encoded as a query spells it (|form), as the slug an app derives for a record path (|slug: lowercase, letters and digits kept, every other run one dash, none at either end; a value whose slug is empty has none), and on one line (|flat, upstream’sflatencoding from #1452,TextRules.Normalizeas upstream’snormalizeText). Theflatslot is for a multi-line value, which the screen and the end anchors show on one line; a replay fills it with this run’s value on one line, so the end check looks for it there and no longer misses. A spelling equal to one already taken is not given a slot. As upstream’stemplateTextdoes with its literal segments,CacheKeys.TemplateTextnever looks for a value inside a slot it wrote a moment earlier: a shorter value, such asull, is not found in the slot of a longer one.CacheKeys.ExpandTextfills every placeholder in one pass (a regex, as upstream’sexpandTextis one regex pass), so a filled value is never read again.CacheKeys.TemplatesCollide(upstream’stemplatesCollide, theparam-collisioncheck) takes the params asActParams.ValidateParamsreads them and compares every one of those spellings against every unmarked scalar leaf at any depth (a string, a number as its JSON text, a flag astrueorfalse, a secret’s kind, name and purpose), so a plain"Ada Lovelace"param next toValues.Unique("Ada\nLovelace"), or a7inside a list next to a marked7, is not recorded. The port’sCacheKeys.TemplateTextandCacheKeys.ExpandTextdo this where upstream’stemplateText,expandTextandENCODERS(cache/template.ts) do. Upstream’sdocs/cache.mdxline is mirrored inskills/e2e-dotnet/references/agent.md; the docs site has no cache guide. E2E_CACHE_DIRreplacescache.diras upstream’s does: it resolves from the config directory, a leading~or~/is the home directory, a blank value is ignored, and the cache mode stays as configured.E2E_NO_CACHE=1(ortrue) is upstream’s--no-cache(noCacheof the run options,cli.cache = 'off'inrun/runner.ts, resolved inconfig/resolve.ts):ReadCacheturns the cacheoffwhatever the config says, in CI too, even beside acache.store, and a directory override leaves itoff. The name is .NET-only (the test host has no flag); the modes testPartial_no_cache_overrides_the_config_...is partial until the run and report seam of upstream’srunExistingis extracted (#1336);--cache-dir(#1337,cli.cacheDirofconfig/resolve.ts,resolveCacheDir) isCliOverrides.CacheDirand, for the test host, the .NET-only variableE2E_CACHE_DIR_OVERRIDE: it wins overE2E_CACHE_DIRandcache.dir, a leading~is the home directory, a blank value isINVALID_CONFIG(--cache-dir must be a non-empty path; an empty variable is unset),WithCacheStorerefuses it beside a store (--cache-dir names a file store directory, but cache.store replaces the file store; drop one), andOutputnames--cache-dirin the overlap errors (CacheConfig.DirectorySource).e2e cache --cache-dirpasses the same override toE2EConfig.Load, so it now reads~and refuses a blank value as a run does. Not ported:--cache-dirone2e run(the port has no such command).ReadCacheis upstream’sresolveCacheConfigand reads both through the config’s environment, so a host config reads them as well.- A passing locator expectation,
agent.assert, oragent.waitForafteractverifies it, and a verified act is written. Locator reads andagent.extractverify nothing.agent.assert,waitFor, andextractalways run live. As upstream, verification stops when the test fails, so a check in a derived[TearDown]after a failure records nothing. - Replay runs
backand a viewport scroll as recorded, re-finds a scrolled list before each repeat, and pages again for ascroll_totext. Consecutive identical scrolls are recorded as one action with a repeat count.observeis not recorded. A recorded list scroll (and ascroll_towith a list) keeps the share of the viewport the list covered (spans, 0 to 1, from the node’s box and the viewport the engine reports, as upstream’sviewportShare). As upstream, a list that covered at least half the viewport (MAIN_LIST_SHARE) and cannot be re-found scrolls as the viewport does, for that repeat and every later one, and a smaller region (or a recording with no share) stops the replay. Every engine reports a viewport (Observation.Viewport): the web engine and the document engine as before, andDeviceSessionandWindowSessionthe size of the screen they measure every rect against (the known viewport, and the window’s size in points), so the fallback works on the mobile and Windows engines too. Upstream’s mobile surface returns the same size as its observation’sviewport; the Windows engine has no upstream. A mobile size is rounded to whole points, sinceTraceViewportis integral. The live scroll andscroll_tore-find a list the tree renumbered as upstream does (resolveScrollTarget,samePlace: the node itself, its descriptor, or the same-role node whose box overlaps the old one by at least half), and a lost list that covered at leastMAIN_LIST_SHAREof the viewport scrolls as the viewport. e2e cache ls,stats, andclear(#1347, tester-army/e2ecli/cache.ts) areE2E.CliCacheCommand(Runis upstream’scache;ResolveCacheDirectory,ReadContents,List,Stats,Clear,RemoveTemporaries,WarnAboutSkipped,FormatAge, andFormatBytesare upstream’s functions;CacheDirDescriptionisCACHE_DIR_DESCRIPTION). .NET-only:CacheCommand.Run’scwdandenvarguments (test seams), and the--cache-dirflag, which lives one2e cachealone because the port has noe2e runto share it with. Differences:AGEis the entry file’s last write time, since the port’s entries carry nocreatedAt;INSTRUCTIONis the digest (Identity.InstructionDigest) of the instruction the entry stores, where upstream stores the digest inrecordedFor.instructionDigest; theTESTcolumn is the entry’s test title; the config ise2e.config.json(no.tsdiscovery); the refusal of a customcache.storeis not ported, since the config file cannot name one. Tests:CliCache/ports 12 of the 13itofcli-cache.test.ts(not ported: ‘refuses a custom store it cannot enumerate’); ‘records one entry per target and lists both’ inTraceCacheReplay/now asserts the listing.- When a replay ends in
end-mismatchand the agent repairs it with more actions, the entry is evicted instead of rewritten; the next clean run records the flow again. - The key holds the cache schema, the replay policy version, the test, the engine (its
IEngine.Name, never its version, as upstream sincee77c17a; the key also holds the platform), the instruction, the params, the agent’s name, a SHA-256 digest of the agent’scontextwith the known secrets redacted, and the repeat index. Another agent, or a changed context, records again. The repeat index counts per agent and context. Replay policy version 6 re-keys every entry, so the first run after the upgrade records them again: an entry recorded before version 5 may hold a page load as its delta, or a unique() value as the old U+0001 slot (see the placeholder grammar below). - A recording checks the step’s delta, as upstream: up to eight nodes that appeared and up to eight that went away, alerts and status messages first, each with its value (never a secure field’s), secrets redacted from names and values, and its
checked,expanded,pressed, andselectedstates. A node counts as gone only when no node on the end screen still matches its anchor. A replay passes on its own only when the end route matches, every appeared node is present, every gone node is absent, at least one of those changes happened during the replay (counted from the first screen the replay saw on the route it ended on), and no alert shows that was not there before and that the recording never saw. The web engine does not observe Next.js App Router’s route announcer (thenext-route-announcerelement), so its title echo never counts as an alert. A value the replay typed counts as a change only when the step changed nothing else. An alert’s dates, times, durations, and ids are read as placeholders. A step that changed no node and stayed on its route records nothing, and an entry read for an act that then passed with nothing to record is evicted. - As upstream, each side lists alerts and status messages first, then leaves, then containers. It skips text that reads differently on every run (ids, durations, dates, ISO 8601 instants, clock times, bare numbers, and a count that is the data rather than the step’s result) while a stable anchor remains. An anchor is a visible node with a name, a text, a test id, or a placeholder, and records its role, name, text (when it differs from the name), test id, placeholder, input purpose, value, and states. A node the other fields identify is matched without its test id, so a test id that changed between renders is forgiven; a node with only a test id is matched by it. The screen a step passed on is read once it holds still. Upstream reads a recording’s delta from the step’s settled start screen, and measures a replay’s evidence from the replay’s start. The port reads both from the screen the step’s first action was resolved against: a page that shows a loading state for a few hundred milliseconds after
loadholds still long enough to pass a held-still look, and a delta read from it is the page load, which a replay finds again before its own effect renders. A step that resumes a replay reads its delta from the screen the replay’s first action was taken on. - Older recordings and unique-value anchors. A recording made before an end anchor could hold a
Values.Uniquevalue lacks that anchor. If the screen now shows analertoralertdialognaming the value,Anchors.Mismatchreports it as an unrecorded alert and the end check fails (end-mismatch): the step hands back and records again, and undercache.strictit fails asREPLAY_STALE. Astatus(or any other role) the entry does not hold is not checked: when the entry’s other anchors hold, the replay passes without reading the unique value in that status. Clear that entry from.e2e/cache/so it records again when that status must be checked. - Known limitation, as upstream (
alertShape,cache/anchors.ts): an alert is compared with its volatile parts masked as#(AlertShape, theVolatileSpans: ISO 8601 instants, countdowns, dates, and a minted-id-like token, a run of 12 or more letters, digits,_or-that holds both a letter and a digit). Now that an alert naming aValues.Uniquevalue is kept as an anchor, two different values that mask the same way compare equal: a unique value shaped like an id (E2E-20260101-ab12) replays against an alert that shows another such value, and the replay can finish on the wrong alert. The port keeps upstream’s masking; a value that must be checked exactly should be shown in a non-alert node. Upstream behaves the same, so it is not changed here. - A recorded action holds the key of the container its node sat in, as upstream’s
within(cache/trace.ts,Placementinagent/actions.ts):RecordedAction.Within, written aswithinin the entry.AgentActions.ContainerKeyis upstream’scontainerKeyandAgentActions.ParentsOfitsparentsOf(Agent/AgentActions.cs, foragent/actions.ts): the first leaf text of the nearestrow,listitem,article,group,region,dialog, ortabpanelthe node sits in, else that container’s own label, bounded to 80 characters, and nothing when that says no more than the node’s own name or when the container is a list of twin rows named after whichever renders first. The text is read redacted. The dispatcher records it for the node verbs (tap, double-tap, fill, clear, press, select, check, uncheck, upload, scroll into view), taken from the newest look that listed the node, andTraceRecorder.DescribeTargetredacts it again and bounds it. A replay finds the node withRelocate.RelocateDescriptor(see below): a node whose container key differs is no candidate, so the same “Delete” in another row is never taken, and a row that is gone istarget-not-found. An entry recorded before this holds no key and replays as it did. A recorded action also holds upstream’sposition(TracePosition,RecordedAction.PositionandRecordedTarget.Position, written asposition: { index, of }): where the target stood among the controls its own description matched on the screen it was acted on, recorded byActionDispatcher.PlacementOf(upstream’splacementOf) throughRelocate.DescribePosition(Cache/Relocate.cs, upstream’scache/relocate.ts), and read back as upstream’sreadPosition: two integers, the count from 1 toTrace.MaxTracePositionOf(1000), the index below it; a stored position that is not one makes the entryinvalid-entry. The descriptor also records the node’stextwhen it differs from its name (RecordedAction.Text, which ascrollUntiland atoolgap keep for their own text), itsplaceholder, and itsinputPurpose(TraceRecorder.DescribeTarget, upstream’sdescribeTarget). The summaries read them back (DefaultAgent.Describe, upstream’sdescribeForSummary):tap button "Delete" in "Budget draft",tap button "Set up" (2 of 3).Relocateis upstream’scache/relocate.ts(RelocateDescriptor,DescriptorTiers,TierView,FieldsEqual,IsRelocatableDescriptor,MaxPositionedTwins, and the test id shapes), takes the liveObservationand theRedactorwhere upstream takes a map of redacted nodes, and names nodes by their reference. A replay relocates every node action, drag end, scrolled list, and bare-point container withRelocate.RelocateDescriptor(Replay.Relocate, upstream’srelocateinagent/replay.ts;Replay.RelocatePairisrelocatePairandReplay.Retryableisretryable;ObservationFeed.RelocateandRefoundarefeed.relocateandrefound, which describe the stale node withTraceRecorder.DescribeTargetand relocate it). It tries the strict tier, then the semantic tier (a test id the app generated is forgiven when the other fields still identify the node), then the test id shape, and takes exactly one match, or the recordedpositionwhen its count is the live count. Ambiguity ends the replay at once (target-ambiguous), except for a descriptor with aposition: a form still rendering shows fewer twins than the recording counted, so the replay looks again (raw looks, untilReplayTimeout) and ends with the last failure. An anonymous node (a role only) is relocatable only by a place counted alone or inside a named container (Relocate.IsRelocatableDescriptor); otherwise it istarget-not-found, and a bare point recorded inside such a container is replayed as a bare point on a viewport of the recorded size (upstream’spointEnd). The end anchors use the same tiers (Anchors.AnchorInandAnchors.AppearedIn, upstream’sanchorInandappearedIn): an anchor that appeared is found on any tier, so a minted test id matches any node of its shape; one that went away stays exact (never the shape tier); an anchor known only by a minted test id is volatile; and the set key is the anchor’s loosest tier. Port-only:Relocate.NodeOf(the port names nodes by their reference where upstream looks the id up in its map of nodes),Replay.DescriptorOf(the port’s actions carry the descriptor fields flat), andObservationFeed.FindLike, which relocates throughRelocateDescriptorand also returns the candidates of an ambiguity for the act tools’LOCATOR_AMBIGUOUS. Not ported: theselector. A node counts as appeared only when no start node has its set key (Anchors.Describe), as upstream’sdescribeDeltacompares. An older build ignores a position it finds in an entry, which fails closed: it matches by role, name, and test id as before. The replay policy version stays at 6, as upstream’s: it did not change withwithin, and an entry without a key or a position is still valid under it. - Recorded action summaries (#1283, tester-army/e2e
agent/actions.tsdescribeAction,cache/recorder.ts,cache/trace.ts). Every recorded action holdsRecordedAction.Summary(upstream’ssummary): redacted, bounded (Trace.MaxTraceSummaryChars, 300, upstream’sMAX_TRACE_SUMMARY_CHARS) prose such astap the point (400, 260) on img "Map", written byAgentActions.DescribeAction(upstream’sdescribeAction) whenTraceRecorderrecords the action. A typed or selected value, key, URL and upload path pass through the redactor and are quoted to 40 characters; a secret fill readsfill secret "name" into .... A point action’s summary names the listed node that held it even when the trace drops an anonymous one (tap the point (400, 260) on group). A gap readstool seed_cart, and a run-time value gaptool type (run-time value)(upstream’sDERIVED_GAP_SUMMARY). AscrollUntilsays its page count (RecordedAction.Screens, internal and never stored, upstream’sscreens). A folded scroll keeps the first summary. A summary never poisons the trace (it is redacted, not a replay input).Trace.MapTraceTextmaps it, so a unique value in it is templated and expanded; one that cannot be mapped makes the entry null as upstream’s does. Differences: an entry stored before this holds no summary and is still read (upstream refuses an entry without one); a summary over 300 characters isinvalid-entry(upstream’sreadBoundedText). Not done: theOnActionevent and the hand-off notice still readDefaultAgent.Describe, not the recorded summary, so their prose can differ from upstream’sdescribeAction(for examplefillreads as its kind, and a scroll asscroll down x3); sharing the one function is #1344. Checked against upstream: a stored summary is only read as bounded text, never compared with its action (trace-read.ts:188); the trace schema staystrace-1(trace.ts:27); a secret fill quotes the secret’s name with no redaction (actions.ts:283,quoteatactions.ts:395). ActResult.CachecarriesReplayedActions,TotalActions, andNotRecorded(param-collision), as upstream’s step cache detail does. It also carriesDetail, as upstream’sstep.cache.detaildoes. On a step that read an entry it carriesRecordedBy, the model that recorded it, as upstream’sstep.cache.recordedBydoes (see Trace page). For a replay that stopped at an action it names the action as the hand-off notice does, withDefaultAgent.Describerather than the recorded summary (at action 2 of 3, tap button "Apply", then:and the first line of the error when the action threw). After anend-mismatchit names the recorded nodes that did not show (missing alert "Acme Notes"), the ones that did not go away (still showing ...), the alerts the recording never saw (unrecorded alert ...), or that the outcome already showed before the replay acted. A store whose read throws, or that returns an entry of another schema or with no actions, is a miss withinvalid-entry. As upstream’sstep-cache.tsdoes (outcome.executed === 0), a replay that stops before it performs any action is a miss whatever stopped it,action-failedandaction-uncertainincluded: outsidecache.strictthe executor starts from the top with no hand-off notice, and undercache.stricta miss other thangap,no-entry,truncated, or aninvalid-entryfrom a store whose read threw fails the step withREPLAY_STALE(StepTraceSession.ReplayEntryAsync,FailIfStale). Tests:TraceReplay/ReplayThroughTheActTests“A first action that fails is a miss, not a hand-off” and “A first action that may have committed is a miss, not a hand-off” (.NET-only: upstream has noitfor this).- Only the first attempt replays. A
[Retry]attempt runs live and still records, and its acts reportmissedwith reasonretry. Each[Repeat]iteration is a first attempt. - A recording that opens with
navigatereplays from any route. Any other recording needs the start route. - A location on the app’s own origin (the origin of
app.url) is recorded and compared as its path, query, and fragment (CacheRoute.AppLocation, upstream’sappLocationincache/route.ts), so a recording made on one port or host replays on another, as whenapp.urluses port 0. Any other origin stays part of the route. The session applies it where upstream’s host does inobserve(screenOf,agent/act.ts), throughStepCacheOptions.AppOrigin(.NET-only). A recording made before this holds its full origin inrouteandendRoute: it misses aswrong-contexton the first run and is re-recorded. An agentnavigateto a full URL on the app is recorded without the origin (CacheRoute.AppNavigation, upstream’sappNavigation), so the step replays where the app runs then; anything else stays as given, and so does a URL with credentials or a rest that would not open the same URL. The model’s link lines and the executor tree cut an app link the same way, so a path that opens with a doubled slash stays whole. .NET’sUrirejects a run of extra slashes after the scheme that the web’s URL parser skips (http:////host/x), soAppNavigationremoves them before it parses;AppLocationstill keeps such a URL as given. A recording made before this holds the full URL in itsnavigateaction: re-record it to follow the app to another origin. - At the end of an attempt that passed, failed, or was skipped, verified acts are written and the unverified acts that recorded or replayed are evicted. An act that missed the cache and then failed leaves its key alone. A model outage or a cancelled test writes and evicts nothing, unless an assertion also failed on the app: then the unverified acts are evicted. An act is reported evicted only once the store deleted its entry (see “Recording outcome” under Trace page).
- An entry that a verified replay finished, or that already holds the same flow, is not rewritten, except to write in the step fields an older entry lacks.
- As upstream, the screen is read by one settle policy per action, for live acts and replays. After a tap, a key press, a select, a check, a navigation, or a back, the next settled look waits up to 2 s for the screen to leave the shape the action was resolved against, then reads until two looks 75 ms apart agree, for at most 1 s. After a fill it waits for the change only; after a scroll, up to 500 ms; after a secret fill, for no change. Node references, focus, and clock-like values do not count as a change, and after an action an empty document does not count as a settled screen. Upstream also counts a screenshot as the shape; the port counts the scroll position instead, so a scroll that moves no node still ends the change wait. An act’s start, the screen after each action, each page of a
scroll_towith a text (read once when it has visibly landed, see the act tools above), and the recording’s end screen are held still; a replay settles the look before each action as the previous action’s policy asks, takes a held-still look between the repeats of a scroll, and reads the end state raw. - A replay waits up to
ReplayTimeout(15 s; a .NET-only fixture property, not a config key) for each recorded target and for the end route. The recorded end state then gets whatReplay.VerifyEndState(upstream’sverifyEndState) gives it: the settling backoff (looks 100, 300, 600, 1000, then every 3000 ms apart) insideReplayTimeout, then, up to the entry’sendWaitMs, a look every second, while the step clock keeps 20 s in reserve for a hand-off. An entry recordsendWaitMsas the time from its last action (or the executor’s verdict after a hand-off) to the staging read, plus a 10 s margin, at most 120 s; an entry without it waits for the backoff only. A target is still looked for every 20 ms, where upstream backs off. FileStepCache.Writeis upstream’sFileCacheStore.write(cache/store.ts): it writes the entry throughAtomicWrite.WriteFileAtomic, a sibling temporary file moved over the entry file, so a crashed or concurrent writer leaves no torn entry, and two writers on one key leave the last write, as upstream’s store documents. Upstream’s store awaitswriteFileAtomic;IStepCache.Writeis synchronous, so the port uses the synchronous twin (upstream’swriteFileAtomicSync, which its CLI and telemetry stores use). Windows-only difference: a POSIX rename replaces the target in one step, but Windows refuses a move over a file that another move is replacing (ERROR_ACCESS_DENIED) or that a reader holds open (ERROR_SHARING_VIOLATION). Upstream’srenamedoes not retry, so there the losing writer throws and the recording is lost. The port retries such a move up to ten times with a growing pause (about 90 ms in all) before the error is the writer’s, so the write lands and the step reportsSavedwhere it would have reportedNotWritten. A denial that lasts, such as a read-only target, reports the same error after the same wait; any other error reports at once; on other systems the retry never runs. .NET-only names:AtomicWrite.MoveAttempts,AccessDenied,SharingViolation, andRetriesMove(the Windows errors and the retry),Utf8(the encoding both twins write with), andTemporaryPath(upstream’stemporaryPath).- Truncated recordings (tester-army/e2e
trace-recorder,trace-cacheandstep-cachetests, #1187). A recording that cannot be stored faithfully is flaggedCacheEntry.Truncated(upstream’struncated) and never replays:Decide.DecideTraceReplayanswersmisswith the reasontruncated(before the start-path check), so the executor runs the step from the top with nothing replayed, also undercache.strict(truncatedis not a stale reason, as upstream’sSTALE_REASONSomits it), andFileStepCache.UnderAnotherKeynever counts a truncated entry as the recording a changed key hid (upstream’srekeyed.ts). The entry is still written, as upstream writes it.TraceRecorder(upstream’sTraceRecorder) poisons the trace in four cases: an action past the cap (Trace.MaxTraceActions, 50, upstream’sMAX_TRACE_ACTIONS; the constructor’smaxActionsis upstream’s option of that name, and a scroll that folds into the one before it does not count), a replay input the redactor would alter (a typed, selected or navigated value, a key, an upload path, the text ascrollUntilpages toward, and the start and end routes: a registered secret in it) or one overTrace.MaxTraceInputChars(4,096; upstream’sverbatim, which keeps a redacted, bounded copy for documentation and never replays it), and a targeted action whose descriptor no replay could re-find (Relocate.IsRelocatableDescriptor: an unnamed twin that no named row or lone place tells apart, upstream’srequire). A secret fill holds its marker (<secret:name>), a name, so it is not a replay input and never poisons the trace. A secret value typed throughFillis poisoned, not stored: the entry holds the redacted copy andTruncated. The store’s read also refuses an entry over a cap, asinvalid-entry(upstream’sreadActionTrace,readAnchors,readStates): more than 50 actions, a typed value, URL, scroll text or route over 4,096 characters, more thanTrace.MaxTraceAnchors(8) anchors on a side of the delta, and anchor states that are notTrace.TraceAnchorStates(checked,expanded,pressed,selected), each once, in sorted order, never empty.Decide.OpensWithNavigateskips leading project-tool gaps as well as a resize, as upstream’sopensWithNavigatedoes. Differences:CacheEntry.HasValidCaps,RecordedAction.HasValidInputsandRecordedTarget.HasValidStatesare .NET-only names for the read checks, which sit beside the port’s otherHasValid*checks (the port validates at the replay, not in a reader);TraceRecorder.Record(RecordedAction)returns a copy, since a poisoned input is stored in its redacted form;Finalizetakes the routes unredacted and redacts them itself (upstream’sanchorPath), so the caller no longer does;Trace.IsSecretMarkeris internal now, for the recorder. Not ported: the checks of fields the port has no counterpart of (verdict summary, executor,createdAt, an action with no target). Tests:TraceRecorder/TraceRecorderTests(the three recorderits),TraceCache/DecideTraceReplayTests(the twodecideTraceReplayits),TraceCache/Trace1EntryTests(the cap and anchor state rejections, at the session seam like the resize ones),StepCache/StepTraceSessionTests(“misses a truncated entry”), and thecache.stricttests ofStepCache/(“still runs live … a recording too long to replay”, and the truncated half of “runs live when the only recording is truncated or records no step”)..NET-only:Keeps_a_secret_fill_marker_without_poisoning_the_trace(the port’s marker is afillvalue, upstream’stypeSecrethas its own field). - Secret fill policy events (#1331, upstream’s
authorizeSecretFill,agent/secrets.ts).ActionDispatcher.AuthorizeSecretFillrecords one policy event on the step for each decision, throughPhases.RecordPolicyEvent(the mechanism ofupload.path):secret.registered(denied,AUTH_CREDENTIAL_UNAVAILABLE),secret.sink(denied,POLICY_DENIED: a disabled field or one that is not editable),secret.purpose(denied,POLICY_DENIED) andsecret.fill(allowed). A live fill records them on each authorization (the stale retry authorizes again); a replayed fill (ActReplayHost) authorizes once, before its fill, so it records one set. An event holds a name, a decision and a code, never the value. Upstream passes aSecretFillHostand resolves the value insideauthorizeSecretFill; the port keeps its provider call after the authorization. Upstream’sunavailableCodehas no counterpart: the port always usesAUTH_CREDENTIAL_UNAVAILABLE.AgentInputStale/SecretFillStaleRetryTestsasserts thesecret.fillcount and staysPartial_(no action origin, nocredentials, no replay of a cached fill through a project runner);AgentSecrets/AuthorizeSecretFillTestsasserts thesecret.sinkevent and staysPartial_(no plaintext read to count). - A replayed secret fill looks the secret up among the secrets the step’s params declare, through the dispatcher’s own lookup (
ActionDispatcher.DeclaredSecret, upstream’sthis.options.secrets.get(name)intypeSecret,agent/action-dispatcher.ts), so a marker the step did not declare fails withPOLICY_DENIED(secret "<name>" was not declared in this step's params; only declared secrets can be filled), as a livetype_secretdoes (#1330). It wasAUTH_CREDENTIAL_UNAVAILABLE(Replay needs secret ...). The replay misses asaction-failed. Test:TraceReplay/ReplayThroughTheActTests.A_secret_marker_the_step_did_not_declare_misses_as_action_failed(.NET-only: no upstreamitcovers a replayed undeclared secret). cache.moderead-onlyreplays but never writes or evicts, including theend-mismatcheviction.offneither replays nor records. Undercache.strict, a stale recording fails the act withREPLAY_STALEand stays in place; a strict run never writes or evicts, and its retries replay. Ano-entrymiss fails too when the cache directory holds a recording of the same step under another key. Entries record the step as the test, the engine, the instruction, the params digest, the repeat index, and the agent; the port stores the target id (TargetId) as upstream does and also the engine, which upstream does not, and the instruction text where upstream stores its digest. Only an entry that records the whole step counts, and, outsidecache.strict, a verified whole replay inread-writemode writes the missing fields into an older entry. A customIStepCacheis not checked. The message names what changed between the entry’skeyedByand this run’s key context, as upstream’skeyContextChangesdoes, and says “the runner, the engine, the app, or the agent’s context” for an entry with nokeyedBy. The message ends with upstream’s advice (staleAdviceincache/context.ts, built byCacheContexts.CreateAgentCacheContextintoAgentCacheContext.Strict.Adviceand handed to the step cache asAttemptScope.StrictAdvice):re-record it with a read-write run with cache.strict set to false, thenand commit the changed entry under <dir>for a cache directory inside the project (shown relative to the project root, with/separators) or; the run writes the new entry under <dir>for one outside it (absolute), or; the run writes the new entry to the configured cache.storewhen a store replaces the directory.cache.dirandE2E_CACHE_DIRchange the directory it names. Differences: the port has no--strict-cacheflag (the internalCliOverrides.CacheStrictstands in for it, so only code can turn it on and the advice then readswithout --strict-cache, as upstream’s), socache.strictis the only knob a user can turn on;AgentCacheContexthas noclaimKey,staged, orstrict.recordings(AttemptScopeclaims keys, the step session lists the cache directory).TraceCacheConfig/ReplayStaleAdviceTestsports the threeREPLAY_STALE adviceits; the second names a--cache-diroutside the project throughCliOverrides.CacheDir.- The entry’s file name is upstream’s
traceCacheKeyHash(cache/identity.ts): the SHA-256 of the RFC 8785 canonical JSON of atrace-1key (buildTraceCacheKey) of the test, target, engine name and contract version, app identity, instruction digest (instructionDigest, normalized bynormalizeInstruction), params digest (paramsDigest), repeat index (createCallIndexer, counted per agent name and redacted context), agent, agent context digest, and replay policy version. The port’s key differs from upstream’s in these parts only:projectis the digest of the emptyprojectId(the port has noprojectId);appIdentityis upstream’stargetIdentity(Sessions.TargetIdentity): the digest of the target app’s resolvedidentity(the declaredapp.identity, else the URL’s origin and path as declared, a free port still:0, else the bundle id, else the build path) andenvironment; an app that declares neither keys on its URL and its host’s default environment, so recordings made beforeapp.identityandenvironment(which keyed on the empty declaration) miss asno-entryand must be re-recorded; a fixture that overridesBaseUrlkeys on that URL;testIdis the test title, not<file>::<title path>;targetIdis the target’s name andengineNamethe engine’sIEngine.Name(the port has no engine manifest).IEngine.Name(upstream’sengine.name) is a default interface member that returnsPlatform;MobileEnginenames itselfmobileas upstream’s does, so its key and the report’srun.targets[].enginereadmobilewhere they readiosorandroid, and an earlier mobile recording misses asno-entry. The replay policy version is not bumped, as upstream did not bump it for a key change (e77c17adropped the engine version from the key with a changeset only).WebEngineisweb,DocumentEnginedocument,WinAppEnginewindows;policyVersionis the port’s own6: version 5 followed the placeholder grammar ofcache/template.ts, so an entry written with the earlier U+0001 slots is never read, and its step records again; version 6 keys a secret param as upstream’svalidateParamsprojects it, so the next run records those steps again. Params are projected before the digest as the port’s cache has always projected them: aValues.Uniquevalue is its placeholder,{{param:<pointer>}}(upstream’stemplateParams,CacheKeys.TemplateParams, over the treeActParams.ValidateParamsprojects; no params digest as the empty object) and aSecretis{"kind":"secret","name":<name>,"purpose":<purpose>}(itspurposeonly when it has one), never its value; a number is written by .NET’s shortest round-trip form, which matches ECMAScript’s for the values a param holds. The entry storeskeyedBy(TraceKeyContext) as upstream does; an entry with a malformedkeyedBystill reads, without it. Recordings made before this key (the port’s former text-hash key) are not read and are not migrated: they miss asno-entryand must be re-recorded. Undercache.strictthey do not fail asREPLAY_STALEeither: the check matches the step by its recorded params digest, which the old entries hold in the old form, so the step runs live. - The entry stores
targetId(CacheEntry.TargetId, upstream’srecordedFor.targetId; bounded toMAX_TRACE_DESCRIPTOR_CHARSon write likeTestandAgent, and a blank, over-long, or non-text value makes the entryinvalid-entryas upstream’sreadProvenancedoes) next to its flatTest,Instruction,ParamsDigest,CallIndex, andAgent(upstream nests them underrecordedFor): the target’s name, masked like the test title, provenance a replay never reads; an entry recorded before it was stored holds none and reads as before. The port has noe2e cache ls, which lists it. The occurrence fields (ParamsDigest,CallIndex,Agent, upstream’srecordedFor.paramsDigest,callIndex,agent) are optional on read, and a confirmed whole replay of an entry that lacks them writes them in (E2ESession.CompleteProvenance, upstream’scompleteProvenance); a read-only run leaves it untouched.TraceCacheModesTests.Partial_caches_by_default_and_CI_demotes_...(#1287) now starts from such an entry and proves the CI-demoted replay leaves the file as it was; it stays partial only for the missingrunExisting(#1336).
Visual comparison
Section titled “Visual comparison”ToHaveScreenshotAsync compares the viewport, or one locator’s box, against <test file>-snapshots/<name>-<target>-<os>.png, with upstream’s names, OS suffixes (darwin, linux, win32), tolerance rules, retries until the screen matches or holds still, masks, and failure images. The pixel comparison is upstream’s (the pixelmatch threshold and anti-aliasing rules) over PNGs read and written with SkiaSharp. The ported testbed PNGs are upstream’s. Differences:
- A 16-bit PNG is read from its chunks (
ImageOps.ReadSixteenBitPng, .NET-only: Skia cannot hand out 16-bit samples) and each sample is scaled to 8 bits with upstream’s rounding (ImageOps.Narrow). Chromium writes 8-bit PNGs. Everything else upstream’s decode reads (tester-army/e2e#1587,34ccc5f) the port reads the same: gray at 1, 2, and 4 bits per sample, a palette at any depth with its alpha, and a gray or RGB image’s transparent color (tRNS), compared at the image’s own bit depth, so a 16-bit color is matched at 16 bits and its pixels come out with alpha 0. A PNG cut inside its end chunk, or whose end chunk has data or a wrong CRC, throws, as upstream’s decoder does (ImageOps.EndsWithIend, .NET-only: Skia decodes such a file). Bytes after a whole end chunk are accepted, as the decoder stops there.ImageOps.EncodePngthrows on a pixel buffer that does not fill the image, as upstream’sencodePngdoes. Not ported from that change: theIMAGE_CODEC_UNAVAILABLEerror andscreenshot-codec.test.ts(SkiaSharp ships its native library in the package, so there is no addon to fail to load). DocumentEnginethrowsUNSUPPORTED_CAPABILITY.MobileEngineover agent-device captures the masked screenshot withnormalizeStatusBaron, so the status bar is held fixed; the TestMu (Appium) and MAUI DevFlow clients ignore it and show the device’s real status bar.- The test file is the file the call is compiled in (
[CallerFilePath]), not a runner’s test entry. A call in a helper stores beside the helper. A build that rewrites source paths (DeterministicSourcePaths) breaks it. - The update flag is
E2E_UPDATE_SNAPSHOTS=1, or the fixture propertyUpdateSnapshots, in place of--update-snapshots(-u). There is no CLI flag or config key. - Failure images go to
.e2e/results/<result>/attempt-<n>/(the fixture propertyResultsDirectorymoves it). They are not attached to a step, because the port has no step report. A screenshot written earlier in the run is tracked per process, not per run directory. Expect.That(screen)is the only screen matcher, andExpect.Soft(screen)(SoftScreenExpect, withNot) keeps itsASSERTION_FAILEDas upstream’sexpect.soft(screen)does.Expect.That(frameScreen).ToHaveScreenshotAsync(the scopeBrowser.FrameLocatorreturns) fails withINVALID_ARGUMENT, as upstream’s does, andTreeAsyncandDebugAsyncon it do too (screen.tree reads the whole screen; call it on screen).- Secure fields are covered by the engine (Playwright masks, in every frame, including a field inside a closed shadow root, which the engine reaches through the
e2e-closed=selector engine it registers with Playwright before it opens a browser, and again in the default context of a browser it attaches to over CDP, because Playwright seeds custom selectors only in newly created contexts; upstream’sregisterCdpSelectors) and by painting the observed secure nodes. A closed root made by declarative shadow DOM (<template shadowrootmode="closed">) is parsed, not attached, so the hook never sees it and the mask cannot reach it, as upstream. The record counts as present when the init script defined it on the global (Symbol.for("e2e.closedShadowRoots") in globalThis), not byinstanceof WeakMap, so a page that replacesWeakMapkeeps its closed roots tracked (upstream #1448). Upstream’s cdp-recovery testmasks password fields in light and closed shadow DOM before and after reconnectports in full (CdpSessionRecoveryTests.Masks_password_fields_in_light_and_closed_shadow_DOM_before_and_after_reconnect), pixels included. Upstream’scdp-selectors.test.tsports in full except one check (CdpSelectorsTests): the duplicate-tolerance test ports as written, against a fake message channel (CdpSelectors.ISelectorChannel, a .NET-only seam over Playwright’s internal send, as upstream stubs_channel); the unsupported-context test isPartial_because the message names only the secure-field masks (the port’s locators do not use its selector engines). Upstream counts masked regions against secure nodes before it keeps the image; the port counts them (EngineScreenshot.MaskedRegionCount), and a vision judgment compares them (see Agents). - Breaking, upstream #1437 (
94e6e76): the pixel taint is gone. A secret fill no longer turns off screenshots for the model:Vision = OnandOnly, an executor’sObserveAsync(Pixels), the MCPscreenshottool, and thee2e explorefindings keep working after a sign-in. Removed:StepExecutorContext.PixelsTainted, the internalExposure(upstream’sSecretExposure),SavedSecrecy.Tainted, and thePIXEL_TAINTEDcode, whichVisionDegradation(E2Enamespace) andVision = Onlyno longer produce.E2E.Reports.VisionDegradation.PixelTaintedstays so a report an earlier version wrote still reads, as upstream’s schema keeps the value for old results. A screenshot masks secure fields only, and secret values are still redacted from all text. A generic secret in a plain input, or a value the app shows outside a secure field, is in the screenshot and reaches the model provider: use test credentials. The port has noSECURITY.md; upstream’s change to it is covered here, in the README, and in the skill. Upstream’s pixel fallback after a failed tree capture (pixelFallback) is ported (see Vision onact), and so are the point tools (see Point tools). - After a secret fill,
ToHaveScreenshotAsync, the assertion screenshots, and the failure screenshot stay on, as upstream since58a5cec. A model’s screenshots stay on too since94e6e76(#1437): the port has no pixel taint, so nothing is withheld after a fill. They mask secure fields only.ToHaveScreenshotAsyncfails withPOLICY_DENIEDand keeps no screenshot when the engine masked fewer regions than the screen lists secure nodes, or does not say (EngineScreenshot.MaskedRegionCountis null), as upstream’spixelsProvenMaskeddoes. The failure screenshot applies the same condition, but leaves the image out of the report instead of failing. - The name is a
string?and the options aScreenshotOptionsobject, so an unknown option and a non-locator mask cannot be written. - Locator boxes inside an iframe are in the top-level viewport (past the frame’s border and padding), where they used to be relative to the frame, as upstream’s change for this feature does.
Defaults
Section titled “Defaults”| Setting | Default | Upstream |
|---|---|---|
Test timeout (timeout) |
120 s | Same |
launchTimeout |
60 s | Same |
actionTimeout |
30 s | Same |
assertionTimeout |
5 s | Same |
cleanupTimeout |
30 s | Same |
maxModelCalls |
25 | Same |
maxSteps (actions per act) |
25 | Same |
judgmentTimeout (assert, waitFor, extract) |
30 s | Same |
waitFor interval |
3 s. After the first judgment, the judge runs again only on a changed screen | Same |
act timeout |
30 s (StepTimeout, .NET-only) |
The test timeout |
| Replay wait | 15 s (ReplayTimeout, .NET-only) |
15 s for the end route and the settling backoff; the end state then waits for the recorded endWaitMs |
expect.poll timeout |
5 s | The assertion timeout |
E2EDefaults holds these values, except the expect.poll timeout (PollOptions); E2EConfig, E2ESessionOptions, and E2ETest start from it.
Error codes that differ
Section titled “Error codes that differ”A test failure’s message carries its causes as upstream’s messageWithCauses (ErrorSerializer.MessageWithCauses, internal/errors.ts, #1208): the inner exceptions follow the message, innermost last, a message already present is not repeated, an AggregateException lists its members once each, joined by ; (fetch failed: ECONNREFUSED; connect ECONNREFUSED ::1:3000), and a cause with an empty message contributes its code. Upstream’s docs and skill say nothing about the cause chain (messageWithCauses appears only in packages/e2e/src/internal/errors.ts and its test; the ECONNREFUSED mention in docs/reference/engine-protocol.mdx and the AggregateError mentions in docs/reference/runner.mdx are about other things), so SKILL.md and the guides do not change. Differences: .NET keeps a cause’s code in Exception.Data["code"] (an exception has no code property), the walk stops after an aggregate (its InnerException is only its first member, which the aggregate already lists), and upstream’s non-Error cause (outer: text) has no counterpart because an InnerException is always an Exception; ClassifyErrorTests.Partial_Appends_the_cause_chain_... is Partial_ for that reason.
A locator reports an engine failure as upstream’s translateLocatorError (LocatorEngine.TranslateLocatorError, over ErrorSerializer.TranslateEngineError, upstream’s translateEngineError, internal/errors.ts) does, with the engine error as InnerException and the locator’s description added to the message (#846): NOT_ACTIONABLE and ACTION_MAY_HAVE_COMMITTED are ACTION_FAILED, OPERATION_TIMEOUT is ACTION_FAILED (operation timed out: <locator>), NODE_STALE and FRAME_NOT_FOUND are LOCATOR_NOT_FOUND, FRAME_AMBIGUOUS is LOCATOR_AMBIGUOUS, and INVALID_STATE is APP_NOT_OPEN. CANCELLED is an EngineException of that code (operation cancelled), UNSUPPORTED_CAPABILITY is a ConfigurationException (category configuration), and ENGINE_FAILURE, any other engine code, and an error that is no e2e error are an EngineException ENGINE_FAILURE (category infrastructure), each with the original error as InnerException, as upstream’s translateEngineError wraps them (#885). A recorded fixture step maps the engine error it throws the same way (FixtureRecording.Translated, upstream’s translated in run/fixture-recording.ts), with in <api> <label> as the suffix, so a timeout reads operation timed out in browser.goto <url>, ... in browser.waitForResponse "foo.css", or ... in app.open /orders (#1068, #1120). It covers every Browser step, every App step, and the device fixture’s steps (EngineFixtureContext.RunOperationAsync, upstream’s FixtureRecorder.run); a Browser, App, or fixture outside a session runs the call bare, like the surface upstream’s engine tests call. Browser.OnDialogAsync and the download waits ask for the browser session inside their step, so an engine with no browser is a ConfigurationException there as in GotoAsync. A caller’s cancel on a web session is an EngineException CANCELLED (operation cancelled), as upstream; screen and locator steps keep their own mapping (translateLocatorError). Differences: an OperationCanceledException is returned as it is, so a caller’s cancel stays a cancel. The port applies the translation to the locator’s resolve (including the resolve over an observation) and to its actions; it has no read by reference to translate. LocatorEngine (Locator/LocatorEngine.cs, upstream’s locator/engine.ts, #994) owns the resolve, the retries, the deadlines, the engine events, and the operation context a call carries (OperationContext.Test); Screen and Locator pass it their query. Differences: its session is the set of calls in LocatorEngineOptions (.NET-only: the attempt reads the screen through its scope), a locate answers the nodes themselves so read, readNow, readAllNow, and tryRead read a resolve and have no session.read to go stale, fillSecret is not an engine method (a secret fill is an engine action); pressSequentially is LocatorEngine.PressSequentiallyAsync (#1159), and DeadlineFor is upstream’s deadline (Deadline is the type’s name). LocatorEngine/ ports the read retry, resolve retry, perform, readAllNow, reads that do not wait, translateLocatorError, visible queries, isNodeVisible, and locator failure candidate counts (LocatorFailureCandidateCountsTests) describes; not ported: the its that need session.read to go stale (read retry 1 to 3, read contract, readAllNow stale and failure, readNow stale between resolve and read), secret fill (no engine fillSecret), AttemptBudget.capped (no AttemptBudget), and the cross-realm describe (no second module registry in .NET). A filtered locator that matches nothing or too many lists the candidates each filter step left (tester-army/e2e#1416, 79e2e13d3365): LocatorExpression.FilterSpine() is filterSpine (locator/expression.ts), and LocatorEngine.CandidateCountsAsync is candidateCounts, read by NotFoundAsync (notFound in resolveCounted) and AmbiguousAsync (singleOf, which replaces assertSingle), one immediate resolve per prefix of the chain under one 500 ms budget (StepCountBudget, STEP_COUNT_BUDGET_MS; Deadline.Min is Deadline.min). A walk that cannot finish says walk stopped after N of M steps, a read that fails drops the list, and a cancel surfaces as cancellation. Differences: the port’s failure messages are its own (<locator> matched 0 nodes.), so the list follows on a new line (candidates left after each filter step, counted after the failure:) where upstream continues after ; . The five filterSpine its are in Expression/LocatorExpressionsTests. An action whose engine call finds a retryable stale node resolves the locator again and repeats the action while its deadline remains, as upstream’s performUntil does; an action that may have committed is never repeated. An action whose deadline passed before it was sent is not sent: it fails with ACTION_FAILED (operation timed out before the tap was sent: <locator>), as upstream’s lateAction (#869). Tests: LocatorEngine/TranslateLocatorErrorMappingTableTests (the translateLocatorError mapping table describe; the seven rows with the port’s codes are Partial_) and the perform its of LocatorEngine/LocatorEnginePerformContractTests. All six perform its are ported; marks every action it performs with the test origin runs on the LocatorEngine itself (ScriptedLocatorEngine, upstream’s makeEngine), and a .NET-only test checks that E2ESession wires that origin to the engine a test’s step reaches (OriginRecordingEngine).
Locator actions
Section titled “Locator actions”locator.secondaryTap,longPress,hover,dragTo, andswipe(locator/screen.ts) areLocator.SecondaryTapAsync,LongPressAsync(LongPressOptions),HoverAsync,DragToAsync(Locator), andSwipeAsync(SwipeOptions), with the engine actionsLocatorAction.SecondaryTap,LongPress,Hover, andDragTobeside the existingSwipe.tap,doubleTap, andsecondaryTaptakeClickOptions { Modifiers }(upstream’sClickOptions, a subclass ofActionOptions); theActionOptionsoverloads ofTapAsync,ClickAsync,DoubleTapAsync, andDblClickAsyncstay, so existing calls compile. Modifiers on an engine withoutEngineCapabilities.TapModifiersareUNSUPPORTED_CAPABILITYinside the step, before the node resolves; the step label endswith Shift, as upstream’s.longPresstakes a whole number of milliseconds from 100 through 10000 (ArgumentOutOfRangeException, upstream’sINVALID_ARGUMENT).dragToresolves the drop locator inside the retry (Locator.ResolveExactlyOneAsync, upstream’sresolveExactlyOne) and refuses a locator of another screen withINVALID_LOCATOR.- Engines: the web engine clicks right for
secondaryTap, clicks with a delay forlongPress(500 ms by default, upstream’sDEFAULT_LONG_PRESS_MS), hovers, and drags with the pointer (hover the source, press, hover the target, release; upstream uses Playwright’sdragTowhen both sides are locators). The mobile engine mapslongPress,hover, anddragToonto theDeviceSessioncommands that already existed and refusessecondaryTap. The Windows engine maps all four onto its pointer inputs. The document engine refuses all four. - Declared kinds: each engine session declares the locator action kinds it takes (
IEngineSession.ActionKinds, upstream’ssession.actions, default all ofEngineActionKinds.Locator, upstream’sLOCATOR_ACTION_KINDS) and the pointer kinds (PointerActionKinds, upstream’ssession.pointerActions, default none). The screen refuses an undeclared kind withUNSUPPORTED_CAPABILITYbefore it resolves the node (Screen.CheckActionandCheckPointerAction, upstream’scheckActionandcheckPointerAction). The web engine declares all eight pointer kinds, the mobile engine the kinds it maps, and the document engine onlyswipe,tap, and the other node actions it implements.PressSequentiallyAsyncis checked as thefocuskind and theKeyboardcapability, as upstream’spressSequentiallyis. - Pointer points:
Screen.TapAtAsync(Point)andScreen.SwipeAsync(SwipePathOptions { From, To, Duration })act at a viewport point with no locator (screen.tapAtandscreen.swipe({ from, to })).Locator.TapAsync(TapOptions { Position })taps the point of the node’s box the position names, measured from its top-left corner inside its border (SemanticNode.Origin, upstream’sorigin: a document element’s padding box, or the unclipped corner of a box a frame clipped; the web page script reads it,WebEngine.PlaceBoxkeeps it through a frame, upstream’splaceBoxInFrame), after it scrolls the node into view and waits for a visible box (Locator.PerformWithinAsync,Screen.PerformAtAsync,DispatchAtAsync: upstream’sperformWithin,performAt,dispatchAt). A point must be finite and nonnegative; a swipeDurationis a whole number of milliseconds from 16 through 10000.taptakes no modifiers together with a position, as upstream. The web engine rounds points to whole pixels and drags through a midpoint (WebEngine.DispatchPointerActionAsync, upstream’sdispatchPointerAction). A swipe in a direction at a point (PointerAction.Swipe) is a wheel gesture sized by the viewport.Screen.SwipeAsync(SwipeOptions)with a direction stays the viewport swipe. Upstream’s refusal of an unknown option key has no port: options are typed. - Tests:
LocatorActionOptions/portslocator-action-options.test.ts(themodifiersdescribe without its non-array and unserializable cases; the twolongPressits; the verb theories for every verb the port has) andScriptedActions/the action kinds ofscripted-actions.test.ts(with theselectOptionobject forms).FixtureRuntime/CoordinateInputTestsports ‘coordinate input’,SelectOptionShape/theselectOptionshape cases,Actions/DispatchPointerActionTeststhedispatchPointerActiondescribe (the two paced cases and the render wait arePartial_: they read real time, not a fake clock), andLocatorEngine/LocatorEnginePerformContractTeststhe positioned-tap deadline case. .NET-only:PerformTestsof the mobile and Windows engines run the new actions throughPerformAsync.E2E.NUnit.Tests/Pointer/ports all sixits of the testbed’spointer.e2e.ts:PointerTeststhe five outside thedescribe(tapAt, a tap and a clickposition, the hidden-node position tap, and the two path swipes) andRawPointerInputTeststhe raw mouse one.
Hosted sessions
Section titled “Hosted sessions”E2EHost (OpenAsync, upstream’s openHost, run/open-session.ts) opens isolated per-test sessions for a runner of your own, and E2EHost.OpenSessionAsync is upstream’s host.openSession (#757). OpenHostOptions and OpenSessionOptions are upstream’s, with the members in C# casing: Cwd, Config, Target, Env, Headed, OnNotice, and Name, Timeout, Agent, OnStep. The signal of both is the CancellationToken argument. The session is E2ESession, which gains upstream’s hosted members: RunId, AttemptId (public now), Target, Fixtures, ArtifactsDir, TracePath, Steps(), and CloseAsync(). E2EHost.CloseAsync and both DisposeAsync are upstream’s close and [Symbol.asyncDispose]: close is idempotent and returns the failures, and disposal throws them as an AggregateException, even for one. Internal, upstream-named: SelectTarget.Select (selectTarget, select-target.ts), PublicOwnership.ReserveHostedRun (public-ownership.ts), and OpenSession.RedactOpening, RegisterStaticSecrets and LoadHostConfig (redactOpening, registerStaticSecrets, loadHostConfig).
Differences:
- C# has no free function, so the type that
openHostreturns ownsOpenAsync. A config file cannot hold a live engine, soOpenHostOptions.EngineFactory(.NET-only) builds the engine of the selected target (awebtarget gets aWebEngineby default),Configtakes anE2EConfigvalue, andConfigPath(.NET-only) takes the file, because C# has nostring | object(passing both isINVALID_CONFIG).e2e.config.jsonstill rejectsengine. Steps()returnsE2E.Reports.ReportStep, andOnStepgetsE2E.Reports.StepProgress(withStepProgressPhase,StepActivityandStepProgressIdentity), where upstream’s areStepRecordandStepProgress: the port keeps the recorder’s own records internal, andStepProgressWire(.NET-only) reads the public form from the report’s JSON, asReportSerializerdoes forReport.ReportStepstands in forStepRecord.CloseAsyncreturnsIReadOnlyList<Exception>where upstream returnsSerializedError[], which is internal here;E2EException.Codecarries the code. It returns the soft assertion failure (oneASSERTION_FAILED),STEP_NOT_AWAITED(the recorder’sAbandonRunning; the session’s operations are then cancelled), and the cleanup failures the session’s disposal threw (the first, asE2ESession.DisposeAsyncreports it).- The engine starts and is disposed for each session (the port’s
IEngine.StartAsyncis upstream’s workerinitandstartAttempttogether), so the host’s close disposes nothing. A session whose cleanup failed (the engine’s dispose threw) makes the host refuse the next one withWORKER_PROTOCOL, as upstream does after a failedendAttempt; a soft failure or a step nobody awaited does not. Only hosted sessions do this: explore and mcp attempts keep their host usable. ReserveHostedRunnever fails: upstream’s only failure is a running suite, and the port has no suite runner (reserveSuiteRunis not ported).TracePathis where the trace page is written when the session closes, whatever the trace mode, as upstream’s (the failure screen and the video still follow the trace and video modes). The page andReport()areHostTrace.WriteHostTraceAsync’s (upstream’swriteHostTrace, called fromE2ESession.WriteTracePageAsyncfor a hosted session): a standalone page, with noreport.jsonwritten and no retries joined. The attempt’s directory is<results>/<test>/attempt-1, where upstream’s isresults/host/<segment>; two sessions with one name share it. A page that cannot be written leavesReport()null and tells stderr, where upstream records a cleanup failure inclose(). A hosted session emitstest-started,step, andtest-finishedon the process’s events like any session (see Run events); no run fixture is involved, so a host that subscribes (RunEvents.Subscribeis internal: only reporters of a run fixture can) gets them through its ownOnStep.Fixturesis the session’sTestContext; there is notest.extend, so no fixtures type argument.Timeoutis aTimeSpan?; zero, negative, or infinite isINVALID_CONFIG. An opening failure is rethrown as a freshConfigurationException,EngineExceptionorE2EExceptionwith the redacted message and no inner exception or stack; a cancel stays anOperationCanceledException.- A config with several targets and no
Targetfails withTARGET_REQUIRED, throughSelectTarget(upstream’sselectTarget). The MCP server uses it too, withpass target to open_session, or start e2e mcp --target <name>.Exploreexplores the first target, with upstream’s notice, when no--targetnames one.E2EConfig.Target(.NET-only) is the only target or throwsTARGET_REQUIRED;MobileAppTestandWinAppTestread it, so they need a config with one target. AnE2EFixturenames its target by overridingTargetName. - A host’s sessions use the config’s
cacheand the target’straceandvideo.E2E_DEBUG,E2E_AI_TRACE, andE2E_UPDATE_SNAPSHOTSare not read or settable on a host yet.artifacts.storeandcache.storeare the config’sArtifactStoreandCache.Store(see below), which a host’s sessions use. - Tests:
OpenSession/HostOpenSessionTestsisdescribe('host.openSession')ofopen-session.test.ts:Opens_a_config_value_resolved_against_cwd_with_AsyncDisposable_sessionsandCancels_a_fixture_call_still_running_when_the_session_closesare whole; two are partial and renamed (Partial_Opens_the_target_with_its_fixtures_streams_steps_and_closes_each_owner_once: nogadgetfixture, the port’s engine counts;Partial_Returns_cleanup_failures_from_close_and_throws_them_from_session_disposal: the engine counts).Needs_a_target_when_the_config_declares_several_and_opens_the_one_namedis whole. .NET-only:OpenSession/SelectTargetTests,OpenSession/OpenHostTests(PublicOwnershipandRedactOpening).
Not ported
Section titled “Not ported”- The
e2ecommand-line tool apart fromlogin,logout,models,guide, andmcp: the custom runner,[E2ETest]discovery,--grep,test.only, and the JSON report @e2e-dev/mobileapart from its snapshot model and engine (see Mobile snapshot model and Mobile engine)e2e upgrade, the update notice,e2e run --watch,e2e run --max-duration,e2e feedback, and upstream’s Claude and Codex plugins (plugins/e2e,.claude-plugin). The port has no runner, and ships its skill withnpx skills add- The other upstream packages and what they do: see Upstream packages
- Vision on
actis ported (the point tools are in the next entry): thescreenshottool, a fresh screenshot after every action once the step shows pixels, the opening screenshot for a screen with nothing to tap, theObservation.TreeUnavailablelook (upstream’skind: 'pixels', asked for withObserveOptions.PixelFallback), and the stale-screen and stale-screenshot elision of the request (TranscriptCompaction, upstream’stranscript-compaction.ts, tester-army/e2e#258c553b61, #677). The built-in agent prints full screens, so a result carries the screen and the screenshot note, and the image rides a user turn after the tool results (ToolLoopResult.Pixels), where upstream’s rides the result.acttakes noschemaorvisionoption:ActOptionsis typed, so upstream’sUNSUPPORTED_CAPABILITYfor them cannot occur. The screen presenter of a session over MCP has no screenshot half.app.screenshot()is ported asApp.ScreenshotAsync: see App and browser fixtures. Video is ported on the web engine and onMobileEnginewith agent-device’s own recording: see Video. Vision on judgments is ported: see Agents.ToHaveScreenshotAsyncis: see Visual comparison - Model reasoning on step events, #1196 (tester-army/e2e
agent/executor.ts,agent/usage.ts): the reasoning a turn returns rides itsmodelevent asReasoning, for an executor turn (ExecutorModelCall.Reasoning, set byToolLoopandStepRecorder.AddModelCall) and for a judgment call alike, and the list reporter prints its excerpt (ListSteps).ModelResponse.ReasoningTextis upstream’sStepResult.reasoningText: each provider fills it from the reasoning text it returned (Anthropicthinkingblocks, Responses reasoning summaries, Gemini thought parts, BedrockreasoningText, chatreasoning_content/reasoning), so an unsigned Anthropic thinking block shows in the report although it is never replayed.ModelUsage.ReasoningFieldis upstream’sreasoningField: the text is trimmed, redacted, and cut toModelUsage.MaxReasoningChars(600, upstream’sMAX_REASONING_CHARS); a turn with no reasoning leaves the field out of the report. The AI trace keeps the full text. The port has noModelCallTracker;ToolLoopand the judgment call passReasoningTexton directly. - The
dismiss_keyboardtool and thedismissKeyboardexecutor verb (#1014, tester-army/e2ef4be1c4):dismiss_keyboardinAgentTools.GrammarToolDefinitions(upstream’sdismiss_keyboardincreateGrammarTools,agent/primitives.ts), run byActTools;IExecutorActions.DismissKeyboardAsyncandExecutorVerb.DismissKeyboard(upstream’sdismissKeyboardofExecutorActionsandtarget.verbs), run byActionDispatcher.DismissKeyboardAsync(upstream’sdismissKeyboard). The trace recordsdismissKeyboard(RecordedAction.Kind),Replayreplays it as given,SettlePolicysettles it like a key, andActionName.DismissKeyboardreports it toOnAction(upstream’sactions.tssummary isdismiss the keyboard). Upstream offers the verb when the engine defines the optionalkeyboard.dismisshook; C# has no optional member to test, soIEngineSession.CanDismissKeyboarddeclares it (.NET-only, false by default, likeCanLocate) andIEngineSession.DismissKeyboardAsyncis the hook (a default member that refuses withUNSUPPORTED_CAPABILITY, so no engine breaks).DeviceSessionis the one engine that says true, and its hook runs the dismissal under thekeyboard dismissinput budget, as upstream’skeyboard.dismissdoes.IExecutorActions.DismissKeyboardAsyncis a default member that refuses withUNSUPPORTED_CAPABILITY(.NET-only), so a custom executor context written before it keeps compiling. A session over MCP listsdismiss_keyboardafterbackwhere the engine can dismiss, and it answers with the reasona test hides the keyboard only when it covers the next controlinstead of a test line (upstream’stest-lines.ts). Like upstream’s, the tool tells the model nothing about the keyboard leaving and does not expect a change. Not ported: the decision executor’sdismiss_keyboard(packages/decision, offered whilekeyboardVisible), which the port does not have. Tests: the keyboard lines ofengine.test.ts’s verbsitareEngine/CreateEngineSessionTests.Partial_Derives_the_keyboard_and_pointer_verbs_from_the_declared_hooks(partial: the port has nocreateEngineSessionoropenverb, so it checksActContext.VerbsOf); thedismiss_keyboardinput ofagent-grammar-tools.test.tsis checked inAgentGrammarTools/TheGrammarToolsHaveClosedSchemasTests(the port’s schemas are not closed);mcp-test-lines.test.tsinMcpTestLines/SessionTestLinesTests; thedismissKeyboardoftrace-replay.test.ts’s host inTraceReplay/TestHost; thekeyboard dismissrow of the mobileengine.test.tsinput-budgetitnow calls the engine’s hook (IEngineSession.DismissKeyboardAsync); andagent-act-pixel-tools.test.tsalready checks that nodismiss_keyboardis offered without the hook. - The
resize_viewporttool and theresizeexecutor verb (#1035, tester-army/e2e#1524cba5e0e):resize_viewportinAgentTools.GrammarToolDefinitions(upstream’sresize_viewportincreateGrammarTools,agent/primitives.ts), run byActToolswithExpectChange: falseas upstream’sacting;IExecutorActions.ResizeAsyncandExecutorVerb.Resize(upstream’sresizeofExecutorActionsandtarget.verbs), run byActionDispatcher.ResizeAsync(upstream’sresize). The size is whole CSS pixels from 200 to 4096 per side (Geometry.ViewportLimits, upstream’sVIEWPORT_LIMITS;Geometry.RequireViewportSize, upstream’srequireViewportSize); a size outside them isINVALID_ARGUMENTand takes no action slot. The step’s viewport becomes the new size (upstream’sattachViewport, with scale 1). The trace recordsresizewith itsSize(RecordedAction.Size, upstream’sResizeAction.size; an entry whose size is outside the limits is a miss),Replayreplays it as given,Decide.OpensWithNavigatepasses over a leading resize,SettlePolicysettles it like a scroll, andActionName.Resizereports it toOnAction(summaryresize the viewport to 390x844). Upstream offers the verb when the engine defines the optionalsession.resizehook; C# has no optional member to test, soEngineCapabilities.Resizedeclares it (.NET-only, asHistoryis forsession.back) andIEngineSession.ResizeAsyncis the hook (a default member that refuses withUNSUPPORTED_CAPABILITY).WebEnginedeclares it and sets the viewport asBrowser.SetViewportAsyncdoes, then hands the trace the screen.IExecutorActions.ResizeAsyncis a default member that refuses withUNSUPPORTED_CAPABILITY(.NET-only), so a custom executor context written before it keeps compiling. A session over MCP listsresize_viewportafterbackwhere the engine can resize, and answers with the reasonset 390x844 with the engine fixture's viewport callinstead of a test line.ExecutorObservation.Viewport(internal) is now set on the executor’s observation, as upstream’sviewportis. The document engine and the device engines do not resize, so the port’s tool list of the default-executor test (AgentActWithTheDefaultToolLoopAgentExecutorTests, which runs on the document engine) stays as it was. Not ported: the engine protocol’ssession/resizemethod and the manifest schema (the port has no engine protocol, #873), the decision package’s test helper, and theengine.test.tsdefineEngine key check (the port has nodefineEngine). Tests:AgentActVerbs/(the resize flow and itsit; the engine-name line of the record-then-replayitis not ported, as the port’s replay records no engine events),AgentAct/AgentActResizeTests,AgentGrammarTools/TheGrammarToolsHaveClosedSchemasTests(partial: the port’s schemas are not closed),Engine/CreateEngineSessionTests,TraceCache/(the leading resize inDecideTraceReplayTests; the limits inTrace1EntryTests),TraceRecorder/TraceRecorderTests(the recording, and the stored size check as a partial),TraceReplay/ReplayTraceTests,McpTestLines/SessionTestLinesTests, and the tool list and count inMcpServer/E2EMcpTests. - Point tools (#632, tester-army/e2e#1284
90e6fb8, withdrag_atof upstream main):tap_at,hover_at,drag_at,type_at,press_at, andselect_atinAgentTools.CreatePointTools(upstream’screatePointToolsandPOINT_TOOLS,agent/primitives.ts), run byActTools.PointToolAsync. A point is read off the latest screenshot (ScreenPresenter.LatestScreenshot, upstream’slatestScreenshot) and scaled byPointTap.ImagePointToViewport;PointTap.HitTestishitTest, andDescribePointAction,DescribePointDrag, andDescribePointHitare upstream’s. The executor getsTapAtAsync,HoverAtAsync,DragAtAsync, andHitTestAsync(ActionDispatcher.Points.cs:pointVerb,pointDrag,hitTest); the bare point goes throughIEngineSession.PerformAtAsyncwhen the engine declares the pointer kind (tap,hover,dragTo), else a tap acts on the control by id. The trace recordstapAt,hoverAt, anddragAtwith the point, the viewport (RecordedAction.Viewport), and the place inside the node under it (RecordedAction.Under,RecordedPointPlace: upstream’swithin);Replay.PlacePointandPlaceWithinareplacePointandplaceWithin, and a viewport of another size hands off withviewport-changed.hover_atanddrag_atare offered when the engine takes the bare point or lists the node verb (hover,dragToinActionKinds), as upstream’sPOINT_VERBSpairing decides; on an engine without the bare point a hover acts on the listed control by id, and a drag between points on two different listed controls is joined by id (ActionDispatcher.DragOntoAsync, upstream’sdragOnto, shared with thedragverb), while a drag inside one control or from a point on nothing listed isUNSUPPORTED_CAPABILITY. Differences: a port tree lists the page’s top-level nodes with no root for the page, so a point inside a named top-level node is placed in it, where upstream skips its root; there is no twin position among look-alikes (the port records none), so an ambiguous place hands off; the failure lead of a point tool carries the error code (select_at (30, 30) failed: ACTION_FAILED: ...), where upstream’s code-less error reads without one; the replay of a recorded point emits no step engine event, as no other replayed verb does. Tests:AgentPointTap/(the 12 its ofagent-point-tap, one partial),TraceReplay/ReplayTraceBarePointTapsTestsandReplayTraceBarePointDragsTests(the bare-point hoveritofreplayTraceis inReplayTraceTests),TraceRecorder/TraceRecorderBarePointTapsTestsandTraceRecorderBarePointDragsTests(the eight its oftrace-recorder.test.ts, allPartial_: the port records no summary (hardkoded/e2e-dotnet#1283) and no truncation flag (#1187), and its typed entry cannot hold a field of the wrong JSON type;TraceRecorder.Record(kind, PlacedPoint, viewport)andRecord(from, to, viewport)are upstream’srecordof a point action, withPlacedPointand the recorder’swithinOf; a stored place whosefxorfyis outside 0 to 1 is a miss, as upstream’sisFraction), and the point its ofAgentActPixelTools/andAgentTraceCache/on the canvas and repeats pages.AgentActPixelTools/has all the its ofagent-act-pixel-tools;AgentActVerbs/has the repeatedpressits and the bare-point hover ofagent-act-verbs. Keyboard (#632,IEngineSession.TypeTextAsync, upstream’skeyboard.type, withPressAsyncfor keys):ActionDispatcher.TypeTextAsyncandPressKeyAsyncare upstream’stypeTextandpressKey, recorded astypeText(Value,Replace) andpressKey(Key) and replayed byReplay(ReplayHost’sActReplayHost.TypeTextAsyncandPressKeyAsync).type_atandpress_aton a point on nothing listed tap it to focus it and go through the keyboard (ActTools.FocusAtAsync, upstream’sfocusAt); a listed input under the point is filled by id, and a node the engine cannot fill takes the value through the keyboard (ActTools.TypeIntoNodeAsync, upstream’stypeIntoNode,TypedThroughKeyboard). A fill with no target types into the focused field. Differences: the port’s tool isfill, where upstream’s istype, so the descriptions sayfill;IEngineSession.TypeTextAsyncis a default member that refuses withUNSUPPORTED_CAPABILITY(an engine that declaresKeyboardimplements it; the default keeps custom engines compiling); the options oftypeTextareTypeTextOptions(C# has no inline types);dismissKeyboardis not ported (#1014). Thepresstool takestimes(AgentTools.MaxPressTimes, upstream’sMAX_PRESS_TIMES, 20): the first press goes to the node and the rest to the focused field throughPressKeyAsync, one action each. The repaint report (#1012,screen-update.tsatf4be1c4): once the step shows pixels, the built-in agent compares each fresh screenshot with the one the model held (ScreenPresenter.Attachreturns upstream’sPixelEvidence, the digest of the image bytes, aspixelDigestdoes) and the listing with the one it read (by the shapeAgentObservation.Shapegives). A listing that stood still under a moved screenshot opens the screen withlisted nodes unchanged; the screenshot changed. Read the effect off the image ..., and one that stood still under the same image after an action that should have changed it sayshad no visible effect(ScreenPresenter.RenderUnchanged, upstream’srenderUnchanged). With no listed control to act on, no control is blamed. Point verbs expect a change by default, as upstream’sacting, excepttype_aton a node typed through the keyboard. The note replaces the screen as upstream’s does; thenoneandunavailabletexts are the presenter’s.Reports_a_moved_screenshot_under_an_unchanged_listing_and_blames_the_control_only_when_the_image_stood_still_toois a whole port: the first miss reads as thechanged #n status "Hit" ...diff line. - Upstream’s docs site pages that have no counterpart in the port: the page objects page (
docs/page-objects.mdx, moved to/page-object-modelind30114a),e2e feedbackand thedocs/reference/cli.mdxtext about its opt-out variables (4c1e2e8), andexamples/with its registry (b3ae3a4,38b802d,a29edcb,b54646f). The migration guides (docs/migrate/*.mdx,8537abc) are ported: see Migration guides. The docs site has .NET-only guides for upstream’s five example apps ofcaf51eb(tester-army/e2e#1497: i18n, file upload, location, biometrics, deep links), under Examples. They are not ports: that commit only adds registry entries that link to separate repositories, so there was no guide text. Each page writes C# tests for the upstream app. The self-healing deep dive (6fa99ea) is ported as the Self-healing tests section of the guide, since the port has no docs pages for the cache, the trace page, or executors to link to. Known gap: onlye2e exploreprints a run summary, since it is the one command that feeds a run toListReporter(see List reporter): theCache 4 replayed · 1 handed off · 1 missedrow isFormat.CacheTextoverFormat.StepsCacheTally(E2E.Cli, upstream’scacheTextandstepsCacheTallyofreport/format.ts), which an exploration, with its cache off, never fills, and a test run does not print (#799) - Parallel workers and serial suites
test.failand thefailtest option (tester-army/e2e#1539,732ea8a): a test expected to fail, whose product failure passes and whose pass fails withUNEXPECTED_PASS. It lives in upstream’s test registry, scheduler, retry, and reporters (settleExpectedFailureruns on a finished attempt), and the port has none of them. NUnit and xUnit v3 own the verdict and the retries, and neither has an expected-failure outcome, so a port would need a new public API of its own- Playwright’s page tests in the testbed suite (tester-army/e2e#1505,
bdf769b) are ported in slices (hardkoded/e2e-dotnet#1060), as theplaywrightcategory oftests/E2E.NUnit.Tests, against the playground’s/contentroute and Playwright’s test assets (Apache-2.0,Testbed/playwright/, with Playwright’sLICENSEandNOTICE). A test upstream marks{ fail: 'reason' }keeps its assertions inside the test-onlyHelpers.ExpectedToFailAsync, which passes while the body fails and fails once it passes. Ported so far:check,wait-for-url,locator-list,selectors-text,fill,select-option,set-input-files,filechooser,click,click-scroll,elementhandle-scroll-into-view, andkeyboard. Upstream’sselect-optiontest markedfail(a bare string selects by label only) passes in the port, which matches a value or a label, so it has no marker. A missing file reports .NET’sCould not find file, where upstream shows Node’sENOENT. - Serial groups (upstream tester-army/e2e#1056, #1470): serial runs, group retries, and skipping the rest of a group after a failure belong to the test runner, which is NUnit or xUnit here, so the port keeps no serial groups. The schema has
serialAttempt.cutRetryand the serial verdict is read from it, but nothing in the port writes a serial attempt: see Report document - The out-of-process engine protocol (upstream tester-army/e2e#1232, #873): the port has no runner and no worker pool, so there is no engine process to talk to. An engine is written in .NET against
IEngine - Telemetry
- Engine docs, ported in part (tester-army/e2e
docs/writing-an-engine.mdxanddocs/reference/engine.mdx, #1205): written asdocs-site/src/content/docs/docs/writing-an-engine.mdxandreference/engine.mdx, in the port’sIEngineandIEngineSession. Upstream’sdefineEngine,validateApp,workers,reuseSignal, engine-declared secrets, contributed fixtures withrequires, the shared helpers (parseKey,resolveExpression,pollCondition, and the rest), and the engine protocol have no public port; the pages say so in a “Not in the port” section. The agent’s verbs follow the engine’s action kinds only for the pointer verbs (tracked in #1278); the helpers andvalidateAppare tracked in #1279. Upstream’sskills/e2e/referenceshas no engine page, soskills/e2e-dotnethas none either. - Errors page, ported in part (tester-army/e2e
docs/reference/errors.mdxandskills/e2e/references/debugging.md,f185ca8, #1203):docs-site/src/content/docs/reference/errors.mdxlists the exit codes, every agent code the port raises (AUTHENTICATION_FAILEDandSTEP_NO_CONCLUSIONincluded, fromAgentError.CategoryByCode), and the session codes (SESSION_MISMATCH,SESSION_EXPIRED,SESSION_INVALID,SESSION_UNAVAILABLE,SESSION_CONTRACT), and the debugging guide’s code table has a row for each. Not in the port:ONLY_IN_CI(the selection step checks for a focused test in CI, but NUnit and xUnit have notest.only, so no public path sets one) andRUNNER_BUSY(no suite runner and norun_teststool; the iOS device layer’sRUNNER_BUSYis another code). The runner codes of features the port lacks (CONFIG_*,WORKER_*,TEST_TIMEOUT, thee2e mcpsession codes) have no row. STEP_NOT_AWAITED, the error that fails a test body, hook, or fixture teardown that returns before itsexpect.pollfinished, and cancels that poll. The step recorder hasAbandonRunningand records a step the test did not await asSTEP_NOT_AWAITED, but no fixture calls it, only a hosted session’sE2ESession.CloseAsync(see Hosted sessions), andexpect.pollis not a step. Nothing cancels a poll the test does not await, so it keeps reading until its timeout or theCancellationTokenpassed to it. The compiler warns (CS4014) only for a bare, un-awaitedTaskcall in anasyncmethodtoMatchSchemaof the value expectations: there is no Standard Schema in .NET. Validate with the schema library of your choice, then check the result withExpect.That(...). Value expectations are otherwise ported: see Value expectations- The built-in
junit,json, andmarkdownreporters and theonEventhook. The GitHub pull request comment is ported in part: see GitHub reporter. The reporter seam is ported in part: see Reporters. The trace page is ported in part: see Trace page
Upstream test-only commits
Section titled “Upstream test-only commits”The tests of upstream commits adcfc2ba, c9445ce6, a13e119c, 1731e0d8, fe2c3450, and 5b6a731e that the port does not run, and why. The tests that follow upstream are in the PRs #517 (adcfc2ba, c9445ce6), #521 (a13e119c), #516 (fe2c3450), #510 and #511 (5b6a731e). 1731e0d8 changed nothing the port has.
Ported in part (the test name carries Partial_ or a PARTIAL suffix):
keeps the first verdict: a later complete_step cannot turn a failure into a passandrefuses a blocked verdict without a blocking error code and leaves the step open for a real one: the loop’s owndonekeeps no state and sends no result text (the publicVerdictTooldoes both, see Agents), so the tests check what the loop does instead (the step outcome, the model-call count, and the text of the rejections) and not the verdict result text upstream readsreplays the typing, hands off at the renamed button, and tells the model what already ran(Partial_Hands_off_at_the_renamed_button_after_the_typing_and_tells_the_model_what_already_ran): the port does not check that the entry the lenient run leaves keeps the renamed button’s old name, because it rewrites the entry after a hand-offrefuses $sink before reading the plaintext: the port has no plaintext resolver to count reads and records no policy decisionsnever sends a secret value to the model: runs on a scripted model, not a real onediverges with target-not-found when relocation never matches: noobservations == 9check, because the port retries every 20 ms up toReplayTimeoutmasks a password inside an iframe in artifact screenshots and observed pixels: the port has one screenshot pathpins the id of a non-ASCII title pathandrejects an empty name, or an empty, repeated, or blank-entry agent list at registration: a .NET test has one title, and[Agent]takes one nameuses CI defaults for retries, workers, trace, and video: the port has no workers, and its trace default is deliberate (see Defaults)refuses both spellings side by side, and an explicit path that does not exist: the port has one config file name and throwsINVALID_CONFIGrefuses another screen's locator or a non-locator before any engine call(locator-union):Or(Locator)is typed, so only the other screen’s locator can be refused
Not ported, because the feature is not in the port:
- No live window (
ListReporteris ported in part: see List reporter); no JUnit report renderer orsummary.mdwriter (the Markdown page is ported: see Trace page); no serial groups, workers, shards, runner,e2e run, ore2e list; no JavaScript config loader; notest.extend; no telemetry; no wordmark; noprojectId; norunWithRetries: thereport-listtests apart from those named under List reporter,report-junit,report-markdown,cli-run,cli-boot,config-load,parallel-workers,extended-fixtures,telemetry-*,wordmark,project idoftarget-identity, andretrytests, and the threereport-statustests about the last attempt of a serial group - The four
toMatchSchemaits ofexpect-values(no Standard Schema); thetoMatch rejects a predicate,toMatch gives the same answer on every test of a global or sticky regexp, andcompares a non-index key on an arrayits ofexpect-valuescannot happen (ToMatchis typed, a .NETRegexkeeps nolastIndex, and an array has no named keys); thewaitForResponse,route, andunroutepredicate tests and thean option ... does not take is refusedtests cannot happen, because C# overloads are typed - No
withStallGuardorrealmSlot: thetool-loop-stallandrealm-slottests - The streak guard (#632, see Point tools): the pixel-evidence messages of
agent-screen-update, andact-validation’snames schema and vision as capabilities act does not have(ActOptionscannot carry them). Judgments (assert,waitFor,extract) do not ask for the pixel fallback - No module-error explainer (
diagnose), nodefineEngine(binds validateApp, prepare, finish, and fixture factories to the spec) - No stalled-reader pixel fallback in
semantic-fallback(#1230): the eight its of the unitdescribe('semantic capture fallback')andreserves capture time and takes fresh masked pixelsare not ported;keeps abandoned reader IDs distinct from new nodes, frames, and located refsisPartial_(no abandoned reader; a located ref is the observation’s own, so the check that it differs from a fresh id is dropped). No handle-owning capture inobservation-capture(#1231): its seven unit its (the stalled-stage theory, the budget its, the cancelled mask probe, the concurrent publish order, and the replaced page) are not ported - The MCP config has no project tools: the three
mcp-serverandmcp-session-hosttests about several targets and project tools, which need a custom engine handle in the config. The declared-verbs part is covered bySessionHostTests.Catalogs_only_the_verbs_the_engine_declares - No
--traceflag or retry runner, so thetrace-modestest (records retries only under on-all-retries, --trace wins) cannot run. No runner or report, so the report-schema parts oftrace-cache-replaycannot run either. The record-then-replaydescribeoftrace-cache-replay(TraceCacheReplay/TraceCacheEveryFlowRecordsOnTheFirstRunAndReplaysWithoutAModelOnTheSecondTests) runs each flow as a session over the real web engine and one cache directory (FlowsAppis the fixture app’s pages,TraceCacheFlowsishelpers/trace-cache.ts).passes every flow on both runs and reports both in the schemaisPartial_(no report to validate), andreplays every step on the second run with zero model callsisPartial_(the replayed step’s explanation isReplayed recorded actions., not upstream’szero-turnsummary: #1281)
Left for other work:
detectVcsand theerror stackstest: covered by #496
tests/unit/ids.test.ts (#1153) ports to tests/E2E.Tests/Ids/. Ids.ValidateTitle is validateTitle and Ids.Uuidv7 is uuidv7 (internal/ids.ts); nothing in src/ calls ValidateTitle yet. ResultIdTests pins upstream’s bytes through Ids.ResultId. TestIdsTests has two Partial_ tests, since a .NET test has one title and not a title path (AttemptReport.TestId is testId); prefixes setup IDs is not ported (no setupTestId, no setup tests), and drops undefined object members of canonicalJson is not ported (a JsonNode has no undefined).
Upstream’s --debug prints the run’s phase timings and a table of agent steps on stderr, and keeps each planned step’s transcript. A test run has no --debug flag, so the .NET-only variable E2E_DEBUG=1 (or true) stands in for it, and a fixture can override the Debug property. e2e explore --debug is the flag itself (ExploreOptions.Debug; the variable turns it on too). E2ESessionOptions.Debug carries it to the session.
DebugTrace(internal,Internal/DebugTrace.cs) is upstream’sinternal/debug.ts:Record,Time(async, rethrows),Summary, and the staticTableandFormatMs. It hasOfffor a caller that has no trace. It has noDrainand noMerge, because the port prints per test and has no worker channel to ship a snapshot over.debug.test.tsisDebug/DebugTraceTests.- The phases are
session.launch(the engine’s start),test.body(from the start of the session untilCompleteor dispose),session.close(the engine’s disposal), and the agent’sagent.observe,agent.model, andagent.action(Phases, internal; upstreamagent/phases.ts, whereinstrumentPhasealso records step events).agent.cacheis declared upstream and used nowhere, so the port omits it. Upstream also hasconfig.load,engine.prepare,engine.init,app.start(...),collect, andscheduler: the port has no such phase, because it has no runner, no app process, and no engine prepare step. - The table is written to stderr when each session is released, once per test, where upstream prints one table for the run. The title is the same,
[e2e debug] phase timings (wall ...). - The agent step table is
DebugSteps.AgentStepTable(internal,Report/DebugSteps.cs), upstream’sagentStepTableinreport/debug-steps.ts: one row per agent step in execution order, with the step’s time, the time in its model, observe, and action events, its model calls, tokens in and out, the share the provider served from its prompt cache, and its cost. Aviacolumn appears when the steps named several models. It is written to stderr after the phase table when each session is released, from that session’s step records (upstream takes the run’s results and serial groups). Differences:StepModelInfohas no provenance (endpoint,adapterVersion,policyVersion), andIAgentModel.Namespells provider and model together, so a step’s label is that name alone unless an executor reports a provider. Themodelcolumn sums the step’sModelevents, one per model call (StepRecorder.AddModelCall). Theobserveandactioncolumns sum the step’sObservationandEngineevents (see Trace page).cachedandcostread-unless the provider or an executor reports them inExecutorModelCall. Every built-in provider returns the cache read tokens (and the write tokens, where it has them) inModelCallUsage, andToolLoopand the agent’s own loop (Agent.cs) pass them on. The AI trace still writes only the input and output tokens. Bedrock and Anthropic report the cached tokens apart from the input tokens, so the port adds them back intoInputTokens, as the AI SDK does (convertAmazonBedrockUsage:total: inputTokens + cacheReadTokens + cacheWriteTokens), and upstream’sModelUsage.recordreads that total. Google counts the cached tokens insidepromptTokenCountalready. The OpenRouter cost is the field upstream’sreadCostreads (metadata?.['openrouter']?.['usage'], thencost). A count that is negative or not whole is dropped, as upstream’stokenCountdoes. Only an OpenAI-compatible endpoint reports a cost, and only when it sendsusage.cost, as OpenRouter does. Upstream’sreadCostalso reads the AI Gateway metadata; the port has no gateway.debug-steps.test.tsisDebugSteps/AgentStepTableTests(bothit; the first is partial: the port has no serial groups, so its third step is a second attempt’s)..NET-only:ModelCallUsage(the per-call usage a model returns, inModelResponse.Usage; upstream reads the AI SDK’s usage object; a breaking rename of the port’s former publicModelUsage, whose name is now upstream’s accumulator, see Model usage), the agent step table case ofSessionDebugTests,ModelCallUsageTestsandProvider_usage_carries_the_cache_split_and_the_cost_when_reported. - An executor’s
AttachTranscripttext is kept astranscript-<n>.txtonly under debug..NET-only:SessionDebugTests, and the debug-on and debug-off cases ofAttachedTranscriptTests.
AI trace
Section titled “AI trace”Upstream’s --ai-trace writes every model call of the run to <output>/ai-trace.json, in the AI SDK devtools shape ({ runs[], steps[] }) that npx unbox-ai reads. One run is one agent step, and one step is one model round trip. A test run has no --ai-trace flag, so the .NET-only variable E2E_AI_TRACE=1 (or true) stands in for it, a fixture can override the AiTrace property, e2e explore --ai-trace is the flag itself (ExploreOptions.AiTrace; the variable turns it on too), and E2ESessionOptions.AiTrace carries it to the session.
AiTraceRecorder,AiTraceCollector,AiTraceScope,AiTraceRun,AiTraceStep,AiTraceDocument,withAiTraceScopeandwithAiTraceStep(asAiTraceScopes.WithAiTraceScopeandWithAiTraceStep), andstringify(asAiTrace.Stringify) are upstream’sinternal/ai-trace.ts(all internal,Internal/AiTrace.cs). The recorder keeps upstream’s rules: a run per step, a nested run per tool, steps numbered without collisions, the prompt as sent with the system prompt in front, and inline media replaced by[binary N bytes omitted]. ItsdrainisDrain(all).- Upstream’s recorder is an AI SDK telemetry integration, so
registerAiTraceRecorderanddispose’s removal from the SDK’s list have no port. The recorder’sonStart,onStepStart,onLanguageModelCallStart,onLanguageModelCallEnd,onStepEnd,onEnd,onError, andexecuteToolare methods (OnStart, …), andAiTraceModel.CompleteAsync(.NET-only,Agent/AiTraceModel.cs) fires them around each model call. Both places that ask a model for a turn, the tool loop and the judgment path, go through it, so a custom executor with a model of its own is traced too. A custom executor that calls a provider directly is not seen. Upstream’s AI SDK keeps a generation open while its tools run, so a generation a tool starts is a child of the step that called it. The tool loop does the same:AiTraceModel.BeginAsyncleaves the step and the generation open, the loop runs every tool of the turn throughExecuteTool(via the .NET-onlyAiTraceTurn.ExecuteToolAsync), and the step ends (OnStepEnd,OnEnd) after the tools ran. A path that has no tools (the judgment path) still ends the generation as soon as the model answers. No tool of the port starts a model call today, so the link only shows when a custom tool does. - The scope comes from
StepRecorder, as upstream’ssteps.tsdoes: each step enters the attempt’s scope and narrows it to its api and label. The attempt’s scope is built by the session (the test title is also itsTestId). The port has no worker, so there is nodrainover a channel: the session drains its recorder when it is released, the process adds it to oneAiTraceCollectorper file, and it rewrites the file at most every 2 seconds and when it exits. - The file is
ai-trace-<process id>.jsonnext to the results directory (.e2e/by default), notai-trace.json. A test run can use several processes (one per test project), and each rewrites only its own file. Open it withnpx unbox-ai <file>. - What the model sees is redacted by the same redactor as the request, and the trace redacts it again on the way in: text, tool arguments, the response, and a failure message. Screenshots are byte counts. The port’s
ModelCallUsagehas the cache read and write tokens but noinputTokenDetailsobject, sousagehas noinputTokenDetails. The response has noid.provideris the model class withoutModel, such asAnthropic. - A tool call’s provider metadata (
ModelToolCall.ProviderMetadata, #1310) is traced as the SDK holds it:providerMetadataon the tool-call part of the step’scontent, andproviderOptionson the same part in the prompt and inresponse.messages. Every string in it is redacted. The step end’s ownproviderMetadata(StepResult.providerMetadata) isModelResponse.ProviderMetadata(#1348), traced asproviderMetadataof the step’soutput, redacted the same way, and left out when the provider attached none. Differences: onlyOpenAiCompatibleModelfills it, and only with the billed cost the response reports (usage.cost):{ "gateway": { "cost": "<n>" } }for thegatewayprovider and{ "openrouter": { "usage": { "cost": <n> } } }foropenrouter, the two shapes upstream’sreadCostreads. The AI SDK’s other providers also report fields here (such as Anthropic’susageandcacheCreationInputTokens, OpenAI’sresponseId, Google’susageMetadata), which the port’s providers do not fill (#1329, follow-up #1348). - Tests:
ai-trace.test.tsisAiTrace/(13 of 14; “registers through the SDK loader and tolerates a missing SDK” is skipped, since there is no SDK; “records the status and the body of a provider error the SDK could not parse” goes throughOpenAiCompatibleModeland expects the port’sThe model provider failed: HTTP 400: ...message).ai-trace-media.test.tsisAiTraceMedia/(3 of 3).agent-ai-trace.test.tsisAgentAiTrace/(2 of 3, partial: the model is the port’sScriptedModel, so the model id isscriptedand the providerScripted, and there is no run outcome, so the test reads the file; “–ai-trace on child-process workers” is skipped, since the port has no workers)..NET-only:AiTraceModelTests(redaction, screenshots, concurrent tests, a tool call’s provider metadata).
Upstream packages
Section titled “Upstream packages”The packages in tester-army/e2e at the target commit, and what the port has:
| Upstream | Status | Notes |
|---|---|---|
e2e (packages/e2e) |
Ported in part | Everything under Ported and the sections after it. The runner, the built-in reporters, e2e run, e2e upgrade, and telemetry are not ported: see Not ported. The hosted session (e2e/runner’s openHost) is ported in part: see Hosted sessions |
@e2e-dev/web |
Ported | WebEngine in E2E: see Web engine |
@e2e-dev/mobile |
Ported in part | E2E.Mobile: see Mobile snapshot model, Mobile engine, and, for the /lease subpath, BrowserStack |
@e2e-dev/eas |
Ported | E2E.Expo: see Expo Simulators |
@e2e-dev/limrun |
Ported | E2E.Limrun: see Limrun |
@e2e-dev/browserstack |
Ported | E2E.BrowserStack, with the lease helper in E2E.Mobile: see BrowserStack |
@e2e-dev/acp |
Ported | E2E.Acp: see ACP, with the differences listed there |
@e2e-dev/kernel |
Ported | E2E.Kernel: see Kernel |
@e2e-dev/testmu |
Not ported | A mobile device provider for TestMu AI, through agent-device. E2E.TestMu.Mobile serves the same devices with Appium: see TestMu mobile, and what still differs |
@e2e-dev/decision |
Not ported | decisionFilter (see Test filters, where the filter seam it plugs into is ported) and a decision-model executor: a model that picks one action from a grammar (taps, points, vision). The port has the executor seam (IStepExecutor, see Agents) but no such executor |
@e2e-dev/smol |
Not ported | A browser provider that runs each browser and the app in a branchable smol machines microVM. The port has the provider seam (IBrowserProvider, see Web engine) but no such provider |
@e2e-dev/lightpanda |
Not ported | A browser provider for the Lightpanda headless browser. Upstream added it on 2026-10-15 (b41afa2), after the earlier target. The engine drives Chromium only |
@e2e-dev/github |
Ported in part | E2E.GitHub, GitHubReporter: a reporter that posts the run as a pull request comment. It folds a --last-failed rerun into the run it selected from (merge.ts): see GitHub reporter |
A config that selects a decision model or smol cannot be written in e2e.config.json, and it fails at load with INVALID_CONFIG instead of being ignored (E2EConfig):
- Decision models are an
executor. Upstream takesexecutor: decision(...)inagents.<name>. The port rejects the key withconfig key "executor" is not supported by the .NET port: an executor is code, so set AgentOptions.Executor. A custom executor in code works, but the port ships no decision executor.provideraccepts only the names in Models, so aproviderofdecisionis rejected with the list of valid names. - smol is a
browserprovider on the target (web({ browser: smol() })). The target acceptsname,platform,app,trace, andvideo. Abrowserkey is rejected as an unknown target key, and anenginekey as not supported by the .NET port. To use a provider, setWebEngineOptions.Browserin the fixture’sCreateEngine. The port shipsKernelProviderandTestMuBrowsersthere, and none for smol.
Value expectations
Section titled “Value expectations”Expect.That(value, message) is upstream’s expect(value, message?) (packages/e2e/src/expect/values.ts, #1248): ToBe, ToEqual, ToMatchObject, ToBeTruthy, ToBeFalsy, ToBeNull, ToBeUndefined, ToBeDefined, ToHaveLength, ToHaveProperty, ToContain, ToMatch, ToBeGreaterThan, ToBeGreaterThanOrEqual, ToBeLessThan, ToBeLessThanOrEqual, and ToBeCloseTo, with Not and the message opening every failure. The failure is an ASSERTION_FAILED TestException. Expect.Soft(screen, value, message) is expect.soft(value, message?). Expect.Any, Anything, ObjectContaining, ArrayContaining, StringContaining, and StringMatching are the asymmetric matchers. What differs:
undefinedisExpect.Undefined(#1368, .NET-only: C# has noundefined, so a test passes this value).nullis onlynull:ToBeNulltakesnullalone,ToBeUndefinedtakesExpect.Undefinedalone,ToBeDefinedtakes everything butExpect.Undefined(sonullis defined, as upstream), and a failure readsundefinedfor it.ToEqualignores a member that holdsExpect.Undefined, as upstream ignores anundefinedproperty (ToMatchObjectdoes not), andExpect.Anything()matches neithernullnorExpect.Undefined. Code that read a missing .NET value asundefined(Expect.That(text).ToBeUndefined()on anullstring) now fails: useToBeNull.- Values compare by structure, whatever their class: a record equals an object (or a string-keyed dictionary) with its property names; an
IDictionaryis aMap, anISet<T>aSet, and any otherIEnumerablean array. A number is read as JavaScript reads it (NaNequalsNaN,0is not-0, and anintequals adoubleof the same value).ToHavePropertyreads a public property or field by its name, in any case when the exact case finds nothing, and a string’sLengthand characters. The JavaScript-only values (Symbol, a sparse array, a primitive’s wrapper methods) are not read (#1369). Expect.Any(typeof(int))reads in a failure asAny<Int32>.Anyof a number type matches every number type.Expect.Soft(screen, value)takes the screen that names the session, where upstream’sexpect.soft(value)finds the running attempt on its own. There is no softToMatchSchema.ToMatchtakes astring(a substring) or aRegex;expect.pollkeeps its own matchers (ToBeAsync,ToSatisfyAsync, andToMatchAsyncwith an NUnit constraint onE2E.NUnit).
Skill text: start near the screen, fix from the trace page
Section titled “Skill text: start near the screen, fix from the trace page”skills/e2e-dotnet ports upstream’s 74c2b73 (#1311, start each test near the screen it covers) and c5e3248 (#1309, “Workflow: fixing a failed test”). Differences:
- The port has no
test.extendfixture, and its saved sessions are NUnit and xUnit v3 only (see Session store), so “Start near the screen under test” names[E2ESetup]and[E2ESession]and otherwise signs in and seeds data in the framework’s per-test setup (NUnit[SetUp], xUnit v3InitializeAsync) with anHttpClient, andBrowser.SetCookiesAsynchands the cookies to the browser. On a device it isDevice.OpenLinkAsync. - The test runner prints the exception, not upstream’s failure block, so the port has no
❯ at,❯ on screen, or❯ tracelines. The skill points to the exception’sCode, message, andDetails, and to the trace page’s## Screen at failure(its URL andClosest to what the locator asked for). The trace page,## Screen at failure, andscreen-at-failure.txtexist as upstream. Expect.Soft,Values.Unique,App.OpenAsync, andDevice.OpenLinkAsyncstand in forexpect.soft,unique,app.open, anddevice.openLink. In CI the cache isread-onlyunless the config sets a mode (E2EConfig), where upstream’s default records nothing there. Upstream’score-concepts.mdxandcoding-agents.mdxhave no counterpart.- Upstream’s
ci/norrix.mdxhas no counterpart: Norrix runs the Nodee2e runcommand on a build machine, which the port’s test projects cannot do. The NativeScripttestIDnote ofmobile.mdxis indocs-site/src/content/docs/get-started/mobile.mdx. Both come from tester-army/e2e#1567 (commit 65ebc7d).
Skill text: off-site iframes (not ported)
Section titled “Skill text: off-site iframes (not ported)”Upstream’s 4982d8d (#1333) documents that the browser engine’s semantic tree leaves out the content of a frame from another site, so agent steps there need browser.frameLocator and vision, and an agent.act whose only change is in that frame records no replay. The port does not take the text, because the behavior does not exist here: the web engine reads every iframe’s document through Playwright, same-origin or cross-origin, and puts it under the iframe node (see Web engine), so the agent sees and acts on that content. Browser.FrameLocator exists, and it resolves over that same tree. The changes to skills/e2e-dotnet/references/{agent,debugging,writing-tests}.md and docs/ are skipped because the behavior they warn about does not exist here.
Verification skill
Section titled “Verification skill”skills/create-verification-skill/ ports upstream’s skill of the same name (commit d85702a2, feat(skills): create-verification-skill generates a verify-<app> skill on e2e (#981)). Like upstream, it is not bundled in E2E.Cli and e2e guide does not read it; install it with npx skills add hardkoded/e2e-dotnet --skill create-verification-skill. Differences:
- The steps use what the port has. The launch is the target’s
app.commandor the app started by hand, the doctor is a smoke test run withdotnet test --filter, and the evidence is thedotnet testresult and the test’s own checks, since the port writes no report or trace page, and a video only whenvideois on. - The generated bug bash fan-out is ported (see Bug bash). A feature’s charters are
slug|target|agent|charterlines, as upstream’s, and step 4 of the skill runs one withe2e explore. Only the--sessionpart of a signed-in charter is dropped: a charter that starts signed in names its credential, because the port has no saved sessions. - Not ported:
npx e2e initas the setup step (the port’se2e initscaffolds the test project too: see Coding agents),e2e listas a config check,--outputfor proofs, and the.gitignoreline for.e2e/proof/. The generated skill adds.e2e/bugbash/to.gitignore, as upstream’s does. - The example under
references/example/isverify-todomvcforsamples/TodoMvc, in place ofverify-playgroundfor upstream’sapps/testbed, which the port does not have. It has three features (adding, completing, filtering), not the playground’s three (todos, forms, login). - Upstream added no tests for this skill, so none are ported.
skills/migrate-to-e2e/ ports upstream’s third skill (e6885dc, feat(skills): add migrate-to-e2e (#1109), and 6609428). Install it with npx skills add hardkoded/e2e-dotnet --skill migrate-to-e2e; like upstream, it is not bundled in E2E.Cli. Differences:
- The source runners are Playwright .NET, Selenium .NET, and Appium, with upstream’s Node ones (Playwright, Cypress, Detox, Maestro) kept. The e2e side is an NUnit or xUnit v3 test project run with
dotnet test, in place ofe2e.config.ts,*.e2e.tsfiles,npx e2e init(the port’se2e initcreates the test project),e2e run --repeat-each 3, ande2e list. - The migration guides are ported: see Migration guides. The skill reads the guide for the source runner first, as upstream’s does. The TesterArmy section of
SKILL.mdkeeps its inlined MCP commands and agent-call names in C#, and points to thetesterarmyguide’s “Port the project” and “Map each step” tables. The hand-over offers an issue athardkoded/e2e-dotnetin place ofe2e feedback. - Not ported: the plugin copy (
plugins/e2e/skills/migrate-to-e2e), since the port has no plugin; theAGENTS.mdandCONTRIBUTING.mdlines about it map toCONTRIBUTING.mdhere. - Upstream added no tests for this skill, so none are ported.
docs-site/src/content/docs/coding-agents.mdxports upstream’sdocs/coding-agents.mdxfor the commands the port has.
Migration guides
Section titled “Migration guides”docs-site/src/content/docs/migrate/ ports upstream’s docs/migrate/*.mdx (index, playwright, selenium, cypress, detox, maestro, testerarmy) as read at 7b1b8b27 (8537abc7, tester-army/e2e#1441; b81b7d75, tester-army/e2e#1411; d52e9b01, tester-army/e2e#1468; a60310f9, tester-army/e2e#1508; f6d0679f, tester-army/e2e#1361). They keep upstream’s file names, headings, and order. Each guide’s tables use the port’s C# names, and the sidebar has a Migrate group. Differences:
- The
playwrightguide maps Playwright for .NET (PageTest,ContextOptions(),Page.GetByRole(AriaRole...)), where upstream maps Node Playwright. Playwright .NET has noplaywright.config.ts, so the config tables mapBrowserNewContextOptions,.runsettings, and the environment variables instead oftestDir,webServer,projects, andreporter. Theseleniumguide maps Selenium for .NET, where upstream’s example is Java. Thecypress,detox,maestro, andtesterarmyguides keep their source runners and write the target in C#, in a new .NET test project beside the old suite. - Every code sample has an NUnit form, and an xUnit v3 form where the two differ. A short NUnit and xUnit table in the overview replaces upstream’s
test,describe, hook, tag, and retry names. - Upstream’s
SetupPromptcard (a copyable prompt) is atextblock named “Agent prompt”. The prompts usee2e init --yes,e2e guide,e2e login, anddotnet test --filterin place ofnpx e2e init --yes,npx e2e guide,npx e2e login, andnpx e2e run. - Upstream’s
CardGroupandCardcomponents are lists of links, andAccordionGroupis a heading for each table. - No counterpart in the port, marked
missingorby designin the tables:e2e runande2e list(usedotnet test), thetests,workers,output,--shard,--watch,--changed-since,--repeat-each,--max-failures, and--update-snapshotsflags and keys (the framework owns selection, retries, and parallelism;--last-failedis theE2E_LAST_FAILEDvariable and theLastFailedmember of the run fixture, see Test filters),describeoptions (serial,skip,retries,timeout),test.extendfixtures andbase.extendpage objects as fixtures (a page object takesScreenandBrowserin a[SetUp]orInitializeAsync), several targets in one run (the port runs one), the HTML and markdown run summaries,unique()as a free function (Values.Unique),credentialsentries for TOTP (secretshold values, not code), and theinboxcredential. A row names a feature withNot yetwhere the port has a symbol missing from its locator set, such as the tapposition,TapAt, and the screen-levelSwipe. - The
detox,maestro, andtesterarmyrows that useToHaveScreenshotAsyncon a device say the port documents the matcher for the web engine only. Nothing in the port runs it on a device. - The prompt’s step to port
.detoxrc.jsandconfig.yamlinto one device target relies onE2E_MOBILE_PLATFORMandE2E_MOBILE_APP_PATHto switch between iOS and Android, sincee2e.config.jsonholds one target (see MobileAppTest). - The snippets were written against the port’s public API and compiled by reading, not run. The docs site build checks the pages, not the C#.
- No tests: upstream added none for these pages, and no
src/symbol changed.
Bug bash
Section titled “Bug bash”Upstream’s bug bash (skills/e2e/references/bug-bash.md, last changed in 94e6e765 and b292019b, tester-army/e2e#1139, at 7b1b8b27; docs/bug-bash.mdx, 71bbb23e) is a procedure for a coding agent, not a runner feature. The “bug-bash config” is a file the agent writes in the user’s project, and the “fan-out” is a shell loop of xargs -P 4 e2e explore. Nothing in src/ backs either, so the port is the guide topic bug-bash (skills/e2e-dotnet/references/bug-bash.md) and the docs page Bug bashes. Differences:
- The config is
e2e.bugbash.config.json. The port’s config is JSON, so it cannot spread the project’s config (...base), cannot import agateway(...)model, and is a copy with the keys a bug bash changes: a target withoutapp.command,credentials, and the three agents (default,skeptic,fuzzer) withmaxStepsandmaxModelCallsof 40, acontext, and asystem. An agent inherits nothing fromdefault, so each repeats the model and thecontext. The credentials leave the password toE2E_USER_<NAME>_PASSWORD. - There is no
testskey. The repro tests live in the test project’sBugBashfolder, taggedbugbash([Category("bugbash")]or[Trait("TestCategory", "bugbash")]), anddotnet test --filter "TestCategory!=bugbash"replacese2e run --exclude-tag bugbash. A repro test runs withdotnet test --filter "FullyQualifiedName~BugBash.<Class>". e2e explore --output <dir>putsreport.jsonbeside<dir>, so the fan-out passes--output .e2e/bugbash/<slug>/results.--reporterexits 2, so there is nosummary.md; the log holds theFindings.--sessionexits 2: a charter that needs an account names its credential and the explorer signs in withfill_secret.- The docs page drops upstream’s demo video,
ShowMore, andCodeGroupblocks (one package manager,dotnet), and the card links to pages the docs site does not have.e2e listis not ported, so no command checkse2e.bugbash.config.json.
Coding agents
Section titled “Coding agents”e2e init is ported (upstream packages/e2e/src/cli/init.ts and init/*.ts at f4be1c45; Init and E2E.Cli/Init/*). It scaffolds e2e.config.json, a test project, installs the skill into .agents/skills/e2e-dotnet (and .claude/skills/e2e-dotnet, a symlink to it when both are chosen), registers the MCP server in .mcp.json, .cursor/mcp.json, and .codex/config.toml (TOML, edited in place with Tomlyn so comments and other settings stay; Codex loads it only in a trusted project), and appends bin/, obj/, and the .e2e/ outputs to .gitignore. It never overwrites an existing config, refreshes a damaged or stale skill copy, merges into an MCP file without touching other servers, settings, or its indentation, and does not write through a symlink (a linked skill directory, a linked MCP file, or a linked parent is reported and skipped). Flags are upstream’s --yes, --engine, --gateway, --endpoint, --skills, --mcp, --example, --install, and --no-install, and the .NET-only --framework. Differences:
- The prompts are hand-rolled on the console (
ConsolePrompts, in place of clack’smultiselect,select,text, andconfirm): a numbered list, a reply of numbers or names, Enter for the default,qor the end of the input to cancel. Every flag skips its question, and--yestakes the default of each question left. Without a terminal and without--yes, a run exits 2. The wizard asks the engines, the gateway (and the endpoint ofopenai-compatible), the skill locations, and the MCP locations; asks to replace a symlinked skill directory with a copy or a link (declined by default, never under--yes); shows the plan and asks to apply it. Cancelling a question, or declining the plan, writes nothing and exits 0. Unlike upstream, the gateway question does not say it adds AI SDK v7, and the engines question says that none gives the default target, since the port has no packages to add and no HTTP-only tests. - The project file and the example test stand in for upstream’s
package.jsonandtests/example.e2e.ts. A directory with no.csprojgets<DirectoryName>.csprojwith the packages of the framework (E2EandE2E.NUnit, orE2E.XUnit.V3;E2E.Mobile.*for the mobile engine) at the CLI’s version (a stablex.y.zbecomes the NuGet range[x.y.z,x.(y+1).0), a prerelease is pinned exactly, and a version-less build uses0.*), and anExampleTests.cs. A directory with one.csprojgets only the references it lacks, and its formatting is kept; several.csprojfiles exit 2. NUnit is the default, since the get-started pages lead with it;--framework xunitpicks xUnit v3, and an existing project keeps the framework it uses. The web example opensAPP_URLand checks thatBrowser.Locator("body")is visible, as upstream’s example does. --installrunsdotnet restore(upstream runs the package manager), with a 10-minute limit; the question asks “Install dependencies with dotnet restore?” and--yesanswers no. There is no browser install step: the Playwright browsers install on first run, as the web guide says. A failed restore exits 2 after the files are written.--exampletakes the folder name of a sample undersamples/(E2E.Sample,E2E.XUnit.V3.Sample,TodoMvc; upstream’s list is its example apps). It downloads the GitHub tarball of the tagv<version>and falls back tomain, extracts the folder withSystem.Formats.Tar(upstream has its own tar reader), turns eachProjectReferenceinto aPackageReferenceat the CLI’s version, and sets the target framework. TheExamplePresethas an id and a hint only; upstream’s project, script, and build fields have no use here.- Not ported: the wordmark,
continueWith(upstream’se2e explorehand-off), theaddScriptsstep (test:e2e), the package-manager detection, and thetsconfig.jsonnote. The closing line isNext: [cd <directory>, then ][e2e login <provider>, then ]dotnet test. - The config is JSON.
agents.defaultnames aprovider, amodel, andsystem, where upstream writes the import and construction of an AI SDK model; the gatewayvercelis providergateway. A subscription gateway names the sign-in as the next step, as upstream does. Theopenai-compatiblegateway writesbaseUrl. There is no comment above the model, since JSON has none. --enginetakeswebormobile(iOS on macOS, Android elsewhere), and one of them: the port’s scaffold writes one target (e2e.config.jsonaccepts several, by hand).nonewrites notargets, which keeps the default web target.- The
.gitignoreentries are the paths the port writes:bin/andobj/(in place ofnode_modules/),.e2e/results/,.e2e/cache/,.e2e/report.json, and.e2e/ai-trace-*.json. The.e2e/cache/note about committing replays is not printed, since the docs site has no such page. - The skill is
e2e-dotnet, and the MCP entry is{"command": "e2e", "args": ["mcp"]}(the installed tool, where upstream’s isnpx e2e mcp). An MCP entry upstream would call current is rewritten once here when it still saysnpx. - Codex’s
.codex/config.tomlis read and edited with Tomlyn (CodexConfig, upstream’scodex-config.ts, which usestoml-eslint-parser). Like upstream it replaces or inserts onlycommandandargsand keeps comments, line endings, and other settings;ToJson,Parse,KeyParts,KeyText, andKeyValuesOfare .NET-only helpers over the Tomlyn tree, andServerCommand,ServerArgs, andIsTomlinMcpConfigstand in for upstream’sSERVER_ENTRY. Upstream’s integrationitthat starts the server from the generated Codex config throughnpxwith an offline npm cache is ported as a partial test: it starts the server from the generated entry with ane2eshim on the PATH and lists the tools, without network access. The port has no npm and no npm cache, so that part has no counterpart. Tomlyn 2 parses TOML 1.1, where upstream’s parser is pinned to 1.0, so a.codex/config.tomlusing 1.1-only syntax is accepted here. Known difference kept from upstream: when.codex/config.tomlhas nomcp_serversand begins directly with a table header (for example[features]on the first line), the launch keys are appended inside the last table, because upstream’ssetLaunchValue(codex-config.ts,if (offset === 0) offset = text.length) cannot tell a first table at offset 0 from a missing newline. The result is valid TOML, but Codex does not see the server; put a comment or a root key above the first table. - On Windows without the symlink privilege, the link from
.claude/skillsis written as a copy with a warning. Upstream uses a junction. - .NET-only symbols:
Frameworks,FrameworkPreset, andInitOptions.Framework(the choice between NUnit and xUnit v3; upstream has one runner),InitOptions.RunInstallandInitOptions.ExampleHandler(test seams in place of mocking the package manager and the download),Init.ProjectNameOf,Init.RootNamespaceOf, andInit.RestoreAsync(the project name, namespace, and restore of a .NET project),PackageProject(the.csprojread and written in place ofpackage.json),ExampleDownloadErrorandExampleCopyCancelled(typed errors in place of upstream’s thrownErrors),WatchedStream(the 30-second idle limit on the download),InitLog(the plain lines in place of clack’s log),InitOptions.ReadSkillFilesandInitOptions.Windows(test seams in place of mockingreadSkillFilesandos.platform),Engines.GetEnginePresets(darwin)(the same seam),InitFlags.Parse(the flags are parsed by hand in place of commander),InitResultandInitRunOutcome(upstream’s strings andInitOutcome, without telemetry), andSkill.MissingSkillMessage. - Ported tests are under
tests/E2E.Cli.Tests/CliInit(upstreamcli-init.test.ts, both files),CliGuide(installs the skill into both agent directories with init --yesofcli-guide.test.ts) andInitGateways(init-gateways.test.ts). The portedits that run only in part carry the prefixPartial_and say what they leave out.InitVersions(init-versions.test.ts, asDependencyRangeTests) andInitExamples(init-examples.test.ts, over a built tarball). Not ported: theits ofintegration/cli-init.test.tsthat load the generated project and run it (“runs the generated browser example against any page without a model key” and the engine-less and two-target loads: the port has no in-process project loader, so a generated project was built and run by hand), and everyitofcli-init.test.tsthat needs a prompt,continueWith, two targets, or the TypeScript scaffold; the list is onE2eInitTestsand the other classes of that folder.
The port installs the skill with npx skills add hardkoded/e2e-dotnet and registers the MCP server with claude mcp add e2e -- e2e mcp when e2e init is not used. The bug-bash config and its fan-out are ported: see Bug bash.
MobileAppTest (not in upstream)
Section titled “MobileAppTest (not in upstream)”E2E.Mobile.NUnit.MobileAppTest and E2E.Mobile.XUnit.V3.MobileAppTest derive from E2ETest and make a device test one using and one config file. Upstream declares a device in e2e.config.ts and its runner owns the engine and the hosted device. The port’s adapters do, so these classes do it. Every symbol here is .NET-only. Differences:
e2e.config.jsonaccepts"platform": "ios"and"android". A device target takesapp.bundleIdandapp.appPath, as upstream’sapp. It takesapp.commandandapp.readyUrltoo (see Config), andapp.identity,app.environment,app.launchArguments, andapp.permissions.MobileTargetEngine,MobileAppTest, andWinAppTesthandlaunchArgumentsandpermissionsto the engine’s app (MobileApp.LaunchArgumentsandPermissions, which every fresh launch applies); a permission name thatDevicePermissiondoes not know isINVALID_CONFIG(upstream’sassertPermissions). A Windows target takeslaunchArgumentsbut notpermissions. A web target takesidentity,environment, andpermissions(grantonly): the session grants them on every context of the attempt (upstream’swebvalidatePermissionsinpermissions.tsand the context grant insurface.ts), throughE2ESessionOptions.PermissionsandEngineStartOptions.Permissions. The names are checked when the attempt starts, with the browser the engine runs (a provider orConnecttakes Chromium’s), where upstream checks at config load invalidateApp.WebEngine.ValidateApp(AppConfig, targetName)is upstream’s webvalidateApp(device keys refused,app.urlrequired,app.permissionschecked for the engine’s browser, Chromium’s names for a provider), and thetarget-app.test.tstests port in full against it. The port’s config load does not call it: a web target withoutapp.urlstill loads, since the fixture supplies the URL. The port still runs one target.E2E_MOBILE_PLATFORMandE2E_MOBILE_APP_PATHwin over the config, so one project can run on iOS and Android.E2E_MOBILE_DEVICE,E2E_MOBILE_PROVIDER(local,limrun,devflow),E2E_DEVFLOW_PORT, andE2E_DEVFLOW_APPare .NET-only.- A hosted run leases one device on the first fixture and releases it when the process ends, because the adapters have no hook after the last test. A killed process is covered by the provider’s hard timeout (15 minutes for Limrun).
MobileAppHostis one source file, compiled into both packages.HostedDeviceProviders(the provider eachE2E_MOBILE_PROVIDERname makes) is a second, compiled into both packages and intoE2E.Cli.CreateMobileOptions,AppId,AppPath,Platform, andAttachesToRunningAppare the members a test project overrides or reads.
Mobile snapshot model
Section titled “Mobile snapshot model”E2E.Mobile ports the pure logic of @e2e-dev/mobile: the projection of an agent-device accessibility snapshot onto SemanticNode (SnapshotProjection), locator expressions and agent-device selectors over it (DeviceLocator, AgentDeviceSelector), error translation (DeviceErrors), links, screenshot masking, and the shared helpers (DeviceSupport). The client, pool, provider, and engine are in Mobile engine. Differences:
- agent-device is a Node package.
AgentDeviceErrorstands in for itsAppError, andAgentDeviceSelectorreads the selector grammar ofparseSelectorChainand applies the term rules oflistSelectorChainMatchesto the raw nodes, for the target’s platform (the keysid,role,text,label,value,appname,windowtitle, and the flagsvisible,hidden,editable,selected,focused,enabled,hittable). - An
AMBIGUOUS_MATCHfailure (several devices match and no selector narrows it) keeps agent-device’s message, code, details, and hint, andDeviceErrorsadds one sentence to the text:Set MobileOptions.Device to a device id, or boot exactly one device.Upstream adds nothing.AmbiguousMatchTestscovers it and has no upstream counterpart. SemanticNode.Statesholds plain booleans, so it cannot tell an unchecked switch from a node with no checked state.ProjectedNode.Stateskeeps the states the platform reported, andProjectedNode.Selectorkeeps theid=hint upstream puts on the node.- A
filterwithhasTexthonors the exactness of its text pattern, as upstream’smatchesTextdoes.Locator.Filter(TextMatch)is a substring match (upstream’stoTextPattern(hasText, { exact: false })), so a locator test sees no difference.TextMatchholds no exactness, so the expression carries it:LocatorExpression.HasTextExact(.NET-only; defaultfalse) makesHasTextequal the text, as upstream’sexact('About')does inlocate.test.ts.HasNotTextExactis the same forHasNotText. ARegexignores it. The core resolver (Screen) reads it too. - A role query has no
hiddenstate. Role queries skip hidden nodes, as upstream’s do. - Link parsing reads a URL with
System.Uri, after the whitespace rules a browser applies. MaskPngdecodes withImageOps.DecodePnglike the rest of the port, so it reads gray, gray with alpha, RGB, and 16-bit PNGs as 8-bit RGBA and refuses a PNG with no end chunk (ImageOps.DecodePngwalks the chunks to a wholeIEND, which Skia would not insist on), as upstream’s parser does (tester-army/e2e#1587,34ccc5f).
Mobile engine
Section titled “Mobile engine”MobileEngine ports engine.ts, options.ts, bindings.ts, pool.ts, provider.ts, surface.ts, actions.ts, device.ts, and tools.ts. It implements IEngine and declares every capability, video included. DeviceSession is the surface, DeviceActions (the IDeviceActions the engine uses by default) turns a node and an action into commands, Device is the device fixture, and MobileTools is the agent tool pack. The eas, limrun, and browserstack providers are ported (see Expo Simulators, Limrun, and BrowserStack); a provider’s own recording (DeviceProvider.record) is IDeviceProvider.RecordAsync (see Provider recording). Differences:
- agent-device is a Node program.
IDeviceClientstands in for upstream’screateAgentDeviceClient: a call isnamespace.methodwith an options object, as upstream’s client names them.AgentDeviceRpcClientimplements it over the daemon’s HTTP JSON-RPC 2.0 (POST /rpc, methodagent_device.command,GET /health). The wire format was read from agent-device 0.21.22’s code and checked against a running 0.21.22 daemon fordevices,boot,close,session_list,prepare, andsnapshot. A running 0.21.25 daemon was checked forGET /health(protocol 2) andsession_list. A running 0.21.29 daemon answeredGET /health(protocol 2, version 0.21.29),session_list, anddevicesin the same envelope, and itsdaemon.jsonstill carrieshttpPort,token, andversion(it addscapabilitiesandplugins, which the client ignores). The 0.21.26 to 0.21.29 release notes list no change to the RPC envelope or to the commands the engine sends; the changes that touch the engine are in its commands (a coordinatefillthat names no text input is refused on iOS, afindfocus match behind the visible keyboard is refused, an alertdismisspicks a listed decline, and a delayed launch confirmation is surfaced), and none of them was exercised on a device. The 0.21.30 to 0.21.35 release notes likewise list no change to the RPC envelope or to the commands the engine sends (they add gesture and hardware-button commands the engine does not use, a typed reason onappsandlogsrefusals, a 404 for an expired resource id, and iOS and Android snapshot and fill fixes, an unscopedbootthat picks the newest of several shut-down devices, and an iOS return press with nothing focused that keeps the runner session). The 0.21.36 release notes likewise list no change to the RPC envelope or to the commands the engine sends (they fix provider lease recovery and release in the daemon, a blind iOS fill-point lookup, iOS snapshots past 64 accessibility levels, and Safari and SpringBoard alert prompts); a 0.21.36 daemon started on macOS and answeredsession listthrough agent-device’s own CLI, but the port’s RPC client was not run against it; no 0.21.35 daemon was reached from the Windows host this was read on, where a daemon does not start (0.21.29 fails the same way). It is not a documented protocol, so the version is pinned (AgentDeviceVersion.Pinned) and the client checksrpcProtocolVersionand the daemon version.DeviceCommandsturns each call into a command, positionals, and flags. The calls the engine makes today are covered. A call it does not know is refused. - A local daemon needs Node 22.12 or newer. The first call starts it the way agent-device’s own CLI does (
npx --yes agent-device@0.21.36 session list --json, withAGENT_DEVICE_DAEMON_TRANSPORT=http), in the state directory~/.agent-device/e2e-dotnet, and it keeps running after the command.E2E_AGENT_DEVICE_BINnames anagent-device.mjsto run in place ofnpx. A missing Node, a Node that is too old, an agent-device that does not start, and a daemon of another version fail withINVALID_CONFIGand the recovery. Starting a daemon on Windows is not verified. MobileOptionscarries the app (App: bundle id, build path, launch arguments, permissions), the target name, and the device choice as three properties (Device,Devices,Provider; at most one), because the port has no target config for a device yet. Permission names and states are enums, so an unknown one cannot be typed; a cast number still can, andDevice.SetPermissionAsyncrefuses it withINVALID_ARGUMENTbefore any device command (upstream’sassertPermissioninsurface.ts: theunknown keymessage with the nearest name, and themust be one of grant, deny, resetmessage). Upstream’s typo hint (camra),undefinedstate, and non-string name have no enum counterpart; the port testPartial_Refuses_a_setPermission_name_or_state_it_does_not_know_before_any_device_command_and_still_sends_a_valid_onechecks the cast-number cases only.SettleandSettleMillisecondsstand in forsettle: number | false.- The core engine contract has no
prepare,finish,init, or worker slot.MobileEngine.PrepareAsyncandFinishAsynctake their own info records, andStartAsync(MobileStartInfo)starts the worker of one slot.StartAsync(EngineStartOptions)starts slot 0 of the target. Bindings travel from prepare to a worker throughMobilePrepareResult.Env, as upstream’s environment variable does. In one process the pool also keeps them. app.open()isOpenAsync: it launches the pinned app fresh. A deep link or any absolute URL is refused.EngineStartOptions.BaseUrlis refused as upstream refusesapp.url.DeviceSession.BackAsync(OperationContext, CancellationToken)settles for the agent and not for a test, as upstream’sback(operation)does.Device.BackAsync(the fixture) is a test’s step too: it runs with the test origin and does not settle, as upstream’sdevice.backdoes.- The core session has no attempt hooks, pixel observations, or artifact directory. So
DeviceSessionis one attempt (it registers on the engine until it closes), andScreenshotAsyncreturns the masked, status-bar-normalized PNG fortoHaveScreenshotinstead of writing numbered files. A secure field that cannot be masked still withholds the image withENGINE_FAILURE. DeviceSession.LocateAsync(LocatorExpression, TimeSpan timeout, CancellationToken)is upstream’slocate(surface.ts), so a locator orExpecton a device resolves in the engine. It snapshots withinteractiveOnly: false, runsDeviceLocator.ResolveExpression, and binds the matches in a separate map capped at 2048 (the oldest goes first; an older ref isNODE_STALE). It hands the capture it matched against toEngineStartOptions.Screen, and tellsEngineStartOptions.Environmentthe platform and device once, when the session starts. Differences:timeoutis the budget left (upstream’soperation.timeoutMs), since the core session has no operation context; the expression is one flat record (LocatorExpression) where upstream’s is a union ofquery,filter,index,union,selector, andframe; and the port’s refs carry no revision, so upstream’srejectSupersededLocatehas no port (a device mints a new id for every projection, so a later locate never reuses a ref). Core retries a retryableEngineExceptionof a locate until the wait’s deadline, asresolveOncedoes.- Upstream’s operation budget for reads (
fix(mobile): bound reads by the operation budget,57f9ed9, tester-army/e2e#1464) is ported for the snapshots a locate and a keyboard dismissal take.InputBudget.ReadAsync(upstream’sread) runs a snapshot with what is left of the budget, andInputBudget.RemainingisremainingMs. A locate runs under a budget of its owntimeout(DeviceSession.InputBudget(label, timeout), upstream’sinputBudget(label, timeoutMs)), so a device that stops answering fails the locate withOPERATION_TIMEOUT, which a locator reports asACTION_FAILED, where it held the step until the test timeout. A sparse capture’s retry the budget cannot fit returns the sparse capture, and a capture the budget abandoned is not taken again. A relocation before an action, and the snapshots of the keyboard dismissal, run under the input’s budget.device.dismissKeyboardnow has a budget too (actionTimeout), as upstream’s has. The observation and the screenshots are bounded too (#892).IEngineSession.ObserveAsync(TimeSpan timeout, CancellationToken)andScreenshotAsync(TimeSpan timeout, CancellationToken)carry upstream’soperation.timeoutMs(a public API change, likeLocateAsync’stimeout): they have a default that drops the budget and calls the overload without it, so an engine that bounds nothing keeps compiling (.NET-only).DeviceSessionoverrides them.ObserveAsyncruns its snapshot and its viewport probe under oneInputBudget('observe'),ScreenshotAsyncits snapshot and its capture under oneInputBudget('screenshot'), so a device that stops answering fails withOPERATION_TIMEOUTand the screenshot cannot take a fresh budget. The core callers pass what they have:Screen.TreeAsyncits timeout, a locator resolve over an observation andToHaveScreenshotAsyncthe budget of the read window. Calls with no timeout (the agent’s looks, failure evidence,ObserveAsync(CancellationToken)) getActionTimeout.IDeviceActions.ScreenshotAsync(DeviceSession, TimeSpan, CancellationToken)takes the timeout too; the overload without it stays, and the one with it defaults to it (.NET-only), so a caller-providedMobileEngine.Actionsthat defines only the old member keeps compiling. An infinite timeout (Screen.TreeAsyncwith none) gives anInputBudgetthat never expires and bounds no wait (.NET-only: upstream’s budgets are numbers of milliseconds).ScreenshotArtifactAsync(label, TimeSpan timeout, ct)isartifacts.screenshot(label, operation); the overload without a timeout runs underActionTimeout.IEngineSession.ObserveAsync(ObserveOptions? options, TimeSpan timeout, ct)is upstream’sobserve(operation, { pixels, comparable })(ObserveOptions { Pixels, Comparable }isEngineObserveOptions; a public API change). WithPixels,Observation.Pixels(anEngineScreenshot: upstream’spixelsandmaskedRegionCount) carries the screen’s image, with every secure field covered and the status bar normalized whenComparable; the default drops the options and returns the tree alone (.NET-only), as an engine that takes none does.DeviceSession.CapturePixelsAsynciscapturePixels: it takes the screenshot under the observation’s budget, rethrowsOPERATION_TIMEOUT, and costs the observation its image (not the step) for any other failure or a secure field it cannot prove covered. The agent still takes its screenshot throughCapture, soObservationFeeddoes not useObservation.Pixelsyet. A read the caller cancels isCANCELLED(InputBudget.ReadAsync), as the command reports it. TheInputBudgetparameter ofSnapshotAsyncandSnapshotOrEmptyAsyncstays nullable, where upstream’s is required. Tests, inEngine/ObservationTests: ‘bounds screenshot by operation budget’, ‘rethrows OPERATION_TIMEOUT from capturePixels during observe’, ‘shares one budget across observe steps so screenshot cannot take a fresh budget’, ‘captures pixels on request, masks every secure node, and degrades to tree-only when it cannot’, and ‘holds the status bar in a fixed state for a screenshot taken for comparison, and only then’ and ‘withholds the pixels of a screen with a secure field when the image cannot be read or decoded’ (now run throughObserveAsyncwithPixels). Tests: inEngine/ObservationTests, ‘bounds a snapshot by the operation budget’, ‘returns a sparse capture when the budget cannot fit a retry, instead of timing out’, ‘bounds the snapshots of a keyboard dismissal by its budget, and reports one cut off after the drag as possibly committed’, ‘lets a slow snapshot run for the whole timeout the locate gets’, and ‘takes no second snapshot for a capture the budget abandoned’; inSupport/SupportHelpersTests, ‘runs a read with what is left of its budget, and reports one cut off after an input as possibly committed’. These run on real timers of a few hundred milliseconds. - Upstream’s Android locate (
fix(mobile): keep locator polling through unreadable android snapshots,4fe6baf) is ported. A snapshot agent-device cannot read yet (details.androidSnapshotHelperFailureReasonofempty-helper-output,system-window-only, orcontent-poor-app-window, the messageAndroid snapshot helper returned insufficient foreground app content) matches nothing in a locate, so a locator orExpectkeeps polling until its wait runs out, and a locate whose capture leaves no budget fails withENGINE_FAILUREand that message.DeviceErrors.IsUnreadableCapturereads the reason off theAgentDeviceErrorthat the translatedEngineExceptionkeeps as itsInnerException. An observation, such as the agent’s next turn, still fails on it at once, as upstream’s. - Upstream’s iOS locate (
2b2b845, tester-army/e2e#1281) is ported. Just afterOpenAppAsync,RestartAsyncorOpenLinkAsync, a snapshot that iOS refuses withdetails.runnerErrorCodeofAPP_NOT_RUNNING(DeviceErrors.IsAppNotRunning) matches nothing in a locate (locator waits andExpectonly; an observation still fails at once), like an unreadable Android capture, until a snapshot succeeds (DeviceSession._launching, upstream’slaunching). A wait that runs out while the app is still down fails withENGINE_FAILUREand that reason. An app that exits after its first readable screen still fails at once. - Upstream’s Android test id match without the
<package>:id/prefix (feat(mobile): match Android test ids without their package prefix,2791786) is inDeviceLocator, whichDeviceSession.LocateAsyncnow calls, soScreen.GetByTestId("greet")matches<package>:id/greeton Android when nothing matches the full id. - The run and the attempt reach the engine (tester-army/e2e
OperationContext.runIdandattemptId,engine/contract.ts; #1293):E2ESessionmints the attempt id before the engine starts and hands it, with the run id, toEngineStartOptions.AttemptIdandEngineStartOptions.RunId(upstream’sEngineAttemptContext.runIdandattemptId);EngineSession(the adapter, upstream’screateEngineSession) stampsOperationContext.RunIdandOperationContext.AttemptIdon the context of every call that takes one (PerformAsync,PerformAtAsync,SwipeAsync,BackAsync,ResizeAsync). .NET-only: the two areinitproperties with an empty default on the record (OperationContext.TestandAgentare shared values, so they hold none, and a context built before the ids existed still compiles). Not ported: the calls that take no context (OpenAsync,ObserveAsync,PressAsyncand the rest) carry no ids, norsignalortimeoutMs(#1366, #1235);EngineContract/RunnerEngineContractTests.Partial_Threads_a_consistent_live_OperationContext_through_every_engine_callis partial for that reason. - Who acts is
OperationContext.Origin(upstream’soperation.origin,contract.ts): a test’s step isOperationContext.Test, the agentOperationContext.Agent. The agent settles after each action. A test never settles and waits out a transition (TransitionMilliseconds) for a control that arrived with the last action.DeviceSessionimplements the overloads with a context (PerformAsync,PerformAtAsync,SwipeAsync,BackAsync) andIDeviceActionshas the same default members forPerformAsyncandSwipeAsync.DeviceSession.OriginandActionOriginshipped in v0.8.0, so they stay as[Obsolete]for one release:DeviceSession.Originonly decides the members that carry no context (default agent), andActionOriginisOperationOrigin. The fixture methodsLongPressAsync,HoverAsync,DragToAsync, andSwipeAsync(node, direction, momentum)are a test’s own steps, so they never settle (they did, by default, before). Real test steps run through theScreen, which now passes the test origin, so on a device they stop settling, as upstream’s do. The coreLocatorActionhas no long press, hover, drag, or swipe momentum, soLongPressAsync,HoverAsync,DragToAsync, andSwipeAsync(node, direction, momentum)are methods ofDeviceSession.PointerActionandPointmoved to the coreE2E.Enginenamespace (upstream’sPointerAction), andDeviceSession.PerformAtAsync(point, PointerAction)is the engine contract’sIEngineSession.PerformAtAsync; the mobile session declaresActionKindsandPointerActionKindsfor the kinds it takes.ScrollIntoViewandSelectareUNSUPPORTED_CAPABILITY. - Upstream’s mobile ref generations (
fix(mobile): pin each action's ref to the snapshot it came from,eeacc8a, tester-army/e2e#1413, andfix(mobile): reject stale refs after transition refresh,4af1aa8, tester-army/e2e#1300) are ported.RawSnapshot.RefsGeneration(upstreamRawSnapshot.refsGeneration) travels throughProjectedSnapshot.RefsGenerationintoNodeBinding.RefsGeneration, andDeviceSession.ActionTarget(actionTarget) sends@<ref>~s<generation>when the capture reported one, so agent-device refuses a superseded ref (ref_generation_mismatch, a retryableNODE_STALE).DeviceSession.Currentiscurrent:DragToAsynctakes both refs from the newest capture, finding a binding again where it was (SamePlace) and failing withNODE_STALEbefore sending when no node is there.RelocatedAsyncthrowsNODE_STALEwhen the fresh snapshot lists no such control, where it used to act on the binding as it was._latestScreenis upstream’slatestScreen, the projected screen of the newest capture. Deviceis a plain class (session.Device) with...Asyncmethods that take a cancellation token per call. EachDevicecall is aresourcestep nameddevice.<method>, with upstream’s label (the state, mode, permission, orientation, pose, or alert action; the build path or the link with its query and fragment cut;<n> charsfor clipboard text), throughEngineFixtureContext.RunOperationAsync(.NET-only, upstream’sFixtureRecorder.run); aDeviceon a session no test harness started runs unrecorded. The call is not wrapped in the action timeout, as upstream’s is.appearance,network,alert, and biometric results are enums. A permission name or state cannot be unknown, so theINVALID_ARGUMENTcheck for one is not needed.- The sample (
samples/MobileApp.E2ETests) derives fromMobileAppTest(see MobileAppTest). It launches the app withDevice.OpenAppAsync, because the coreApp.OpenAsyncneeds a URL, and reads theDevicefixture fromMobileEngine.ActiveSessions, because the core session does not expose the engine’s session. It was run against an iPhone 17 simulator. The Android path is not run. MobileTools.CreatereturnsAgentTools by name (the port’sdefineTool), withPlatformsas the strings the engines report (ios,android). PassMobileTools.Create(engine)as the agent’s tools (AgentToolsonE2ETest), and the agent offersopen_app,swipe, andalerton the platforms of the engines it was built from.open_appwithout anappreturns to the target’s app, and refuses withINVALID_STATEwhen the target pins none.ai-importshas no counterpart: there is noaipackage.- agent-device takes no abort signal, so a cancelled command keeps running. Upstream’s surface tracks those commands and makes the next attempt wait for them. The port does not: each attempt has its own session and client.
- The key grammar is
KeyGrammarin the core (E2E.Engine, upstream’sparseKey), shared by the mobile and Windows engines. - Video is
DeviceSession.StartVideoAsyncandStopVideoAsync(upstream’sstartVideoandstopVideoofAgentDeviceSurface), overrecording.record(commandrecord, withquality: medium,recordingScope: device, andhideToucheswhenMobileOptions.VideoTouchesis false). The file isvideo/video.mp4inMobileStartInfo.ArtifactsDir(upstream’sartifactsDir;EngineStartOptions.ArtifactsDirfills it). A recording is marked before the device is asked, so a start that outlived its budget is stopped when the session is disposed, as is one whose stop failed (upstream’sendAttemptanddispose). A recording the device finalized elsewhere is moved into place. A screen-recording stop in flight is shared (ScreenRecording.Stopping, upstream’sstoppingofScreenRecordinginsurface.ts, #15598f425b1): a laterStopVideoAsyncand the session’s close wait for it instead of sending a secondstop, a caller whose token is cancelled leaves the stop running and getsCANCELLED, and a stop that fails is dropped so the next caller or the close sends it again. The close sends the stop on the client it holds, not through the shared task (StopQuietlyAsync), since the session has no client left by then. Tests:Engine/VideoTestsports the three newitofdescribe('video')(#1559): ‘shares a pending recording stop with another caller and attempt cleanup after cancellation’ (it does not check thesessions.closecounts across a next attempt: the port’s session is one attempt), ‘retries a stop that rejects %i promise turns before cleanup after its first caller cancels’ (the port’s turns areTask.Yieldcalls), and ‘does not send a new recording stop for a caller that was already cancelled’. A session is one attempt, so upstream’sstartAttemptcleanup (sessions.closeof a leftover recording) has no port, and the in-flight commands outlive the session on the engine (see In-flight commands). Closing a session does not wait for a recording start that outlived its budget before it stops the recording (upstream’sendAttemptsettles the in-flight commands first), so the daemon may see the stop while the start still runs. The device provider’s recording (LeaseRecording) is in Provider recording. The agent-device parameters were read from upstream and the 0.21.25 daemon’s command table; on an iOS 27 simulator with Xcode 27.1 the daemon accepted the start, and its stop timed out inxcrunafter 30 s, so a recorded file is not yet seen end to end. VideoTests(describe('video')ofengine.test.ts) are ported in full on a scripted client; “records and stops on the pinned $platform device after closeApp ends the previous session” runs the second attempt as a new session.ManifestTestsdeclares the video capability.- Upstream’s keyboard drag start (
fix(mobile): start the iOS keyboard-dismissing drag clear of controls,787a5d5, tester-army/e2e#1305) is ported.Keyboard.KeyboardDragStartinKeyboard.csis upstream’skeyboardDragStartinkeyboard.ts(the class name is the module’s, since C# has no free functions).DeviceSession.KeyboardTopis upstream’skeyboardTop, andRawSnapshot.KeyboardFramecarries the keyboard fact’s frame it reads.SnapshotProjection.ScreenKindsis exported as upstream exportsSCREEN_KINDS.DismissKeyboardAsyncdrags from that point, and a screen with none fails withUNSUPPORTED_CAPABILITYbefore any drag. Tests: fiveits ofdescribe('device fixture')inEngine/DeviceFixtureDismissingAKeyboardThatHasNoDismissKeyTests. Not ported: ‘dismissing the keyboard over choice controls leaves them as they were’ (apps/mobile-benchmark/tests/device.e2e.ts), which needs the mobile benchmark app, a React Native app the port lacks. - Upstream’s
device.unstable_raw(feat(mobile): device.unstable_raw exposes the test's agent-device session,c3c4238, tester-army/e2e#1380) isDevice.UnstableRaw. Upstream’sDeviceSessioninterface (device.ts) isRawDeviceSession, a .NET-only name, because the port’sDeviceSessionis the surface (upstream’sAgentDeviceSurface) and a public type of that name exists. Itsclientis the session’sIDeviceClient(the port’s stand-in forAgentDeviceClient),selectionisDeviceSelection, andplatformisMobilePlatform.BoundDevice(surface.ts) is internal, set by the boot from theidanddeviceof thedevices.bootanswer (DeviceSession.BoundDevice, upstream’sboundDevice), and cleared when the session closes. ReadingUnstableRaw, orClientof a handle taken earlier, after the session closed isINVALID_STATE. The client isDeviceCommands.Translate, which refuses a method it does not list, soDeviceMethods.AppsList(apps.list, the daemon’sappscommand) is added for upstream’s reference example; the other methods of upstream’s client stay unsupported until code calls them. Tests: the threeitofdescribe('unstable_raw')inEngine/DeviceFixtureUnstableRawTests; the first isPartial_, since the port’s fixture has no map of declared operations forexpect(declared).not.toHaveProperty('unstable_raw'). Not ported:unstable_raw reaches the test session through agent-device(apps/mobile-benchmark/tests/device-fixture.e2e.ts), which needs the mobile benchmark app, a React Native app the port lacks. - Upstream’s known-viewport fix (
fix(mobile): keep the known viewport when the app reads smaller than the screen,7674a2c, tester-army/e2e#1291) is ported.DeviceSession.Projectlearns a snapshot’s viewport only when it is plainly the screen’s: the first one the session reads, the one it knows, or that one rotated (SameScreen, upstream’ssameScreen; two sizes within a point are one screen, since rects from the tree carry fractions).ViewportForAsync(upstream’sviewportFor) checks a tree of any other size against the device’s screenshot, in either orientation, before it replaces the known one: a screenshot reports the portrait size even in landscape, so it confirms a size but cannot pick the orientation. The size it checks against isDeviceSupport.LogicalScreenSize(upstream’slogicalScreenSize): the screenshot’s logical dimensions, else its pixel dimensions over its density. A simulator’s screenshot reports those; a real device’s reports neither, so there the tree’s size is taken as it comes. A screenshot that fails during that check fails the observation, as upstream’s does.TraceScreenandMaskedScreenshotAsyncsize the trace screen and the secure-field masks by the known viewport, not the tree’s. On iOS, a swipe from a sheet’s grabber can pull down Notification Center, and the app’s tree behind it reported a third of the screen (130x281 on a 390x844 device), which misplaced every rect and tap after it. Upstream records this only in its changeset; its skill references and docs say nothing about it, soSKILL.mdanddocs/have nothing to mirror. Tests: inEngine/ObservationTests, ‘keeps the known viewport for an app drawn smaller than the screen, and follows a rotation’ (new) and ‘measures the screen in the viewport the snapshot publishes, and in its tree when it publishes none’ (split into two harnesses, as upstream’s); inEngine/DeviceFixtureDismissingAKeyboardThatHasNoDismissKeyTests, ‘drags at the centre of a screen rotated since the last observation’ (new), since the keyboard drag measures its start throughViewportForAsynctoo. - Upstream’s input budget (
fix(mobile): bound each input by its budget,14b77d3, tester-army/e2e#1073) is ported. An input (a tap or other node action, a point action, typing, a key,back, a keyboard dismissal, and the nodeLongPressAsync,HoverAsync,DragToAsync, andSwipeAsyncthe port has in place of upstream’slongPress,hover,dragTo, andswipeactions) runs its device commands underInputBudget(DeviceSupport.cs, upstream’ssupport.ts): with no budget left the input is not sent and fails withOPERATION_TIMEOUT, an input that does not answer in time fails withACTION_MAY_HAVE_COMMITTED, one sent with almost no budget left still gets 250 ms to answer, a hold (a long press or timed swipe) at least as long as the budget left is refused withNOT_ACTIONABLE, and each command of a multi-command input (a key on an unfocused field) is sent on its own. Launches and artifacts are unbounded. Snapshots are bounded since #869 (see the next bullet). Differences: upstream reads the budget per call, fromoperation.timeoutMs, which is the call’stimeoutoractionTimeout. The port’s session calls carry no timeout, so every input getsDeviceSession.ActionTimeout, whichMobileStartInfo.ActionTimeoutsets (EngineStartOptions.ActionTimeoutfills it), as the web engine’s operations get the action timeout.DeviceSession.InputBudgetis upstream’sinputBudgetandDeviceSession.SendInputAsyncitssendInput.InputBudget’strackis anAction<Task>that registers the task (upstream’s returns the promise it is given); see In-flight commands. TheOperationContext.signaldoc change indocs/reference/engine.mdxandcontract.tshas no counterpart: the port has noOperationContext. Tests: inEngine/ObservationTests, ‘ends %s, hung on %s, at its budget as possibly committed’ (a theory of the same seven entries; the screen swipe is aperformon the root), ‘sends nothing once a settling target spent the budget, and no keystroke once a focus tap used it up’, and ‘refuses a long press that holds longer than its timeout leaves, before sending it’ (also on the nodeLongPressAsync); inSupport/SupportHelpersTests, ‘sends an input with what is left of its budget, and reports one cut off as possibly committed’. These run on real timers of a few hundred milliseconds, where upstream’s fake timers do not wait. ‘lets a locate outlive its budget’ was replaced in #869. - Upstream’s Compose Multiplatform text fields on iOS (
mobile reads Compose Multiplatform text fields on iOS,75ae2ab, tester-army/e2e#1427) are ported in part.SnapshotProjection.ProjectSnapshotreads the placeholder an empty iOS field folds into its label (upstream’sfoldedPlaceholderinnodes.ts,FoldedPlaceholderhere): for an empty (no value), editable, non-secure iOS field that reports no placeholder of its own, whose only child is aStaticTextwith no children, and whose label is a non-empty name, then,, then that child’s text, that text is the field’sPlaceholder, the child is left out of the tree, and the name is the label before,(a non-emptyContentDescriptionstays the name, and that label is then theText). A field of any other shape keeps its label and children as reported. The private recordFoldedis a .NET-only name for upstream’s inline{ label, placeholder, child }object. Test: ‘reads the placeholder an empty Compose Multiplatform field folds into its label’ inNodes/SnapshotProjectionTests.mayTakeTextandNodeBinding.takesText(nodes.ts,surface.ts) are ported (#850):SnapshotProjection.MayTakeTextandNodeBinding.TakesText, set inBindfrom the node with its children.DeviceActions.PerformAsyncrefuses afillorclearwhose node does not take text withUNSUPPORTED_CAPABILITY(the message of upstream’srefuseFill,RefuseFillhere), before the action and again on the binding found by a fresh snapshot taken just before typing (upstream’srelocated;DeviceSession.RelocatedAsync, with the transition wait split out asWaitForTransitionAsync, upstream’swaitForTransition). Tests: ‘Acts_on_an_unclassified_iOS_field’, ‘Rejects_an_unclassified_iOS_element’, and ‘Rejects_an_unclassified_iOS_element_that_gained_a_control_before_typing’ inEngine/InputFreshnessTests. Differences: a fill or clear now reads the field again, so it costs one morecapture.snapshotthan before. Upstream’srelocatedinputflag is ported with #751. - Upstream’s mobile input revalidation (
fix(mobile): revalidate input bindings before fill and clear,b309bcd, tester-army/e2e#1410) and keyboard transitions (fix(mobile): reobserve targets after keyboard transitions,bdd7315, tester-army/e2e#1297) are ported.DeviceSession.RelocatedAsynctakesforInput(upstream’sinputflag ofrelocated;inputis theInputBudgethere). With it, a truncated or sparse capture, a node the capture no longer lists, or a changedInputPurpose,Disabled,Secure, orHiddenis a retryableNODE_STALEbefore anything is typed, andDeviceActions.PerformAsyncsets it forfillandclear.ProjectedSnapshot.KeyboardVisible(set inProjectfromKeyboardShowing) andNodeBinding.KeyboardVisiblestand for upstream’sProjectedScreentype (ProjectedSnapshot & { keyboardVisible }), which C# has no intersection type for.LatestScreenandMarkAction(ProjectedSnapshot?)replaceLatestIndexand the index-basedMarkAction(upstream’slatestScreenandmarkAction(before: ProjectedScreen)), andWaitForTransitionAsyncacts at once on an unmoved control only when the keyboard state of the screen before the action equals the control’s.DeviceErrors.StaleOralso mapstarget_still_movingwithdetails.dispatched: noto a retryableNODE_STALE. Theagent-input-stale.test.tsfile of #1410 is already ported in part (AgentInputStale/SecretFillStaleRetryTests); its replay half still needs a project runner,credentials, and thesecret.fillpolicy event, which the port lacks. Tests: theinput freshnessits inEngine/InputFreshnessTests, the three keyboardits inEngine/DeterministicActionsTests, and ‘retries a moving target only when no input was dispatched’ inErrors/ErrorTranslationTests. - Upstream’s WebDriver element-type fix (
fix(mobile): read XCUIElementType class names as their XCTest types,3f9a7d8, tester-army/e2e#1133) is ported.SnapshotProjection.NormalizeKindis upstream’snormalizeKindinnodes.ts: it drops^XCUIElementType(?=[A-Z])(XcuiElementTypePrefix, a .NET[GeneratedRegex]for upstream’s inline regex) before it maps the type, so theXCUIElementTypeButtonthat agent-device’s WebDriver runtime reports on hosted Appium clouds reads asButton.DeviceSession.KeyboardShowingis upstream’skeyboardShowinginsurface.ts: it routes node types throughNormalizeKind, so anXCUIElementTypeKeyboardcounts as a shown keyboard. Upstream records this only in its changeset; its skill references and docs say nothing about it, soSKILL.mdanddocs/have nothing to mirror. Tests: inNodes/SnapshotProjectionTests, ‘reads the XCUIElementType class names a WebDriver session reports as the native XCTest types’; inEngine/DeviceFixtureDismissingAKeyboardThatHasNoDismissKeyTests, ‘reads an XCUIElementTypeKeyboard from a WebDriver session as a shown keyboard’. - Upstream’s held-device skip (
mobile: skip booted devices another agent-device session holds,9e53c40, tester-army/e2e#1379) is ported.BootedDevices(DevicePool.cs, upstream’s class inpool.ts) skips a booted device whose inventory entry has aclaimedBy.sessionthat is not one of this target’s own slot sessions, logs the skipped ones, and failspreparewith a non-retryableENGINE_FAILUREwhen every booted device is held.BootedDeviceis upstream’s interface of that name, as a record.LifecycleTests.Skips_a_booted_device_another_agent_device_session_holds_keeps_one_its_own_slot_session_holds_and_fails_when_every_booted_one_is_heldports thelifecycleitofengine.test.ts, whole. - Not ported: the tool-pixels test (needs the full runner and a scripted model).
Engine/DeviceFixtureTestsports ‘refuses an openApp permission name it does not know before any device command’ asPartial_:DevicePermissionis a closed enum, so the unknown name is a cast number, anddevice.openApp({ permissions })refuses it withINVALID_ARGUMENTbefore any command (DeviceSession.OpenAppAsync, upstream’sassertPermissionscall inopenApp). It also ports ‘labels openApp and openLink steps without the link query and setClipboard by length’ (the port reads the labels off the recorded steps; upstream reads them off the declared operations).Engine/LifecycleTestsports ‘refuses a second startAttempt while one runs and treats cold cleanup as a no-op’ asPartial_. A secondMobileEngine.StartAsyncfor a worker slot (target and slot) whose session has not closed isINVALID_STATE(MobileEngine.ClaimSlotandReleaseSlot, upstream’sthis.attemptcheck instartAttempt). The coldendAttemptanddisposehave no counterpart: an attempt is the session and its dispose, and the engine has no worker-level cleanup (issue #1420).- The provider example (
docs/examples/mobile/device-cloud-provider.ts) isdocs/examples/mobile/DeviceCloudProvider.cs(DeviceCloudProvider.CloudDevices), compiled intoE2E.Mobile.Testsand tested byProviderExample/ProviderExampleTests. ItsleasesFactoryargument is .NET-only (it stands in for upstream’svi.doMockofagentDeviceLeases). ‘leases with the token, the selectors, and a summary, and releases through the same leases’ isPartial_:IAgentDeviceLeases.ReleaseAsynctakes the lease alone, so the release context upstream asserts is not passed on.
Expo Simulators
Section titled “Expo Simulators”ExpoSimulators (the E2E.Expo package, namespace E2E.Expo) ports @e2e-dev/eas: hosted iOS simulators and Android emulators from Expo, leased through Expo’s GraphQL API over HttpClient, with no SDK. The provider is its own package, E2E.Expo, which depends on E2E.Mobile, as upstream’s @e2e-dev/eas is a package of its own. It keeps a private copy of the shared HttpClient, so E2E.Mobile exposes nothing extra for it. Pass it as MobileOptions.Provider. The sessions, the queue and startup limits, the idle backstop, the EXPO_TOKEN or eas-cli login, and the project id from the app config follow upstream. Differences:
- Upstream renamed
easSimulators()toexpoSimulators()and kepteasSimulators()andEasSimulatorsOptionsas deprecated aliases (tester-army/e2e#1517). The port renamesEasSimulatorstoExpoSimulatorsandEasSimulatorsOptionstoExpoSimulatorsOptionsand keeps no alias, a breaking change for .NET callers. The provider name isexpo-simulatorsand its configuration errors start withexpoSimulators. The package isE2E.Expo, notE2E.Eas, a breaking change for .NET callers, while upstream keeps@e2e-dev/eas. - Options are the
ExpoSimulatorsOptionsrecord, so an unknown option key is a compile error and upstream’srejectUnknownKeyshas no counterpart. A bad combination (BuildIdwithApplicationArchiveUrl, an idle limit not below the duration) isINVALID_CONFIGfrom the constructor. - A dynamic app config (
app.config.tsand its siblings) is evaluated by running the project’s ownexpo configwithnodefrom the path of the process, so it needs Node. A staticapp.jsonneeds nothing. - The request’s cancellation is a
CancellationToken. A cancelled read of the app config is anOperationCanceledException; upstream wraps it as “could not read the Expo app config”. - A device request always carries the project root, so upstream’s check for an engine that passes none has no counterpart.
- The sessions client checks the shape of each Expo answer as upstream’s
easSessions()does: an answer that is JSON but lacks the fields an operation reads fails withExpo: unexpected response to <operation>, and an answer that is not a GraphQL object isExpo: HTTP <status>, no data. All 7its ofclient.test.tsare ported (Client/EasSessionsTests). One difference: the port also replaces the Expo token or session secret with*****in the error text it builds from Expo’s answer, which upstream leaves to its report-boundary redactor.
Limrun
Section titled “Limrun”LimrunSimulators (the E2E.Limrun package, namespace E2E.Limrun) ports @e2e-dev/limrun: one hosted iOS simulator or Android emulator per worker slot, created, polled to ready, driven through an agent-device daemon the provider starts for it, and deleted on release. Pass it as MobileOptions.Provider. The key and base URL (LIMRUN_API_KEY, LIMRUN_BASE_URL), the instance spec, the daemon environment, the retained lease, the 20-second heartbeat, and the cleanup follow upstream. The client has the lease commands the provider needs: leases.allocate, leases.heartbeat, and leases.release (DeviceMethods), sent as agent-device’s agent_device.lease.* JSON-RPC methods. Differences:
- The provider is its own package,
E2E.Limrun, which depends onE2E.Mobile. Upstream’s@e2e-dev/limrunis a package of its own too. The package keeps private copies of two smallE2E.Mobileinternals (the argument builder and the sharedHttpClient), soE2E.Mobileexposes nothing extra for it. - Limrun’s REST API (
/v1/ios_instancesand/v1/android_instances: create, get, delete) is called overHttpClient, with no@limrun/apiSDK. Like upstream’s configuration of the SDK, it retries nothing and gives each request 60 seconds. - Upstream forks a Node process per device, so the daemon and its lease client get the instance’s credentials without changing the runner’s environment. The port starts the daemon itself, with exactly the run’s environment plus the instance’s (
AgentDeviceDaemon.LocalAsyncwith an environment), and runs the lease and install calls in the runner.AgentDeviceDaemon.StopAsyncrunsagent-device daemon stop --clean. - Upstream pins agent-device as a dependency of
@e2e-dev/limrun, at the engine’s version (0.21.36), and checks that the installed one matches. The port always starts the pinned release (AgentDeviceVersion.Pinned), so nothing is installed by hand. It only checks that the engine asked for that release, and the daemon’s own version check runs when it starts. - The lease request leaves out
providerCredentialFingerprint. The daemon only compares it with the credentials of a daemon that was already running, and the port starts a fresh daemon with the right credentials for every device. - Options are the
LimrunSimulatorsOptionsrecord, with enums for the device models, so an unknown option is a compile error and upstream’srejectUnknownKeyshas no counterpart. - Upstream’s Limrun page (
docs/integrations/limrun.mdx) is ported asdocs-site/src/content/docs/integrations/limrun.mdx, with the port’s C# names. Upstream has noexamples/with-limrundirectory at7b1b8b27: itsexamples/examples.jsonlists alimrunentry that links to the partner repositorylimrun-inc/testerarmy-e2e-limrun(a SwiftUI and a Jetpack Compose greeting app, both built remotely on Limrun), anddocs/examples/limrun/holds two snippets (e2e.config.ts,greeting.e2e.ts) that the Limrun page includes. The page’s “Test an app flow” section (thegreeting.e2e.tssnippet) is ported inlimrun.mdxas a C# test for the greeting form ofsamples/MobileApp, which already has that flow (GreetingTests). The partner repository is not ported: it holds two native apps the port cannot build or host here, and a .NET example would be a second project, with two native apps to build, for a service the port cannot reach in tests.samples/MobileAppis the port’s mobile example, and its greeting form is the app the snippets drive. - Not verified against a live service: the lease wire format was read from agent-device’s code (the
agent_device.lease.*methods and their params in the daemon, and the client that writes them), and Limrun’s REST calls from the@limrun/api0.59.0 source. No test reaches Limrun or a daemon.
BrowserStack
Section titled “BrowserStack”BrowserStackDevices (the E2E.BrowserStack package, namespace E2E.BrowserStack) ports @e2e-dev/browserstack (packages/browserstack, upstream commit 64432f1, tester-army/e2e#1307, which is after the parity target above): BrowserStack App Automate real Android and iOS devices, one per worker slot, as an IDeviceProvider for MobileOptions.Provider. Each slot gets its own agent-device daemon, which runs the session through agent-device’s built-in browserstack provider; releasing the lease stops the daemon, which ends the session. Taken from upstream: the options, the INVALID_CONFIG checks (blank values, NetworkProfile with CustomNetwork, a plain http build, NoResignApp off iOS, an app on the target as well), the https build uploaded once per run, endpoint, and account (the log names the upload by its bs:// id only), a local build resolved against the project root, the session name e2e-<run id>-<target>-<slot> (a given SessionName gets -<slot> when the target has more than one slot), RecordAsync finding the session by build and name through the App Automate API and linking its video_url as video/mp4, BROWSERSTACK_API_ENDPOINT (an http(s) URL with no query, fragment, or credentials), and the errors that never repeat the credentials or a signed app URL. Differences:
- The lease helper upstream adds in the same commit (
@e2e-dev/mobile/lease:agentDeviceLeases(),daemon.ts,driver.ts,heartbeat.ts, moved out of@e2e-dev/testmu) is ported intoE2E.MobileasE2E.Mobile.Lease.AgentDeviceLeasesisagentDeviceLeases()andIAgentDeviceLeasesis itsAgentDeviceLeasestype (theIprefix is C# casing).AgentDeviceLeaseOptions,AgentDeviceLeaseRequest, andLeaseSelectorskeep upstream’s names and fields.LeaseSelectorslists theprovider*keys as properties, where upstream picks them from the client configuration.PrepareHometakes aCancellationTokenbeside the home path. - Upstream runs the allocation in a child process (
driver.ts) so each daemon gets its own environment. The port starts the daemon itself with that environment (AgentDeviceDaemon.LocalAsync, which already runs agent-device as its own process) and callsleases.allocatefrom the runner, soLeaseDriverhas no child process. The allocation gets a 15-minute bound the daemon’s own deadline also enforces. The shutdown report ofdaemon stop --jsoncomes fromAgentDeviceDaemon.StopReportAsync(internal;StopAsyncis unchanged) and goes throughAssertSessionsEndedas upstream’s does: a release fails unless agent-device lists the granted lease as released, and a retried release only cleans up once the stop confirmed. - The allocate request of the port’s client now carries the device selectors (
platform,target,device, theprovider*capabilities,osVersion,imageTag,physical) beside the lease fields, as agent-device’s client spreads them into the params (read from agent-device 0.21.35). Limrun sends none, so its requests are unchanged. - The helper checks that the engine asked for the pinned agent-device (
AgentDeviceVersion.Pinned), asLimrunSimulatorsdoes, because the daemon it starts is that release. Upstream’s testmu provider checks its plugin against the version instead, and upstream’s BrowserStack provider checks nothing. - A lease is allocated and renewed under a named session (upstream’s
leaseSession,e2e-lease-and the first 8 hex digits of the SHA-256 of the state directory), because agent-device refuses a provider lease to a client that names none. The lease requests of the port’s client now carry the client’s session assession(read from agent-device 0.21.36’s lease writer). Upstream sets it on the client configuration and, for Limrun, also on the binding’sclient. The port passes it as the client’s session instead, and keeps it out of a binding’sclient, wheresessionis reserved for the engine (DeviceBindings).LimrunHeartbeatderives it again from the binding’sstateDir. The named session is not checked against a live provider. - Options are the
BrowserStackDevicesOptionsrecord, with an enum forOrientation(BrowserStackOrientation), so an unknown option and a wrong type are compile errors and upstream’srejectUnknownKeyshas no counterpart.BrowserStackDevicesis the name of upstream’sbrowserstack()(the port names a provider class, asLimrunSimulatorsislimrun()), andBrowserStackDevicesOptionsisBrowserStackOptions. - The request’s cancellation is a
CancellationToken. A cancel stays anOperationCanceledException, also inside the API lookups, where upstream throws anErrorsaying “cancelled”. A request that gets no answer within its bound is aTimeoutException. Errors name the build and session as upstream’s do. - The credentials reach the daemon’s environment and nothing else: the lease’s
Client, the log lines, the errors, andBrowserStackCredentials.ToString()leave out the access key (a test checks the first three; the last is .NET-only, because a record prints its members).E2E.Clidoes not referenceE2E.BrowserStack, soe2e exploreande2e mcpcannot lease a BrowserStack device, and nothing registers the key as aSecret: upstream’s CLI loads the provider from the config, and the port’s tool ships only Limrun and DevFlow (see Mobile engine).E2E_MOBILE_PROVIDERdoes not namebrowserstackeither; set the provider in code, as for EAS. - Upstream’s
docs/integrations/browserstack.mdxis ported asdocs-site/src/content/docs/integrations/browserstack.mdx, with the port’s C# names. Itsdocs/examples/mobile/browserstack.config.tsandbrowserstack.e2e.tssnippets are not ported as files: they run the Wikipedia sample app on a Pixel 7, which the page shows as C#. Upstream’s icon and Open Graph images are not ported. - Not verified against a live account: no test reaches BrowserStack. A real agent-device 0.21.35 daemon accepted the port’s allocate request and sent it to BrowserStack, which answered “Invalid username or password” to fake credentials, and the lease directory was removed afterwards. Whether a session starts, installs the app, and ends on release is read from agent-device and upstream’s code only.
BrowserStackLiveTestsruns the whole path and is skipped withoutBROWSERSTACK_USERNAME,BROWSERSTACK_ACCESS_KEY, andBROWSERSTACK_APP. - Tests:
tests/E2E.BrowserStack.Tests/BrowserStack/BrowserStackTestsports theits ofdescribe('browserstack()'), andRecording/BrowserStackRecordTestsandRecording/UploadAppFromUrlTeststhe twodescribes ofrecording.test.ts. Three are partial (Partial_prefix) because a typed record cannot hold a non-string: the blank-value rows for the string options and forProject,Build, andSessionName, and theNetworkProfilewithCustomNetworkrow (not the non-booleanNoResignApprow). Not ported: theitfor an option the provider does not take (a record has no unknown keys) and the rows with a missing or non-string value. Theitfor the lease options is ported over an internal factory argument, because the constructor buildsAgentDeviceLeasesitself.tests/E2E.Mobile.Testsportslease.test.ts(Lease/AgentDeviceLeasesTests, over a fakeILeaseHost, .NET-only: upstream mocks thedaemon.tsandheartbeat.tsmodules),lease-daemon.test.ts(LeaseDaemon/LeaseDaemonTests; its first twoits run the realagent-device daemon stop, so they need Node and npx),lease-driver.test.ts, andlease-heartbeat.test.ts. .NET-only:BrowserStackDotNetTests(the plainhttpbuild, which upstream checks without a test, and the credentialsToString) andBrowserStackLiveTests.
In-flight commands
Section titled “In-flight commands”agent-device takes no abort signal, so a command a cancel or a timeout abandoned keeps running on the device. Upstream’s surface keeps them in inflight (track, settleInflight) and its startAttempt waits for them before it opens anything, so a ghost tap never lands in a retry. The port has the same behavior:
DeviceSession.Trackis upstream’strack:CommandAsync,ActAsync(upstream’sperformregistration), and everyInputBudgetregister the device command until it settles.DeviceSession.SettleInflightAsyncissettleInflight, andDeviceSession.StartAsynccalls it first, with the caller’s token, asstartAttemptdoes: a command that never settles fails the start asCANCELLEDonce the token ends, and the boot never goes out.- Differences: upstream’s surface is the worker, so it holds the set. The port’s session is one attempt, so
MobileEngine.InflightOf(target, slot)holds the set of a worker slot (InflightCommands, .NET-only) across the attempts that drive it. A command that fails after its caller left is read once and never reported. The set is keyed by target, slot, and the lease or device the binding names, so an engine reused for another run does not wait on a released device’s commands. The wait is also bounded byE2EDefaults.LaunchTimeoutwhen the caller’s token never ends (ENGINE_FAILURE). Upstream’s client takes no abort signal, so an abandoned command is still running when it is tracked. The port’s HTTP client would abort its request on a cancel and end the tracked task while the daemon may still run the command, soDeviceSession.Clientis aTrackedClient(.NET-only): it callsIDeviceClient.CallAsyncwith a token the caller cannot cancel, tracks that call itself, and the caller leaves by racing it, so a cancel still surfaces asCANCELLEDat once. Once the caller has left, the request hasE2EDefaults.LaunchTimeoutto answer (the bound of the next start’s wait) and is aborted after that. An aborted request that ends without a successful answer leaves daemon completion unconfirmed:InflightCommandsblocks later attempts for that target, slot, and device with a non-retryableENGINE_FAILUREfor the lifetime of that engine. A request that fails after the caller left counts as unconfirmed unless the failure is an error the daemon itself reported (AgentDeviceError.Reported, .NET-only); a transport or client-side failure is unconfirmed. A client that ignores the abort and successfully answers still confirms completion. The DevFlow client sequences its own steps and implements the .NET-onlyICancellableDeviceClientand is not detached (Appium keeps its tracked, detached path), so a cancel stops its following steps, such as the lease claim after the DevFlow status read.TrackedClientaccepts a .NET-onlyTimeProviderfor testing this deadline. A command that is not cancelled is not bounded, as before. Test:Engine/SessionHooksViewportSwipeLocationArtifactsTests, ‘Keeps_a_cancelled_command_in_flight_until_the_daemon_answers_even_when_the_client_honours_its_token’ (.NET-only), andEngine/TrackedClientTests, ‘Blocks_later_attempts_after_an_abort_without_daemon_confirmation’ and ‘Allows_the_next_attempt_when_a_client_ignores_the_abort_and_confirms_completion’ (.NET-only). Closing a session (upstream’sendAttemptordispose) does not settle the in-flight commands. - Tests:
Engine/ObservationTests, ‘keeps a timed-out input in flight: the next attempt waits for the device command to settle’, andEngine/SessionHooksViewportSwipeLocationArtifactsTests, ‘waits for an abandoned command to settle before the next attempt starts and its launch goes out’. Both wait on a command the test releases, not on a timer, apart from the 200 ms input budget of the first.
Provider recording
Section titled “Provider recording”IDeviceProvider.RecordAsync(lease, context, ct) is upstream’s DeviceProvider.record. When an attempt records video and the slot rides a provider’s lease, DeviceSession.StartVideoAsync calls it in place of agent-device’s recording, with the lease as it traveled to the worker (DeviceProviders.TravelledLease, upstream’s travelledLease: the id and the declared fields, never what a derived lease class kept) and a ProviderRecordContext of RunId, TargetName, AttemptId, and Env. DeviceProviders.RecordLeaseAsync is recordLease: a failure is ENGINE_FAILURE naming the provider and the lease, a failure met once the token was cancelled is CANCELLED, and a token already cancelled never reaches the provider. StopVideoAsync ends the recording with ProviderRecordings.StopProviderRecordingAsync (upstream’s stopProviderRecording) into a VideoFile or a VideoLink; the recording is marked at once and cleared when the provider confirmed the stop, before what it wrote is checked; a stop shared by concurrent callers runs once. Closing the session stops a recording still marked, best effort. DevicePool.Recorder is pool.recorder, and LeasedDevices.Recorder is recorder. Differences:
- Upstream’s
recordis optional, and a provider without one records with agent-device. A C# interface member has no absence to test, so the defaultRecordAsyncreturns null and a provider that returns null records with agent-device, asIBrowserProvider.RecordAsyncdoes.LeasedDevices.Recorderis always the provider. Upstream’sasDeviceProvidercheck thatrecordis a function andisProviderRecording’s check for astartedAtand astophave no port: the types say it. The context’ssignalis theCancellationTokenparameter. MobileStartInfo.AttemptId(upstream’sEngineAttemptContext.attemptId) names the recording’s attempt.EngineStartOptions.AttemptIdfills it, and a new id is made when it is absent. A run through the test host sets noRunIdyet, soProviderRecordContext.RunIdis empty there.- Upstream’s worker outlives its attempts and keeps what an attempt could not stop: a provider recording whose stop failed is retried at the next
startAttempt(which then blocks), a native recording that could not be confirmed stopped resets the leased session before the next attempt, and a worker disposed while the lease is reused keeps its session. The port’s session is one attempt that always ends its agent-device session: a recording whose stop failed is retried once, when the session closes, and then abandoned, and nothing is retained for the next attempt. Providers must clean up their recordings when they release a lease. - Tests:
Provider/DeviceProviderRecordingTestsports 10 of the 22itofdescribe('device provider recording'). Eight follow upstream: ‘records through the provider instead of agent-device, from the worker, with the lease id and the declared lease fields’, ‘reports a recording the service keeps as a link’, ‘keeps the agent-device recording for a provider without record’, ‘keeps the agent-device recording for a worker without a lease, when no prepare ran’, ‘names the provider and the lease when record fails, and has nothing to stop at attempt end’, ‘cancels a start whose budget ran out, and stops the recording that came up anyway at attempt end’, ‘never asks the provider to record for an operation already cancelled’, and ‘keeps a recording whose stop failed, so endAttempt stops it once more’. Two are partial (Partial_prefix): ‘stops a provider recording without closing its leased session when the worker is disposed mid-attempt’ (the port closes the session, so it checks the stop only) and ‘clears a confirmed provider stop before rejecting its invalid artifact’ (it checks the stops, not the reuse of the session). Skipped: ‘refuses a provider whose record is not a function’ (the type says it), and 11 that need a worker that survives attempts and retains a recording or its session: ‘keeps a reusable leased session when the provider recording still cannot stop during disposal’, ‘finishes a retained provider recording before the next attempt records in the same worker’, ‘blocks the next attempt while its retained provider recording cannot stop and preserves its owner’, ‘does not begin another attempt or record when a retained provider stop wait is cancelled’, ‘resets a leased session whose native recording still cannot stop after endAttempt’, ‘resets an unconfirmed native recording before another attempt in the same worker’, ‘fails the next attempt when its native recording reset cannot close the session’, ‘keeps an unconfirmed native recording after its stop wait was cancelled’, ‘preserves a session after native stop succeeded even when moving its artifact fails’, ‘retries an unconfirmed provider stop after endAttempt during disposal’, and ‘shares a pending provider stop and closes on reuse revocation before the stop resolves’. .NET-only: ‘keeps the agent-device recording for a provider that records nothing of this device’ (a provider whoseRecordAsyncreturns null).
device.locator
Section titled “device.locator”Device.Locator(string selector) is upstream’s device.locator: a Locator over a selector expression, which DeviceLocator answers with the agent-device selector grammar (see Mobile snapshot model). Upstream builds it with EngineFixtureContext.locator. The port has EngineFixtureContext (public, Locator(LocatorExpression) only) and IEngineFixtureHost (.NET-only): E2ESession hands the context to an engine session that implements the interface, once the attempt’s Screen exists, and DeviceSession keeps it for its Device. Device.Locator on a session no test harness started (an engine used on its own) is INVALID_STATE. The other members of upstream’s EngineFixtureContext (fixture, app, timeouts, signal, operation, attachArtifact, attachViewport, screen, expectable) have no port: the port’s fixtures take their own tokens, and record their steps through EngineFixtureContext.RunOperationAsync. Upstream’s engine test has no it for locator; Engine/DeviceFixtureTests has a .NET-only test, ‘mints a locator from an agent-device selector on the attempt’s screen’.
Kernel
Section titled “Kernel”KernelProvider (the E2E.Kernel package, namespace E2E.Kernel) ports @e2e-dev/kernel at the port’s parity commit: kernel() from provider.ts, the Kernel client from client.ts (KernelBrowsers, kernelBrowsers, KernelBrowserParams, KernelReplayParams), and envValue from env.ts. It is a WebEngineOptions.Browser provider: Name is kernel, AcquireAsync creates a browser, ReleaseAsync deletes it, SweepAsync deletes the run’s active browsers, Downloads reads a download back through the browser filesystem, and RecordAsync records a Kernel replay. Lease tags, the 600 s idle timeout, the cancelled-request delete, the sweep message, and the replay.mp4 replay with its retried download follow upstream. Differences:
- Upstream’s function
kernel(options)is the classKernelProvider(a type namedKernelwould clash with the namespace).KernelOptionsis a record that extendsKernelBrowserParams, as upstream’s interface does. - There is no Kernel .NET SDK (no package from Kernel on NuGet; Kernel publishes Node, Python, and Go SDKs). The client calls Kernel’s REST API with
HttpClient, the API key as a bearer token, and replaces@onkernel/sdk:POST /browsers,DELETE /browsers/{id}(404 counts as deleted),GET /browsers?status=active&tags[k]=v(paged byX-Has-MoreandX-Next-Offset),POST /browsers/{id}/replays,POST .../replays/{replayId}/stop,GET .../replays/{replayId}(Accept: video/mp4), andGET /browsers/{id}/fs/read_file?path=. The base URL ishttps://api.onkernel.com/, orKERNEL_BASE_URLfrom the run’s environment (the SDK reads it from the process environment). The SDK retries a failed request twice; the client retries nothing, since a retried create could allocate a second browser. The SDK keeps one client per API key; the client here is stateless, so the provider builds one for each request. An error answer becomes aKernelApiExceptionwith the SDK’s message, trimmed (401 Invalid or disabled API key). - Upstream types the create-browser body as the SDK’s
BrowserCreateParams.KernelBrowserParamshas properties forstealth,headless,gpu,timeout_seconds,profile,proxy_id,viewport, andtags(Stealth,Headless,Gpu,TimeoutSeconds,Profile,ProxyId,Viewport,Tags), andExtra, a JSON object for any other field by its wire name (proxy,extensions,region, …), which the properties win over, so the run’s tags and timeout stay. Upstream’sreplayis a boolean or the start-replay body; the port hasReplay(default true) andReplayParams.Scopeisnullfor the default,BrowserProviderScope.Worker. - The web engine calls
RecordAsyncfor an attempt that records video (see Video): the replay is the attempt’svideo/replay.mp4, and a headless browser, orReplay = false, gets the engine’s screencast. A download the browser took (Browser.WaitForDownloadAsync, see below) is read from the provider’sDownloadswhen the lease serves them (Downloads.SaveDownloadsToAsync, tested inProviderDownloads/). The provider tests both against a fake Kernel; the recording is not checked against a live Kernel. - Not verified against a live Kernel, because no
KERNEL_API_KEYwas available. The endpoints, field names, and paging headers were read from the@onkernel/sdk0.113.0 source (browsers.ts,replays.ts,fs.ts,core/pagination.ts,client.ts), the version upstream pins. The wire format may differ from what is written here; a first run against a real account is the check. tests/E2E.Kernel.Testsportspackages/kernel/tests/unit/kernel.test.ts:Kernel/KernelTests.csfordescribe('kernel()')andKernel/KernelRecordTests.csfordescribe('record'), 15 of the 16it. The 16th, “keeps the idle timeout backstop for an undefined option from a JavaScript config”, has no C# counterpart: an unsetTimeoutSecondsisnull, and “creates a browser with the run tags and the idle timeout backstop” checks it. Two have the suffixPARTIAL_in the name: “fails without an API key in the run environment and reuses one SDK client per key” (no SDK client to reuse; the test checks that each request carries the key of its run) and “records a Kernel replay of the browser …” (a call has no signal of its own to compare with the step’s). The mocked-SDK harness isFakeKernel, a fakeHttpMessageHandler.RestApi/KernelRestApiTests.cshas six .NET-only tests of the REST requests (base URL, create body fields, a JSON error body, paging), which no upstreamitcovers.
AcpExecutor (the E2E.Acp package, namespace E2E.Acp) ports @e2e-dev/acp (tester-army/e2e#960, 0410fc9): an IStepExecutor that runs agent.act and agent.assert steps on a coding agent that speaks the Agent Client Protocol on stdio. It starts the agent, opens one session per attempt, and serves the built-in action tools and the verdict tool to it as an MCP server on 127.0.0.1. Every action goes through ctx.Actions, so the runner authorizes, counts, and records it, and cached steps replay as the built-in agent’s do.
- Upstream’s
acp({ command, args, ... })isAcpExecutor.Create(command, args, options);claudeCode(options)andcodex(options)areAcpExecutor.ClaudeCode(options)andAcpExecutor.Codex(options)(presets.tsis the internalPresets).AcpAgentOptions(Env,Model,System,Name) andAcpOptions(addsModeandSessionMeta) are records. The step isdonewith acode, as the port’s verdict tool, not upstream’scomplete_stepwitherrorCode. The tools are the port’sAgentTools.CreateGrammarTools, so the agent getsfillandfill_secret, nottypeandtype_secret. - Upstream uses the ACP and MCP TypeScript SDKs. There is no .NET ACP SDK, so
E2E.Acphas an internal JSON-RPC peer over newline-delimited JSON (JsonRpcConnection), an internal ACP session (AcpSession,AgentLaunch), and an internal MCP server overHttpListener(McpToolServer, stateless Streamable HTTP, a random path segment, a request with anOriginheader is refused).StepToolsbuilds the served tools from upstream’stools.ts; its per-step gate runs batched action calls one at a time, so a call queued behinddoneis skipped. These are .NET-only. - Permission requests fail closed: an unknown request is answered
cancelled. A tool of the agent’s own (read from the adapter’s marks and the tool kind, never from the agent’s text) ends the step withPOLICY_DENIED. InternalsVisibleTo E2E.AcponE2Ereachesctx.Host.Scope.RedactorandReplayHandOffReasons, which upstream’s package imports frome2e. .NET-only.- Node is required for the presets. Like upstream, they run the adapter from the install they find in
node_modules, walking up from the working directory (thebinof itspackage.json, with a link resolved at the package folder), nevernpx <name>. Upstream starts it with the running Node (process.execPath); the port runsnodefrom thePATH, since a .NET process has no Node of its own. The adapters are npm packages, so a .NET project needs apackage.jsonwithnpm install -D @agentclientprotocol/claude-agent-acpor@agentclientprotocol/codex-acp. The Codex preset lists your MCP servers withcodex mcp list --json(30 s limit, process tree killed on a timeout or cancel) from the@openai/codexthe adapter depends on, or fromCODEX_PATH. A pnpm-style link in a folder above the package, not at the package, is not resolved. - .NET-only in
Presets.cs:CodexListTimeout(upstream’s inline30_000),ResolveCodexBin(upstream’s inlinecreateRequire(...).resolve),RunAsync(upstream’sexecFileAsyncwithtimeout; it also kills the process tree on a timeout or cancel, as the repo rules require), and the localStartAsync(upstream’s.thenchain). The Codex list is shared by every caller, and each caller waits on it with its own cancellation token (upstream has no token). The error for a failed list adds the process’s stderr. - The agent’s environment has no variable named
E2E_SECRET_*orE2E_USER_*, in any casing, from this process or fromEnv; thecodex mcp listcall gets the same environment. Secrets in any other variable reach the agent, as upstream warns. - On Windows, a command for
AcpExecutor.Createmust be an executable, not a.cmdshim: nothing goes through a shell. - The tool names the agent sees differ from upstream:
fillandfill_secretfortypeandtype_secret,doneforcomplete_step, with the port’scodeforerrorCode. - Upstream moved the ACP guide into
subscriptions.mdx(#1488), a page the port has no counterpart for. The guide isdocs-site/src/content/docs/features/acp.mdx. tests/E2E.Acp.Testsportspackages/acp/tests/executor.test.tsintoExecutor/, all 31 of itsits (the secret-strippingitincluded), againsttests/E2E.Acp.Tests.Agent, a scripted fake agent (a console app, so no Node). Four tests arePartial_: the serial-group test (the port’s attempt memory is per attempt, not shared by serial members), the read-only assertion test (the document engine has nohover, so it usesscroll), the tool-list-once test (no step lacks a tool), and the attempt-ends-while-starting test. The runtime-error test isPartial_too: the port’s action budget answers the agent in text, so the error comes from anOnActionhook, and the runner does not count the cancelled turn as a model call.tests/E2E.Acp.Tests/Presets/AgentPresetsTests.csports the threeits ofpresets.test.ts. The adapter in its tests is a Node script that starts the scripted agent, so the tests need Node on thePATH, as the presets do. The tests change the working directory and the environment, so they run in one serial collection (WorkingDirectoryCollection, .NET-only).tests/cli.test.ts(3its) is not ported: it runs thee2eCLI with anacp()executor ine2e.config.ts. The port’s config file is JSON and cannot hold an executor (an executor is code), so the CLI cannot run one.tests/liveis covered bysamples/AcpSample, a real-model test by hand, not by CI.
TestMu mobile
Section titled “TestMu mobile”E2E.TestMu.Mobile drives TestMu AI real and virtual mobile devices through Appium. Upstream has @e2e-dev/testmu (commit 88ed717), a testmu() device provider that leases a device for each worker slot and drives it through an agent-device daemon (daemon.ts, driver.ts, heartbeat.ts, sessions.ts). The port does not port it. It talks to TestMu’s hub with Appium instead, so every type here is .NET-only. The package depends on E2E.Mobile and holds an IDeviceClient over a W3C WebDriver session on TestMu’s hub (https://mobile-hub.lambdatest.com/wd/hub), with the flat LT:Options capabilities TestMu documents. It is a preview: no provider leases a device yet, and the page source is not converted to a snapshot yet, so capture.snapshot fails with NOT_IMPLEMENTED (UNSUPPORTED_CAPABILITY in a test). What it does:
E2E.Mobilegets one new public interface,IDeviceClientSource, which has no upstream counterpart. AMobileOptions.Providerthat implements it makes theIDeviceClientfor each session, in place of the agent-device client. A worker in another process builds its engine from the same options, so its provider object makes the client there. What the client needs to find the leased device travels inDeviceLease.Client, which reaches the worker asDeviceConnection.Client. Any other provider is unchanged.- Supported: launch and terminate an app, deep links, tap, double tap, long press, fill, type, swipe, pan, drag, scroll, screenshot, home, back, native alerts, the keyboard (Enter and dismiss), orientation (portrait and landscape), and the clipboard. A
reffinds the node’s rect in the newest snapshot, and a tap lands on its centre. A ref of an older snapshot is stale (NODE_STALE). - Refused as
UNSUPPORTED_OPERATION, which a test sees asUNSUPPORTED_CAPABILITY: permissions, appearance, biometrics, location, wifi and airplane mode, clearing app state, the keychain, hover, folding, the foreground app, installing a build from a test, and launch arguments except on an iOS relaunch. The provider will install the app when it leases the device. sessions.closedoes nothing. The engine closes at the end of every attempt, and the next attempt drives the same device, so only the provider’s release will end the session.filltaps the field and writes to the focused element, because a snapshot ref is not an Appium element id.backon iOS taps the first button in the navigation bar, as agent-device does, and fails when the screen has none; Android uses the system back.settleoptions are ignored: the engine settles on observe.normalizeStatusBaris sent on for the masked screenshot an observation takes, but the Appium client ignores it (Appium cannot normalize the status bar), so a screenshot shows the device’s real status bar.- The package is in CI’s pack step but not in the release workflow until the provider lands. Not verified against a live account: every wire detail was read from TestMu’s and Appium’s documentation, and the
mobile:script names and arguments were not sent to a real hub. The unit tests use a fake hub. Among them: whether the hub accepts theLT:Options-only capabilities without a top-levelplatformName, the session id field, and whichmobile:commands it forwards.
What still differs from upstream’s @e2e-dev/testmu
Section titled “What still differs from upstream’s @e2e-dev/testmu”E2E.TestMu.Mobile serves the same TestMu AI devices another way, so it is a client, not a port. Compared with upstream’s device provider (provider.ts, daemon.ts, driver.ts, heartbeat.ts, sessions.ts):
- No
IDeviceProviderleases a device: upstream’stestmu(options)(device,osVersion,app,deviceType,project,build,sessionName,orientation,geoLocation,timezone,language,locale,appiumVersion) has no counterpart. Nothing uploads the build fromapp, names the dashboard session (e2e-<run id>-<target>-<slot>, with the project and the build), or releases the session at the end of a run. The package opens its session from aTestMuSessionRequesta caller builds. - No
RecordAsync: upstream’srecordfinds the lease’s session on the dashboard (findSession) and returns its video URL (sessionVideoUrl) as avideo/mp4link, with the session’s start time. The seam is ported (see Provider recording), and nothing on TestMu’s side feeds it. The client refusesrecording.record, so a TestMu device has no video. - No agent-device daemon or plugin: upstream starts one daemon per slot with
@agent-device/testmu, checks its version (assertDriverVersion), keeps the lease alive with a heartbeat (LEASE_TTL_MS), and allocates withretainOnClose. The port has no heartbeat. - Upstream commit
64432f1(tester-army/e2e#1307) makes a TestMu AI device release fail the run when agent-device cannot confirm it ended the session (testmu-strict-release), through the shared lease helper. The port has no TestMu AI provider to release, so the change has no counterpart. The helper itself is ported: see BrowserStack. - The page source is not converted to a snapshot, so a test cannot observe the screen (
capture.snapshotisNOT_IMPLEMENTED). - Credentials: upstream reads
LT_USERNAMEandLT_ACCESS_KEYfrom the run’s environment (testmuCredentials); this package takes the hub credentials from its request.
MAUI DevFlow (not in upstream)
Section titled “MAUI DevFlow (not in upstream)”E2E.Mobile.DevFlow drives a .NET MAUI app through the MAUI DevFlow agent, the HTTP server Microsoft.Maui.DevFlow.Agent runs inside the app in Debug builds (builder.AddMauiDevFlowAgent()). Upstream has no counterpart, so every type here is .NET-only. The package depends on E2E.Mobile and holds an IDeviceClient over the agent’s /api/v1 API plus the provider, DevFlowAgents, an IDeviceProvider and IDeviceClientSource to pass as MobileOptions.Provider. It is a preview: it attaches to an app that is already running, and the device-side verbs are not there yet. What it does:
DevFlowAgents.AcquireAsyncfinds the agent (DevFlowAgentsOptions.Port, else the one agent of the platform andAppNamea running DevFlow broker lists at port 19223, else port 9223), waitsConnectTimeout(60 s) for its status, checks the platform (status.device.platform, where the agent writes it) and the app’s package id against the target, and claims the agent’s mutation lease as holdere2e, so the DevFlow Inspector and the MCP server see who drives the app. The agent answers a claim with 200 and says who holds the lease; one another host holds fails the run naming the holder. The lease travels to the worker inDeviceLease.Client(host,port,leaseId,label). Release gives the lease back and leaves the app running. A worker without a binding finds the agent on its first call, with the platformdevices.bootnames, and claims a lease of its own there. The broker is never started from here. One agent is one running app, so a target with more than one worker slot isINVALID_CONFIG.- The agent lets a lease lapse ten seconds after the holder was last heard from, and refuses a mutation under a lapsed lease with 409
reason: lease. So, as Microsoft’s ownAgentClientdoes, every request that changes the app claims the lease again first (a claim the holder has is a heartbeat). A 409leaseon an action names the holder from the agent’sdetails, or says the lease lapsed when there is none. capture.snapshotreadsGET /ui/tree?envelope=trueand flattens it into the snapshot the engine projects. The agent answers 409capture-changed-during-readwhen the screen moves during the read, as it does while an animation runs, so the tree read and the hit-test are tried up to four times with a short wait before they fail. MAUI types become agent-device kinds (Entryistext-field,Labelisstatic-text,Switchisswitch); a type without a mapping keeps its name in kebab case (vertical-stack-layout), and the agent’s ownlink,heading, andlistitemroles win over the type. TheAutomationIdis the identifierGetByTestIdreads. A field’s text is its value; a password field reportspassword: trueand no value, because the agent writes[REDACTED]in place of the text and never sends the plaintext. A switch, check box, or radio button reportschecked.displayedandopacitygivevisibleToUser. The viewport is the window’s bounds.interactiveOnlykeeps the interactive, labelled, and identified elements and re-parents their children.- Actions carry the element id and the
captureEpochof the tree the ref came from: tap (a tap at a bare point hit-tests the point first,GET /ui/hit-test, since the agent’s tap takes an element), double tap (gesture doubletap), long press (gesture longpress, 1 s by default), fill, clear (a fill with empty text), type (the agent’skeywithtexton the field that has the focus, read off a fresh tree, andkey: "text", a name that is no key, so a typeddeleteorenteris appended rather than pressed), Enter (keyon the focused field), a screen scroll (gesture swipeon the page the other way, half the viewport by default), a node swipe and scroll, a pan, back (POST /ui/actions/back, which pops the navigation, a modal, or a Shell route), the app’s theme (PUT /device/app/themefordevice.setAppearance), the foreground app (the agent’s status), and screenshots (GET /ui/screenshot?scale=native, with the logical size from the window’s bounds). apps.openchecks that the agent runs the app the target names and answers its identity. A relaunch, launch arguments, deep links, install, close, home, alerts, orientation, folding, the clipboard, the keyboard dismiss, hover, a drag between nodes, a long press or pan at a bare point, and every device setting but the theme are refused asUNSUPPORTED_OPERATION, which a test sees asUNSUPPORTED_CAPABILITY.sessions.closedoes nothing.settleoptions are ignored: the engine settles on observe.normalizeStatusBaris ignored.- Errors: a 409 (a stale capture, a changed tree), an element the agent does not find, or a ref the newest tree does not have is
COMMAND_FAILEDwithreason: ref_not_found, a retryableNODE_STALE; a 501, a 404 that names no element, and thenot_supportedandunsupported-capabilitycodes areUNSUPPORTED_OPERATION; a mutation lease another host holds names the holder; an agent that does not answer isSESSION_NOT_FOUND(INVALID_STATE), with the hint that the app may not be running. The agent answers{ success: false, error, reason }rather than the RFC 7807 body its spec shows, so both shapes are read. E2E_DEVFLOW_TRACE=1prints each call to the agent (method, URL, status) to stderr, since loopback calls skip a system proxy such as Proxyman. Bodies are not printed: they hold typed text.- The sample (
samples/MobileApp) registers the agent under#if DEBUGand runs the same tests withE2E_MOBILE_PROVIDER=devflowagainst the app you launched. The two tests that send the app to the background or relaunch it are inconclusive in this mode. - The package is in CI’s pack step but not in the release workflow until the device-side verbs land. Not verified against a running app: every wire detail was read from the agent’s source and spec in
dotnet/maui-labsatmain(the0.1.0-preview.13packages). The unit tests use a fake agent. Among the things to check on a device: the window bounds as the viewport on iOS and Android, whetherroleis set on MAUI elements, the key action withtext, the lease body, and the broker list.
WinApp engine (not in upstream)
Section titled “WinApp engine (not in upstream)”E2E.WinApp drives a Windows desktop app through Windows UI Automation, with the library behind the winapp ui command of the Windows App CLI (Microsoft.Windows.SDK.BuildTools.WinApp.UIAutomation), in the test’s own process. Upstream has no desktop engine, so every type here is .NET-only. The package follows the shape of E2E.Mobile: WinAppEngine is the IEngine (Platform windows, capabilities observation, actions, keyboard, scroll, screenshot, and pinned app; no location, history, video, or tap modifiers), WindowSession the IEngineSession, UiaProjection the projection into the shared node model, WindowActions the action mapping, WindowKeys the key grammar, WinAppErrors the error table, Window the fixture, WinAppTools the agent tools, and WinAppTargetEngine the one that reads a TargetConfig. The library is reached through one seam, IWindowDriver, whose only implementation, UiAutomationDriver, is the only type marked [SupportedOSPlatform("windows")]; the rest of the package builds and is unit-tested on any platform (tests/E2E.WinApp.Tests, with a scripted driver). What it does:
- A
windowstarget takesapp.appPath(the executable to launch, relative to the config folder;E2E_WINAPP_APP_PATHoverrides it) andapp.bundleId(the process name). With a path the engine launches the executable itself (WindowProcess: no shell,ArgumentList, stdout and stderr pumped into the attempt’s app log, a visible top-level window awaited withinLaunchTimeout, the process tree killed on timeout, cancel, or close). With a name alone it attaches to the running app and never ends it.app.open()has no URL to open, so it relaunches the app;restartandclearStaterelaunch too, and nothing is deleted. A URL passed toopenisUNSUPPORTED_CAPABILITY. - An observation inspects the main window and every other visible window of the process (a WinUI flyout, menu, or combo box list opens in a popup window of its own), nests the flat element list the library returns by depth, and projects UI Automation control types onto the browser roles (
Buttonisbutton, aToggleSwitchclass isswitch,Editistextbox, aPasswordBoxclass is a securetextboxwith no value,List/ListItem,ComboBox,Tab/TabItem,Windowiswindowfor the app window anddialogfor aContentDialog, popup, or flyout; an unmapped type is its name in lower case). The test id is theAutomationId. Boxes are logical pixels, relative to the main window, read through the window’s DPI. Refs are the library’s selector slugs, bound for the session in a bounded list, since UI Automation identity is stable across inspections: an element the library no longer finds isNODE_STALE. - Actions prefer the control’s own pattern: tap invokes, selects, toggles, or expands an invokable control and clicks the middle of any other; fill and clear use the value pattern and fall back to focus,
Ctrl+A, and typed text for a control that refuses it (aRichEditBox); press and type focus the control, bring the window forward, and send keys throughSendInput, which reaches the foreground window only (WinUI controls are windowless and drop posted messages); a window that cannot come forward isNOT_ACTIONABLE; select expands a combo box, observes again, and selects the option by name, value, or automation id; check and uncheck use the toggle pattern (a radio button is selected and cannot be unchecked; nothing is sent when the state already matches); a swipe turns the mouse wheel over the node for up and down, and uses its scroll pattern for left and right or when the desktop cannot take input. On the screen it turns the mouse wheel over the largest scrollable control (the pattern steps by a share of the whole extent, too coarse to land a row of a long virtualized list in view; six notches move a screen or so), scrolls that control by pattern when the desktop cannot take input, and turns the wheel over the window when there is none (up and down only: a sideways swipe with nothing to scroll isNOT_ACTIONABLE). A sensitive fill never puts the value in a message. The session also offers hover, long press, drag, a right click, and typed text. - A screenshot is the main window, encoded as PNG by the package’s own
PngEncoder(the CLI tool strips the Skia natives), with every secure field painted black; a secure field without a box withholds the image. Windowis the fixture:OpenAppAsync(the app under test, withRelaunch, or another running app by name),CloseAppAsync,ForegroundAppAsync,ListWindowsAsync,ResizeAsync,MaximizeAsync,RestoreAsync,MinimizeAsync, andAlertAsync, which answers the dialog the newest observation saw: accept presses itsPrimaryButton(else a button named OK, Yes, Confirm, Accept, Save, or Continue), dismiss itsCloseButtonorSecondaryButton(else sends Escape).WinAppTools.Create(engine)gives the agentopen_appandalert, scoped towindows.- Errors: a launch that fails or shows no window is
ENVIRONMENT_UNAVAILABLE; a vanished element is a retryableNODE_STALE; an offscreen control, a refused value, and a lost foreground areNOT_ACTIONABLE; an app the engine cannot find isINVALID_STATE(with the hint to callapp.open()); anything else the library reports isENGINE_FAILURE. A caller’s cancel isCANCELLED. The engine never producesOPERATION_TIMEOUT. e2e exploreande2e mcptake awindowstarget (TargetEngines.Creategets awindowsfactory the way it gets a device one;WindowsTargetsin the CLI builds the engine on Windows and isINVALID_CONFIGon another host). Pattern actions work with the window anywhere; keys, clicks, drags, and the wheel need an unlocked, interactive desktop with the window in the foreground.- Not there:
App.BackAsync(UNSUPPORTED_CAPABILITY: a desktop app has no history), video, tap modifiers, popup windows in screenshots, a deep-link tool, and the clean-up of the app’s data onclearState. A packaged (MSIX) app starts through a broker and exits at once, so it is attached byapp.bundleId, not launched.
WinAppBenchmark
Section titled “WinAppBenchmark”apps/WinAppBenchmark is upstream’s apps/mobile-benchmark rebuilt as a WinUI 3 app with Microsoft.UI.Reactor: 19 of its 25 scenarios, with the same names and the same AutomationId where upstream has a testID. Not ported, because the surface is mobile-only: Permission Prompt, Photo Picker, Stripe PaymentSheet, Apple Pay, Apple Pay Billing Address, and WebView Accessibility. The README of the app lists each change made to fit a desktop window.
apps/WinAppBenchmark.E2ETests ports upstream’s apps/mobile-benchmark suites (smoke, login-form, flows, flows-lists, controls, device, device-fixture, and tests-agent/scenarios), one directory per upstream file and one class per describe. They are real-model tests of the Windows category, so CI builds them and does not run them. Not ported: the tests of the six scenarios the app lacks, the fixtures a desktop window lacks (appearance, clipboard, home, network, location, biometrics, keyboard), describe('refusals') (the Windows engine declares the verbs it checks), the placeholder query, and the pointer-point test (tapAt, a tap position, screen.swipe). The agent scenarios Broken Accessibility, Vision Only, Flattened Registration Form, Flattened Login, and Gestures are declared and skipped with a reason, as upstream declares a gap: agent.act gives the model the tree only, never a screenshot, and it has no long press. The test project README lists each test that differs from its upstream it.
WebBenchmark
Section titled “WebBenchmark”apps/WebBenchmark is upstream’s apps/web-benchmark/app rebuilt as an ASP.NET Core Blazor Web App instead of a copy of the Next.js project: the catalog (ExamplesCatalog, upstream’s examples.ts, with every slug, name, description, and planted bug in upstream’s order), the home page at / (every scenario as a link whose data-testid is its name), and one page per scenario at /e/<slug> (a static header with the back link and the name, then the scenario as an interactive component that connects before it shows, as a client-rendered React one only shows once it runs). The DOM each scenario exposes is upstream’s: its data-testids, texts, roles, and inline styles. The app runs with dotnet run --project apps/WebBenchmark on port 4280, upstream’s port. It is being ported in pieces (#1149): only Login Form is a page so far; the other catalog entries are listed on the home page and answer 404 until their component lands. control-inventory is still served as a static copy by tests/E2E.NUnit.Tests (its tests are ported there); it moves into the app with its own piece. Upstream has no tests/ file for file-round-trip and new-tab-flow.
apps/WebBenchmark.E2ETests ports upstream’s apps/web-benchmark/tests suites, one directory per upstream file. It hosts the app in process on a free loopback port (BenchmarkTest), where upstream’s e2e.config.ts starts pnpm run start through app.command, because the NUnit adapter does not start app.command. The tests are locator-only and run in the normal CI test run. So far: Smoke (smoke.e2e.ts, whole). Not ported yet: the other tests/*.e2e.ts files with support.ts and canvas.ts, and tests-agent/ (login-form, planted-bugs, scenarios, unique-cache).
WinAppTest (not in upstream)
Section titled “WinAppTest (not in upstream)”E2E.WinApp.NUnit and E2E.WinApp.XUnit.V3 add WinAppTest, a base class over E2ETest for a windows target, the way MobileAppTest serves a device target. It reads AppId (app.bundleId) and AppPath (E2E_WINAPP_APP_PATH, else app.appPath) from the target, builds a WinAppEngine from CreateWinAppOptions(), hands the agent WinAppTools, sets the step timeout to 90 seconds, and relaunches the app before each test (WinAppHost.OpenAsync, shared by both adapters from src/Shared). Window is the session’s fixture. The base class adds no [Category].
TestMu
Section titled “TestMu”TestMuBrowsers (the E2E.TestMu package, namespace E2E.TestMu) is the port of upstream’s testmuBrowsers() (packages/testmu/src/browsers.ts, with dashboard.ts and web.ts, commit 92f8cb0), ported in part. It is a WebEngineOptions.Browser provider for the TestMu AI (formerly LambdaTest) web grid. Upstream’s mobile device provider is a separate part of the same package (see TestMu mobile). Taken from upstream: the Edge --user-data-dir=remote-debug-profile-edge entry in browserOptions (appended to the given ones, kept if a --user-data-dir= is already there), the idleTimeout default of 600 seconds, the project default of e2e, the session name e2e-<run id>-<target>-<slot> (a per-attempt lease is e2e-<run id>-<target>-attempt-<attempt id>), the Windows 11 default for Platform, the credentials read trimmed with a blank value counted as unset (the error names each missing variable), and the validation of Capabilities at construction (INVALID_CONFIG for a nested LT:Options, browserName, user, accessKey, name, a browserOptions that is not an array of strings, and a number JSON cannot encode). Not taken: the /puppeteer CDP URL (the port keeps the Playwright-protocol endpoint, below), the browserName check (the port also lets pw-chromium through), and the unknown-key check (a record has no unknown keys). The port keeps the seam’s names (IBrowserProvider, BrowserLease) and adds only the provider, TestMuBrowsers, and its options record, TestMuBrowsersOptions. Only the web grid is covered; TestMu’s real devices are not. Differences from a provider like upstream’s kernel:
- It calls no TestMu API.
AcquireAsyncbuildswss://cdp.lambdatest.com/playwright?capabilities=<JSON>frombrowserName,browserVersion, andLT:Options(platform,build,name,user,accessKey, and the options that were set). The grid starts the session when the engine connects. The lease’sProtocolisPlaywright: the grid answers Playwright’s own protocol on this URL, not CDP, so the engine dials withChromium.ConnectAsyncand opens its own browser context, because the browser has none.ReleaseAsynccalls nothing, because the grid ends a session when its connection closes (checked against a real account).SweepAsyncis the interface default. - The TestMu dashboard shows these sessions without a Passed or Failed mark. TestMu marks a session through its Automation API or a
lambdatest_actioncall, which needs the test result, and e2e passes no test result to a provider (upstream’sBrowserReleaseContexthas none either). The provider also does not look up the session id. - The credentials are
LT_USERNAMEandLT_ACCESS_KEY, or the aliasesTESTMU_USERNAMEandTESTMU_ACCESS_KEY, read from the run’s environment. The access key is part of the endpoint, so the lease id is the session name (e2e-<run id>-<target>-<slot>ore2e-<run id>-<target>-attempt-<attempt id>), which is what progress lines print. The engine puts no endpoint in an error or a log line, and Playwright drops the query string from the URL it prints when aws://orwss://connection fails, so a refused connection does not show the key (a test checks it). Each lease endpoint is about 650 bytes, and a worker’s leases travel in one environment variable capped at 16384 bytes, so a target with more than about 20 worker slots fails at prepare. - Checked against a real account:
ConnectOverCDPon this URL fails withProtocol error (Browser.getVersion),Chromium.ConnectAsyncworks, and closing the connection ends the session.TestMuLiveTestsrepeats that through the engine and reads the session’s end from TestMu’s Automation API. It is skipped withoutLT_USERNAMEandLT_ACCESS_KEY. Mobile devices are not covered. - Behavior change: a
Capabilitiesentry namedname,user, oraccessKeyused to replace the provider’s value. It is now refused withINVALID_CONFIG, as upstream does. TestMuBrowsersFunctionTests(Browsers/) ports theits of upstream’sbrowsers.test.tsfor the Edge flag and the validation. Two are partial (Partial_prefix): the Edgeitthat also checks upstream’s build (run-1; the port’s ise2e-<run id>) andbrowserVersioninsidecapabilities, and the rejectionit.each, of which the rows foruser/accessKey,name, nestedLT:Options,browserName,browserOptions(a string,[1], null) and a value JSON cannot encode are covered. TheprojectandidleTimeoutdefaults are checked in the .NET-onlyTestMuBrowsersTests, because the upstreamitthat checks them also checks the/puppeteerURL and theWindows 11default together withbuild: run-1(the port’s build ise2e-<run id>). Theits for the session name and for a missing or blank credential are ported. Not ported: the/puppeteerURL (the port’s endpoint differs), the lease id without spaces,undefinedvalues keeping the defaults (C# has noundefined), the unknown-key,browserName, non-objectcapabilities, Date, Map, function, BigInt and cycle rows (a typed record andJsonNodecannot hold them), the log line (the port logs nothing), the credentials taken fromprocess.env(a test would change the process environment, which the live test reads). The otherTestMuBrowsersTestsandTestMuLiveTestsare .NET-only, intests/E2E.TestMu.Tests.
Browser install command
Section titled “Browser install command”Upstream’s e2e-web command (packages/web/src/cli.ts) has one subcommand, install. It runs the pinned Playwright CLI. The port has it as e2e install [chromium|firefox|webkit ...] [--with-deps], in the tool that already ships the Playwright driver. It installs Chromium when no browser is named, forwards the options before the browsers, exits with the Playwright code, prints usage for -h or --help anywhere, and exits 2 for an unknown option or browser. As upstream, the install runs with PLAYWRIGHT_SKIP_BROWSER_GC=1 unless the user set it. The engine launches the browser WebEngineOptions.BrowserName names (Chromium, Firefox, or WebKit; Chromium by default). Upstream’s browser option is a name or a provider; C# has no such union, so the port keeps the provider in Browser and the name in BrowserName. Connect and a provider attach over CDP, so Connect with another browser is INVALID_CONFIG.
Upstream’s command lives in the web package (e2e-web, from @e2e-dev/web), apart from the e2e command. The port is one tool, and WebEngine is in the E2E package, so the command is e2e install in E2E.Cli, the one place the Playwright driver ships. The code follows upstream’s split: E2eWebCli.MainAsync is main and CliIo is its CliIo (E2eWebCli is named for the command; a method called Main would be taken for an entry point), WebEngine.RunPlaywrightCli is runPlaywrightCli, and BrowserConnection.BrowserNames and IsBrowserName are BROWSER_NAMES and isBrowserName.
Not ported:
- A command named
e2e-web, andnpx,bunx, andpnpm execusage lines.dotnet e2e installis the local tool form. - Upstream’s exit code 2 for a missing or unknown command.
e2eexits 1 for both, as it does for every command. - Forwarding SIGINT and SIGTERM to the installer and the 128-plus-signal exit code.
Microsoft.Playwright.Program.Mainruns in this process. Ctrl+C in a terminal reaches its driver in the same process group; a SIGTERM sent toe2ealone does not. install.test.ts(ensureBrowsersInstalled) is the first-launch install of the engine, not the command. The port covers it inE2E.Tests/Install, and upstream’s own checks of the installed-browser cache and of the run’s environment have no counterpart: the port leaves that to Playwright’s install (see Web engine).
MCP server
Section titled “MCP server”Ported from upstream packages/e2e/src/mcp at commit ee901b333ed12352418dfb07bda5eafe32e71c8d (docs(agents): show several personas running one suite (#1258)), apart from what is listed below. e2e mcp serves over stdio with the server name e2e, the tools, resources, and logging capabilities, and upstream’s four fixed tools with their names, descriptions, and closed argument schemas. Stdout carries only the protocol; every other write goes to stderr, and the MCP SDK logs nothing. The flags are --config, --target, --headed, a hidden --headless, and --max-sessions (1 through 16, default 4). A session is headless by default; open_session takes headed to show the browser or hide it, and --headed makes headed the default for a session that does not say (upstream commit dc2afca). A bad command line exits with 2, a disconnect or a signal with 0, and an unexpected error with 1. The resources e2e://guide and e2e://guide/<topic> serve the bundled skill; an unknown topic fails with UNKNOWN_TOPIC.
A session is an attempt on the config’s target with an engine of its own: a Chromium WebEngine for a web target, or a MobileEngine for an ios or android target (see Device sessions below), or a WinAppEngine for a windows target (see WinApp engine), so parallel agents each drive their own browser, device, or app (a windows target with only app.bundleId attaches to one running app, which they share). open_session loads e2e.config.json fresh, claims the config (CONFIG_IN_USE for another config while a session is open), and fails UNKNOWN_TARGET for a target the config does not declare, CONFIG_NOT_FOUND for no config (an explicit config that does not exist names the resolved path and the working directory a relative path resolved against, as upstream #1478; E2EConfig.ExplicitConfigNotFound is upstream’s explicitConfigNotFound, shared with e2e explore --config), SESSION_OPEN when no slot is free. call and tools name a session, or fail NO_SESSION or SESSION_REQUIRED. A session ends on close_session, after 30 minutes without a call, or after 4 hours. It never reads or writes the replay cache. Every configured secret is a secret of the session: any output, error, log line, and the close summary shows its value by name (<secret:name>). type_secret fills a secret into an editable field (a password secret needs a password field), and screenshot keeps attaching the masked PNG after a fill (upstream #1437): it masks secure fields only, so a value the app shows elsewhere is in the image.
The catalog is what the testing agent’s tools do, so a coding agent acts as the model of an act does: observe, tap, double_tap, long_press, right_click, hover, type, press, select, check, uncheck, clear, drag, scroll_to, scroll, navigate, back, screenshot, type_secret, and locate. scroll_to and scroll need EngineCapabilities.Scroll, back needs History, screenshot needs Screenshot, and type_secret needs a credentials entry or a secrets entry (tester-army/e2e#704, 3dc4ec9, read at 7b1b8b2: Session.cs passes E2EConfig.AllSecrets, as upstream’s secretParams does). The opening text adds a Credentials: line before the Secrets: line, with each credential’s name, username, and password secret (<name>.password); the password value is never printed. A test line spells a typed credential username as Credentials.User(name).Username and a type_secret of <name>.password as Credentials.User(name).Password (TestLineFills, upstream’s TestLineFills). navigate allows http and https only (POLICY_DENIED for any other scheme).
Differences:
- Node ids and diff results (tester-army/e2e#231,
b9f032b, addedScreenPresenter; the session has shared it since #181,afde198):observelists#id role "name" ...lines underCurrent screen (revision b3, path /, 12 nodes):, and an action answers with its lead, the test line, and what changed since the screen the agent last received (Screen changes since revision b3 (now revision b4, 12 nodes): 1 added, 1 changed., thenadded,changed … (was: …),removedlines), as upstream’sScreenPresenter(agent/screen-update.ts) does.ScreenPresenterisAgent/ScreenUpdate.cs: the first screen whole, a later one as the difference keyed by node id, focus left out of the comparison, the whole screen again past 60 changed lines or half of it, no removals against a truncated listing, and the note when an action closed the on-screen keyboard. An unchanged screen readsScreen unchanged since revision …, orNo listed node changed within the wait after this action …after an action that should have changed it (expectChangeis false forscroll,scroll_to,type_secret, and apressthat only moves focus, as upstream). A failed action reports the changes after itstap n9 failed: LOCATOR_NOT_FOUND: node n9 is not on the current screen; re-observe for the newest idslead. The built-in agent uses it too (#1022):DefaultAgent.PresenterFormakes one presenter per step, shared by the opening prompt (Open) and the tools (Present), with the pixel half (Attach,PixelEvidence, the screenshot the model holds). Transcript compaction and the overflow shrink find a whole screen byCurrent screen (revision, as upstream’sFULL_SCREEN_PATTERN. Differences: the session has no screenshots onactof its own, so its presenter has no pixel half (the “No screenshot can be taken” text, the unchanged-screen cases that compare images); the lines areFailureEvidence.Listing’s (SnapshotText.FormatNode: states each in its own bracket, a secure field assecure), and the listing is cut at the default observation limit (262144 bytes), where upstream cuts at the agent’smaxObservationBytes. A custom executor’sExecutorObservation.Textis the same lines (see Custom executors (#1022) below). Node ids are the engine’s refs (SemanticNode.Ref), unchanged. Custom executors (#1022):ExecutorObservation.Text, which an executor reads fromObserveAsyncandStart, is the#id role "name" ...listing, one node per line, cut at the observation byte budget (see Agents), as upstream’stext;ExecutorTargettakes the id with or without the#. A custom executor that parsed the earlierScreen (route):text with[ref=…]lines breaks and reads the id after#now. The listing has noScreen (heading: the route isExecutorObservation.Path. The presenter (theCurrent screenand diff results) stays the built-in agent’s and the session’s, as upstream’sscreen-update.tsdoes; a custom executor gets no diff results. .NET-only: the judgment path (assert,waitFor,extract) prints aScreen (route):line before the same listing, where upstream wraps its text in<observation revision=… viewport=…>;OverflowShrink.FullScreenPatternstill matches that line. - The grammar is the port’s:
typeandtype_secrettaketextandsecret;uncheckandclearare tools of their own. Upstream’s point tools (tap_at,hover_at,drag_at,type_at,press_at,select_at) are served as upstream’s grammar offers them, fromAgentTools.CreateGrammarTools: the session’sscreenshotnotes the shot and the viewport on the session’sScreenPresenter(Attach), which the point tools read their points against (before a screenshot they answer with the line that says to take one). On an engine with a keyboardtypetakes an optional target andreplace, and atypewith no target has no test line (the value went to the focused field).long_press,right_click,hover, anddragare, and a coding agent over MCP gets each one only where the engine declares its action kind (longPress,secondaryTap,hover,dragTo), asactdoes.dismiss_keyboardis a tool only where the engine can hide its keyboard (IEngineSession.CanDismissKeyboard: the mobile engine). locatewrites theScreencall a test uses (Screen.GetByRole("button", "Save")) and upstream’s codesLOCATOR_NOT_FOUNDandLOCATOR_AMBIGUOUS.- As upstream, a
locatewith astatus,alert, orlistitemname that matches nothing points atScreen.GetByRole(role).Filter(text)andScreen.GetByText(spelled asGetByRole(role).filter({ hasText })upstream), and anexact: falsequery is not told to loosen the match again (upstream #1147,5e9597c): the advice says “an” before a role that starts with a vowel (an alert,a status), and for anexact: falsequery it keeps the option in the text call,Screen.GetByText("Saved.", exact: false)(getByText(q, { exact: false })upstream). The web engine names those three roles from their content, so there the name also matches; the advice still holds, since the text matches either way. - Test lines (upstream #1317,
9ceb071): every action answers with theScreenorAppcall that repeats it, after the first line of its result, and the read-onlytest_linestool returns them as a draft test body. The code is C# (await Screen.GetByRole("button", "Save").TapAsync();,Secrets.Get(name),Filter(text),Nth(i),new RoleOptions { Visible = true },App.OpenAsync(path)), andSessionTestLines(Mcp/TestLines.cs) is upstream’sSessionTestLines(mcp/test-lines.ts). Differences: the port’s tree carries a node’s test id, soGetByTestIdis the last query tried for a node, where upstream reads the id off the live node; the port resolves each locator through the engine’sLocateAsync(2 s each, binding only the matches, so a device keeps the agent’s node ids valid) when the engine has one, else on one fresh look at the screen per node withLocatorResolver, where upstream spends one engine resolve on each (the cap of 10 tries stays); the live look comes in the port’s resolver order, so the twin of a shadow root is told apart by its place in that order and never by the box it kept; there are no credentials, so a fill namesSecrets.Get(name)only; atypethat fell back to the keyboard does not exist, because the port’stypealways fills; a locator tap takes nomodifiers, so atapordouble_tapwithmodifiersprintsNo test line:; apresshas notimes. The web engine names a list item from its content, so a row is found by that name (GetByRole("listitem", "Offer B Reserve")) before it is found byFilter(text). The draft ends with a line that tells the agent to add anExpectafter each step, where upstream also names thecredentialsandsecretsimports. The session catalog reads the newest observation from the agent’s observation feed, where upstream wraps the step context. Not ported with it: the reserved tool name (the port has no project tools), the telemetry event of an MCP session. The drafted lines run as a test class of a project built in a temporary directory withdotnet test(DraftedTestRun), where upstream runs them with itsrunProject. - The fixed tools check their arguments with a strict check of the JSON Schema subset tool schemas use, since the .NET MCP SDK does not validate them. The messages are zod’s, so an unknown argument reads
Invalid arguments for tool <name>: Unrecognized key: "<key>", as upstream. run_code(upstream #1316,6b41857) is not ported. It parses and runs TypeScript test statements (mcp/code-parse.ts,code-surface.ts,run-code.ts) with a surface that matches the test API. C# cannot be evaluated without a compiler or scripting host, so the tool, itsLEFT_OUTreasons, and themcp-code-parsetests have no counterpart. The agent writes theTest line:an action printed into the test and runs it withdotnet test.run_tests(upstream #1520) is not ported. Upstream’s fifth fixed tool runse2e runin its own process and returns the command, the exit code and its meaning, and what the run printed; it takesfiles(files, directories, globs, orfile:line; without it, every test the config discovers) and thee2e runflags (config,target,grep,grepInvert,tag,excludeTag,lastFailed,changedSince,headed,workers,retries,repeatEach,maxFailures,actionTimeout,noCache,updateSnapshots), and failsRUNNER_BUSYwhile a run is in progress (mcp/run-tests.ts,mcp/test-outcome.ts,mcp/output.ts, and the “Run tests next to a session” section ofdocs/mcp-server.mdx). The port has noe2e run: a suite is run bydotnet test, which the agent runs in its own shell, and adotnet testwrapper would be a tool upstream does not have (documented, not built). The upstream tests #1520 added or changed have no counterpart.tests/integration/mcp-run-tests.test.ts,describe('e2e mcp run_tests'): “lists run_tests beside the session tools”, “runs one file as e2e run does, with progress per line”, “runs one test by file:line”, “runs the whole suite and reports a failure as the run result, with the secret redacted”, “keeps the end of an output too long for one result, and bounds each progress line”, “returns a selection that matches nothing as an error result”, “refuses a file that reads as a flag, an empty target list, and raw flags”, “runs beside an open session and leaves it open”.tests/unit/mcp-run-tests.test.ts,describe('runArguments'): “runs every test with no arguments”, “puts each value in its option word and the files after –”, “takes the server’s config, target, and headed unless the call names its own”.tests/integration/mcp-server.test.ts: “serves five fixed tools and the guide resources” (the port serves four).tests/unit/cli-signals.test.ts, which cover the run’s interrupt: “climbs the whole ladder on its own once the parent closes its IPC channel”, “climbs at once when the parent was gone before it armed”.- Running a test in a session (upstream #1315,
3d2c362), ported in part.open_sessiontakestest, the full name of one NUnit test (Namespace.Class.Method; upstream namesfile:line), and the config takestestAssembly(.NET-only: upstream collects tests from itstestsglobs), the built test assembly. The tool runs the test in its own process and stops on the screen where it passed or failed; the opening text leads withTest "<name>" ended without failing after <time>; N steps ran.orfailed after ...(timed outforTEST_TIMEOUT), and for a failure the error code and message,At <file>:<line>:<column>(the line the failure unwound through, else the failing step’s) with the code frame around it (CodeFrame,E2E.Cli, upstream’scodeFrame),URL at failure:, the nodes nearest a failed locator, and the last 15 steps (TestOutcome.Describe,Mcp/TestOutcome.cs, upstream’sdescribeTestOutcomeinmcp/test-outcome.ts). The session’s test lines continue the test (TestLineOptions.TestRan, upstream’stestRan):test_linesreadsTest lines from this session's actions after test <name> stopped. A name that selects several tests failsTEST_AMBIGUOUSand a test with[E2ESession]failsSESSION_TEST_UNSUPPORTED, both before anything boots (SessionTests.SelectOne, overISessionTestRunner.Select, upstream’sselectStandaloneTest). The tool names no test framework:SessionTests.Load(Mcp/SessionTests.cs) loads the assembly and finds anISessionTestRunner(Run/SessionTests.cs, .NET-only seam) in theE2E.*package it references;NUnitSessionTestRunner(E2E.NUnit) runs the test with NUnitLite by its full name.E2ETestoffers its session toSessionHandoverat teardown, so the host owns it and completes and disposes it atclose_session. The replay cache works as configured for the test, and settles at close with the test’s failure. Differences:afterEachhooks and fixture teardown run before the hand-over, not atclose_session: the outcome has no phase or secondary errors (Also failed), the time includes set-up and tear-down, and the text does not saypassedorskipped itself(a pass, a skip, and an inconclusive test readended without failing); the messages name tests by full name, notfile:line, andTEST_AMBIGUOUShas no target;SESSION_TEST_UNSUPPORTEDcovers a saved session only (the port has no serial groups or several agents), and the setup test itself runs; the assembly loads once per server, so a rebuilt test needs a restart; a[Retry]/[Repeat]test hands over the session of its first attempt;targetandheadedare refused withtest(INVALID_ARGUMENT); a test that skips or is inconclusive readsended without failing; the fixture reads its own config (the neareste2e.config.json), not the session’sconfig. Not ported yet: xUnit v3 andfile:line.CodeFramedraws a wide glyph as one column (Format.VisibleWidth), where upstream counts two. Tests:McpTestRun/OpenSessionTestOverE2eMcpTestsinE2E.NUnit.Tests(fouritofdescribe('over e2e mcp'), allPartial_, plus one .NET-only; the rest ofmcp-test-run.test.tswaits on hardkoded/e2e-dotnet#1409, #1410, #1411, #1412, andtest.failis not ported),McpTestLines/SessionTestLinesTests(the continuationit),CodeFrameWidth/CodeFrameTerminalColumnsTests(the threeitofcode-frame-width.test.ts,Partial_: the terminal width is passed in, and the CJK and emoji caret rows are left out), and inE2E.Cli.Tests(.NET-only)McpSessionTest/SessionTestsTestsandMcpTestOutcome/TestOutcomeTests. - The server instructions name
e2e.config.json,E2ETestclasses, anddotnet testin place ofe2e.config.ts,tests/*.e2e.ts, andnpx e2e run. - Writing a test while walking the flow (upstream #1312,
9d884f5): the server instructions, thee2e mcphelp text, the skill (mcptopic and workflow steps 2 and 3), and the coding-agents guide tell the agent to create the test file beforeopen_sessionand add each step as it takes it: anAgent.ActAsyncgoal before it walks the goal’s path, or theTest line:an action printed, then, once the outcome shows, anExpect.Thaton alocated locator or anAgent.AssertAsync. An action with no repeatable line answersNo test line:and the reason, andtest_linesreturns the draft so far with a//comment for it. The port differs in one way: the workflow names the class per target (E2ETestfor web,MobileAppTestfor iOS and Android,WinAppTestfor Windows) and how each opens its screen (App.OpenAsync(path),Device.OpenLinkAsyncor the launch screen, the relaunchWinAppTestdoes before each test when the target namesapp.appPath, else attaching where the walk left off). That per-target split is .NET-only. The coding-agents guide has no “How an agent writes and runs a test” section or separate MCP server and reference pages, so only its “Let the agent use the app” paragraph changes. - The guide has upstream’s eight topics, written for .NET, plus
writing-tests-nunitandwriting-tests-xunit, one per test framework.exploredescribesExplore.ExploreAsync, andexploreandbug-bashdescribe the bug bash as the port runs it. - The 2026-07-28 MCP revision deprecates logging. The server still declares it and sends its log lines, as upstream does.
- A session’s engine is its own, so sessions never share an engine instance, and
ENGINE_IN_USEhappens only for a device (see Device sessions below). The credential registry upstream installs for a run (setSecretRegistry,holdSecretRegistry) isSecretRegistry.Holdhere: a session holdsE2EConfig.Credentialsfrom its start to its disposal (E2ESessionOptions.Credentials, internal;E2EFixtureandE2EHostpass the config’s), and the newest registry held answersCredentials.User. Upstream’sliveoption is not ported. - The
e2etool ships the Playwright driver of every platform (about 215 MB) and none of the SkiaSharp native libraries, since it never compares screenshots. Chromium installs on the first session, as for a test. - Device sessions:
open_sessionon aniosorandroidtarget builds aMobileEngineon a local simulator or emulator (see Explore). The catalog leaves outnavigatefor an engine that declaresPinnedApp, as the engine has no URL to open; before the first observation the session launches the pinned app fresh (TargetEngines.LaunchesPinnedApp, thenApp.OpenAsync), as upstream’slaunchesPinnedAppdoes (upstream #1252,3bd32ef). The summary addsApp: <bundleId or appPath>, launched fresh., and theopen_sessiondescription names the pinned app. It installs no build, so a local device target needsapp.bundleId. The launch is bounded by the session’s time limit, as upstream bounds it by the attempt’s timeout, and a cancel of the request during the launch surfaces asCANCELLED. A device runs one app, so a second session on a device target fails withENGINE_IN_USE(upstream’s code for two sessions on one engine instance; the port builds an engine per session, soSessionRegistry.ClaimEngineclaims the device, .NET-only) until the first closes. Hosted devices are not ported yet. Awindowstarget builds aWinAppEnginethe same way (WindowsTargets.Create,E2E.Cli), on Windows only (INVALID_CONFIGelsewhere), and launches the executableapp.appPathnames or attaches to the processapp.bundleIdnames before the first observation. - The screenshot path (tester-army/e2e#1481,
f078364).screenshottakes an optionalpath, a.pnginside the project (SessionCatalog.Screenshot,SaveScreenshotAsyncis upstream’ssaveScreenshotinmcp/catalog.ts). It saves the engine’s masked artifact (IEngineSession.ScreenshotArtifactAsync, upstream’ssession.artifacts.screenshot) to the path and returnsSaved to <absolute path>beside the image. A path outside the project root (through a symlink too), a hidden file, or one under a hidden directory isPOLICY_DENIED, as for the agent’supload.SessionCatalog.CreatetakesprojectRootandattemptDir, upstream’sCatalogOptions.projectRootandattemptDir. The port has nosaveScreenshotoption on a sharedgrammarTools(agent/primitives.ts): its catalog buildsscreenshotitself, so the option lives there. A path that does not end in.pngfails in the tool withINVALID_ARGUMENT(call screenshot: path: a .png file), since the argument check has nopattern. The port has norun_code, so upstream’sLEFT_OUTreason and themcp-code-parsecase have no counterpart. The port writes the file through a temporary name and moves it. Test:McpServer/E2EMcpTests, the saved,.jpg, and refused-path assertions of upstream’sopens a session with its catalog .... open_sessionnames the app (tester-army/e2e#1483,0b84d35). The summary says the config was read with the MCP server’s environment, andAppLines.For(Mcp/AppLines.cs, upstream’sappLinesinmcp/app-lines.ts) printsApp: <href>with(port N, assigned for the declared port 0)for a free-porturl, andProcess: app.command "<executable>" (ready at <url without userinfo or query>; env <names>; inherits <names>; cwd; log), orProcess: nonefor a target with noapp.command.Urls.PrintableUrlis upstream’sprintableUrl. The session resolves the declared app on the port it was started on (TargetApps.ResolveTargetApp) to read the readiness URL and the assigned port, where upstream’s target already holds them.ranTestis not a parameter, since the port has noopen_session {test}.ManagedProcessHooks.StartingandReadytake the readiness URL (upstream’sstartingandreadyhooks). Tests:McpSessionHost/SessionHostTests(names the app command it started and the port it assigned, without args or env values; it runs the test app under the test host, since an apphost may be refused by the machine) andUrls/PrintableUrlTests.start_recordingandstop_recording(tester-army/e2e#612,04a12619).SessionRecorder(Mcp/Recording.cs) is upstream’sSessionRecorderinmcp/recording.ts, withDescribe(FinishedRecording)asdescribeRecordingandTools()asrecordingTools. The catalog lists both tools when the engine declaresEngineCapabilities.Video, and the session records only between them (the attempt’s own video is off). Each recording moves out of the attempt directory into<project root>/.e2e/videos/<session>/<n>[-<name>][-part<n>].<ext>;close_sessionand the idle and time-limit closes save a recording still running and list its files. Differences: the port has nooutputconfig, so the directory is always under.e2ein the project root; upstream’stainted(the session’s pixel taint) is true here oncetype_secretfilled a secret, since the port has no pixel taint, so the secret warning inDescribeappears after atype_secretand not after other secret fills; the name’s pattern is checked by the tool, not by the argument schema; the engine’s calls are bounded bycleanupTimeoutand the call’s cancellation token. .NET-only hardening: a video path that leaves the attempt’s directory fails the stop withENGINE_FAILURE.e2e initalso ignores.e2e/videos/, as upstream. Tests:McpRecording/SessionRecorderTestsismcp-recording.test.ts(the nineit; thetaintedone sets the flag the callback reads);McpServer/E2EMcpTestsports the recordingitofmcp-server.test.tsand its catalog list;McpSessionHost/SessionHostTestsports twoitofmcp-session-host.test.ts(“records only between start_recording and stop_recording, and saves a recording still running at close”, “lists no recording tools when the engine records no video”), withFakeEnginewritingvideo/fake.webmas upstream’s fake engine does.
Not ported:
- The project’s own tools (
defineTool,toModelOutput), custom engines, mobile tools, and per-session telemetry. - Redaction of what user code prints: a config is JSON, so no user code runs in the server.
e2e initregisters the server (see Coding agents); by hand, useclaude mcp add e2e -- e2e mcpor a.mcp.jsonentry.
Agents
Section titled “Agents”E2ESessionOptions describes the default agent with Model, Judge, AgentExecutor, AgentSystem, AgentTools, AgentContext, MaxSteps, MaxModelCalls, JudgmentTimeout, and ProviderOptions, and names the others in Agents (an AgentOptions per name). E2ETest fills both from agents.<name> in e2e.config.json. A call picks an agent with its Agent option; an empty or unknown name throws INVALID_ARGUMENT (unknown agent "x"; configured: default, ..., with ; did you mean "y"? when one configured name is near, as upstream). Each agent starts from the defaults and inherits nothing from another. Settings are checked when the session starts and fail with INVALID_CONFIG.
-
A test or a class picks the agent for its calls with
[Agent("name")](upstream’sagentoption oftestanddescribe). The closest pin wins: a call’sAgent, the method, the class, a nested class’s enclosing class, thenE2E_AGENT(the port’s--agent, one name; a pin wins over it, as upstream). An unknown name fails the test withINVALID_ARGUMENTwhen the session starts, where upstream fails at collection.[AgentContext("...")]is upstream’sagentContext: the layers join outer to inner with newlines and follow the agent’s owncontext, for every agent a call picks, and the cache key sees the joined text. .NET-only symbols:AgentAttribute,AgentContextAttribute,E2EFixture.RunAgent,E2ESessionOptions.AgentandTestAgentContext, andTestAgentOptions(internal). Not ported: a list of agents (agent: ['buyer', 'admin'], one result per agent), because NUnit and xUnit have no collection step to fan a test out; the serial-group and setup-test rules that go with it; and--agentlisting several names.E2EConfig.AgentNamesis upstream’sagentNamesandE2EConfig.Agentis itsagent(the first of them); config resolution takes the selected names asCliOverrides.Agents(internal, upstream’scli.agents) and rejects an unknown one withINVALID_CONFIG(unknown agent "x"; configured: ...; did you mean "y"?). A non-blankE2E_AGENTis read ascli.agents(one name) when code passes none, so an unknownE2E_AGENTfails when the config loads withINVALID_CONFIG, andE2EConfig.Agentis that agent. The fixture still also hands it to the session asE2ESessionOptions.Agent. -
judgejudgesassert,waitFor, andextract, and defaults to the model.actalways uses the model -
systemis appended to the built-in act rules. Judges never see it -
context(at most 16384 UTF-8 bytes) is told to every model call: after the act rules asProject context:, and to judges inside<project-context> -
maxStepsandmaxModelCallsare 1 through 100, 25 by default -
judgmentTimeout(30 s) boundsassert,waitFor, andextractunless the call setsTimeout. A per-call timeout must be positive; awaitForinterval is 100 ms through 60 s -
providerOptionsis a dictionary of JSON objects by provider. It rides everyModelRequest, andOpenAiCompatibleModeladds the fields under itsProviderkey (openaiby default) to the chat-completions body as given, so write the wire names (reasoning_effort, notreasoningEffort). It cannot replacemodel,messages, ortools. Every other client does the same with its own key (anthropic,google,bedrock,azure,xai,openrouter,gateway) and refuses its own core fields. As upstream, requests to OpenAI (and Azure over Responses) carrystore: falseand a prompt cache key per system prompt, and Anthropic requests carry cache breakpoints on the system prompt and the newest message; provider options win over both -
assertandextractmake one model call and one repair round.waitForjudges at once, then again only afterIntervaland on a changed screen, and every call, repairs included, counts againstMaxModelCalls. It endsSTEP_TIMEOUT(waitFor timed out; last judgment: ...) orSTEP_BUDGET_EXHAUSTED(waitFor exhausted its model-call budget; last judgment: ...) -
As upstream, the judge prompt says a value shown in more than one place holds only when every place agrees, unless the statement names the place or is about some item among several. The wording follows upstream, with “instruction” as “statement”. The judge answers with upstream’s
agent-judgment-2object (see below) -
Judgment grammar (
Agent/AgentProtocol.cs, internal; upstream’sagent/protocol.ts).assertandwaitForjudge through structured output, as upstream does: the model answers oneagent-judgment-2object (protocolVersion,explanation, thenverdict:holds,fails, orinconclusive) thatAgentProtocol.ValidateJudgmentResponsechecks.holdspasses,failsisASSERTION_FAILED,inconclusiveisASSERTION_INCONCLUSIVE. The judge has nodonetool, no tool at all. An answer that is not JSON or does not match gets one repair round (a<previous-attempt-rejected>turn with the validation issue), thenMODEL_OUTPUT_INVALID(The judge did not answer with an agent-judgment-2 object: ...).AgentProtocol.JudgmentSchemais upstream’sJUDGMENT_SCHEMA, withexplanationbeforeverdict.ModelRequest.SchemaandSchemaNameare upstream’sModelCall.schemaandschemaName, .NET-only in their place: the port’s models take aModelRequest, not aModelCall. Breaking for a customIAgentModel, which must honorSchema(return the JSON object asModelResponse.Content;Toolsis empty). The providers: chat completions sendresponse_formatjson_schema, Responsestext.format, GooglegenerationConfig.responseMimeTypeandresponseJsonSchema; Anthropic and Bedrock, which have no such field, offer onejsontool and force it (the AI SDK’s own fallback) unless the request thinks, when the tool is only offered.OpenAiCompatibleModelOptions.JsonSchemaResponseFormat(.NET-only, default on) leavesresponse_formatout for a server that rejects it; the judge’s prompt still asks for the object. Chat completions and Responses sendstrict: false, because strict mode refusesmaxLength; the agent checks the answer itself.ModelResponses.JudgmentandModelHttp.StructuredAnswer/JsonToolNameare .NET-only (a scripted judge answer; the forced-tool answer as content). Not ported: upstream’sextractSchemaandvalidateExtractResponse(theagent-extract-2envelope).extractstill answers through itsextractanddonetools, so its inconclusive outlet is thedonetool. -
Closed grammar tool inputs (
AgentTools.SchemaTool, upstream’sschemaToolinagent/primitives.ts). A grammar tool call that carries a field its schema does not declare is refused and never runs; the refusal is the call’s result (failed: Invalid input for tool tap: Type validation failed: Value: {...}.thenError message: [{"code":"unrecognized_keys","keys":[...],...}], the AI SDK’s text over a zod issue), it counts toward the failure streak, and in a batched turn the other calls still run. Differences: only undeclared fields are refused (the tools read their own values, so a wrong type is the tool’s own failure); the schema sent to the model does not carryadditionalProperties: false; project tools (AgentTool) and thedonetool are not closed (upstream’sdefineToolcloses nothing, and its verdict tool drops a code a passed verdict carries instead of refusing it). Tests:AgentPolicy/ToolCallsOutsideTheVocabularyTests. -
ExtractAsync<T>: the type argument is the schema, in place of a Standard Schema. The judge gets the JSON schema ofT(JsonSchemaExporter), and the answer must deserialize intoTwith required members and nullable annotations respected. A failure gets one repair round with the validation error, thenMODEL_OUTPUT_INVALID(extracted data failed schema validation: ...). A judge that says the data is not shown endsASSERTION_INCONCLUSIVE(nothing to extract: ...) -
tools(AgentOptions.Tools,AgentToolson the default agent) are project tools the model is offered beside the agent’s own. As upstream’sdefineTool, anAgentTooldeclaresmutatesandplatforms: a tool is offered only on the platforms it names, and a mutating tool takes an action slot. Its output is redacted and cut at 16384 characters. A name the agent already uses (observe,done,navigate,back,scroll,scroll_to, or a verb) is refused withINVALID_CONFIG. Differences: the tool is anAgentToolbuilt with its schema as aJsonObjectand a delegate, since the port has nodefineTool, AI SDK tool, ortoModelOutput; a tool that wants upstream’sgetToolContexttakes the second constructor, whose delegate gets anAgentToolContext(ObserveAsync,AttachScreenshotAsync), and the first constructor keeps working; and upstream’s reserved names for tools it adds elsewhere (complete_step,locate, the recording tools,report_finding) have no counterpart. Upstream records a mutating tool as a gap in the trace, and so does the port: a recording holds an action of kindtoolwith the tool name, a replay runs the actions before it and then hands the step to the model, and the step is never replayed whole. Older versions of this port cannot read that action and run the step live. As upstream, a recording that stops at such a gap (reasongap) is not stale: a strict cache run replays what it can and runs the rest of the step live. The recording keeps the tool’s name only, never its arguments -
tap,double_tap, andright_clicktake an optionalmodifierslist (Shift,Control,Alt,Meta,ControlOrMeta) on an engine that declaresEngineCapabilities.TapModifiers, as upstream’stap,double_tap, andright_clickdo on an engine that declarestapModifiers. The web engine declares it. The device engines and the document engine do not, and refuse the field withUNSUPPORTED_CAPABILITY. The held keys are recorded asmodifiersof thetap,doubleTap, orsecondaryTapaction and replayed from the cache. An entry whosemodifiersis empty, repeats a key, or sits on another action is a miss (invalid-entry). The grammar tools close their schemas (see Closed grammar tool inputs), so a tool called with a field its engine does not declare is refused by the schema asunrecognized_keys, as upstream’s closed schema does, andUNSUPPORTED_CAPABILITYis left to a field the schema declares. -
A typed value the run derived is recorded as a gap, not replayed (upstream’s
derivedReason,agent/derived.ts;Derived.DerivedReason,Agent/Derived.cs).ActionDispatcherchecks the value of aTypeAsyncfill and of aTypeTextAsyncagainst the step’s instruction, its params (as the executor reads them, aUniqueas its value), and what the step’s screens showed (ObservationFeed.ShownText, upstream’sshownText, kept redacted as upstream keeps the prepared capture;PixelsShownsays a screenshot went to the model). A value the instruction or params spell out replays. Otherwise the first rule that fits names the gap’sRecordedAction.Derived(DerivedReason, upstream’s type of that name incache/trace.ts, spelledpixels,whole-node,minted-token, ordatein the entry):Pixelsonce the model was shown a screenshot,WholeNodewhen a node’s name or text is exactly the value,MintedTokenwhen a one-token value with a digit appears as a word of its own in shown text,Datefor a date or clock time.TraceRecorder.RecordDerivedGapis upstream’srecordDerivedGap: the gap is atoolaction whose text istype (run-time value), and a replay stops at it like any project-tool gap (reasongap). A value the model composed itself replays. A replay types the recording’s own values, so it never records a gap (the port commits a replay throughActReplayHost, so upstream’sreplayingTracecheck has no counterpart).E2ESession’s check for an unchanged flow ignoresderived, as upstream’sflowOfdoes. The MCP session tool path (Agent.RunToolAsync) builds its dispatcher with no instruction or params and records no trace, as upstream’s interactive step records none. Tests:AgentDerived/DerivedReasonTests(the tenits ofagent-derived.test.ts) and, .NET-only,AgentDerived/DerivedReasonWireTests(the enum’s wire spelling) andAgentObservation/ObservationFeedTextTests(the feed’s redacted shown text, .NET-only). Known gap: a replay that stops at the gap does not report the rule (upstream’sReplayOutcome.derivedandstep.cache.derived, the report schema, and theits that assert them) (#1250). -
actalso offers adouble_taptool, which upstream does not have. Without it, the agent cannot open a control that reacts only to a double-click, such as a TodoMVC label that opens its editor. It runs the locatordoubleTap, and the replay cache records it asdoubleTap. Upstream and older versions of this port cannot replay that entry, so they run the step live -
ActOptions.OnActionis upstream’sonAction: a hook that runs after each action once the screen settles, for replayed actions too. Upstream 7b1b8b2 (tester-army/e2e#1500) types the event as a union keyed byaction, withtapAt.point,hoverAt.point, anddragAt.from/to, and addsActionNameandActionDetails. The port keepsActionEvent(Index, Action, Summary, Source)unchanged (no break) and adds derived sealed records for the three point actions (TapAtActionEvent,HoverAtActionEventwithPoint;DragAtActionEventwithFrom,To; upstream’sactionEventisAgentActions.EventOf), plus theActionNameenum andActionEvent.ActionName. Differences, all .NET-only:Actionstays a string (the port’s own names:fill,clear,uncheck), soActionNamemaps them (fillandclearreadType, a secret fillTypeSecret,checkanduncheckCheck); a mutating project tool readsActionName.ToolwithToolName(upstream puts it inactionas a template-literal type);ActionDetailshas no counterpart because the derived records are the narrowing. APointis a value, so upstream’s copy of the points (so a hook cannot move what the trace cache records) holds by construction. A replay reports the points it dispatched (ActReplayHost.Dispatched) while the step still records the action as read. Tests: the newagent-act-on-actionitisAgentActOnActionTests.Partial_exposes_dispatched_viewport_points_and_isolates_hook_mutations_from_replay(partial: the hook cannot mutate a valuePoint, so the mutation check is dropped and the test checks the events of the recorded run and of the replay); the hook assertions thatagent-act-pixel-toolsadds are in the tapAt and dragAt tests ofAgentActPixelVerbsTestsand the two listed-nodes-only classes;sdk-typeshas no counterpart (the compiler checks the C# types). The hook is anActionHookdelegate returning aTask, and the event’ssourceis theActionSourceenum (Model,Replay). Upstream’s check thatonActionis a function has no counterpart, since the delegate type says it. A hook that throws fails the step (ACTION_FAILED,agent.act onAction failed: ...) and leaves the step’s recording alone. Upstream takes a screenshot from the hook withapp.screenshot, which is not ported, so the port’s tests record the events and the screen the hook reads. Tests:agent-act-on-action.test.tsisAgentActOnAction/(6 of 6, plus one .NET-only test for a replayed step whose hook never completes; the first is renamed and partial: it does not check that each hook step holds one screenshot artifact. The others record the hook’s events in a list where upstream takes anapp.screenshotstep, and check the same behavior). Theact-validationit“takes an onAction function and refuses any other value” is skipped: a delegate cannot be anything but a function. .NET-only:AgentException.FromActionHook(internal), where upstream has anActionHookErrorsubclass, becauseAgentExceptionis sealed -
actparams are checked as upstream: JSON-safe values, at most 32 levels deep, no cycle, and at most 64 KiB once aSecretis projected to its name and purpose and aValues.Uniqueto its value. The instruction is at most 8192 UTF-8 bytes. Each limit throwsINVALID_ARGUMENTwith the upstream message before any model call. A value reached twice through different paths is not a cycle -
ParamsonAssertAsyncandWaitForAsync(upstream#1463,7372b0a): the same rules asact,INVALID_ARGUMENTwhen invalid, and the message names the call (agent.assert params contains a cycle). The judge reads the statement, then aParameters: {...}line with the params as JSON: aValues.Uniquevalue as its string, aSecretas{"kind":"secret","name":...,"purpose":...}and never its value, and every string redacted, keys included. The line counts against the input budget. A custom executor gets them inStep.Params; an assert step names its secrets but cannot fill them (POLICY_DENIED), and the attempt does not learn their values. Differences: upstream also refuses params that are not a plain object, which a C# dictionary cannot be.ActParams.Validate,ValidateParams, andRedactParams(upstreamvalidateParamsandredactParamsinact-validation.ts) take the call name as upstream does;RedactParamsis new andActContext.ProjectParamsuses it. The prompt’sStatement: ...text stands for upstream’s<instruction>fence, so the line follows the statement. Tests:JudgmentParams/(upstreamjudgment-params.test.ts; the invalid-params test is partial) andActValidation/RedactParamsTests -
VisiononAssertAsync,WaitForAsync, andExtractAsyncis aVisionMode(Off,On,Only) in place of upstream’sfalse,true, and'only', and an undefined value throwsINVALID_ARGUMENT.Onsends a masked screenshot beside the tree, andOnlysends the screenshot alone, with a note that no tree is attached on purpose. The screenshot is sized for the model (long side at most 768 pixels) and its note names the regions masked for security. An engine that captures no pixels or masking the engine cannot prove (fewer masked regions than secure nodes in the tree, or no count at all) takes the image away and the judgment goes on with the tree;Onlyhas no tree to go on with, so it fails withPOLICY_DENIEDthat namesMASKING_UNPROVENorUNSUPPORTED_CAPABILITY, before any model call. The judge’s system text says an attached screenshot is data, as upstream’s policy does.WaitForAsynctakes a screenshot with each look and counts a changed picture as a changed screen. An inconclusive judgment made from the tree alone ends with the hint to passVision = VisionMode.On, firm once a judgment of the attempt has received pixels and conditional before (“if the engine captures pixels”), and none when pixels cannot help: the engine declares noScreenshotcapability, or an earlier request for pixels was degraded. The hint’s words name the C# option -
AssertOptions.Screenshot(on by default) keeps the redacted viewport after the verdict, a passing one too, under.e2e/results/<result>/attempt-<n>/screenshots/<n>-assert.png, andAgentException.Screenshotnames it on a failed judgment as a path relative to the project root, where upstream names it relative to the artifacts directory. An engine that captures no pixels keeps none. A secret fill does not stop it: the screenshot is the project’s own artifact. Taking it never fails the judgment. The port’s step record has novisionInput,visionDegraded,visionOnly, orpixelByteson a step, novision.pixelsorassert.screenshotpolicy events, and no observation revision in a pixels-only request -
executor(AgentOptions.Executor,AgentExecutoronE2ESessionOptionsand the fixtures) replaces the built-in agent foractandassert. The socket isIStepExecutor:Name, andVersion,Cache,Model, andJudgewith defaults, so a hand-rolled executor writesNameandRunStepAsync(context, cancellationToken). The token is upstream’ssignal; the context’sAttempt.CancellationTokenis upstream’sattempt.signal.StepExecutorContextis a class a test can build and override:Step,Attempt,Target,ReplayedPrefix,Model,ProviderOptions,Ledger,AgentContext,Budgets,Actions,ObserveAsync,AttachTranscript, andAttachScreenshotAsync. An executor is code, soagents.<name>.executorine2e.config.jsonstaysINVALID_CONFIGand namesAgentOptions.Executor. As upstream,SystemandToolsare refused beside an executor, and theModelandJudgean executor brought are the agent’s, for the judgments too. An entry that names another isINVALID_CONFIG(agents.default.model (gpt-5.4) and the executor's own model (gpt-5.4-mini) differ; configure the model in one place). Two models are the same when they are one instance or share aName, where upstream compares the provider and the id -
The
Ledgertext an act reads is upstream’sserializeLedgerover the attempt’s step records:1. app.open passed :: /per completed step, thenobserved: <handoff>when it has one (recorded in an earlier run: <handoff>for a step the cache replayed whole, upstream’sPriorStep.replayed, #1434), up to 8192 bytes, newest kept, with[n earlier step(s) omitted]first. A failed step is in it, with its status. Each label and handoff is stripped of ANSI sequences and control characters and cut to 256 and 700 bytes. A step is recorded foragent.act,agent.assert,agent.waitFor,agent.extract, a locator action andlocator.waitFor, anexpectmatcher on a locator, the browser, or the screen, andapp.open,app.back,app.restart, andapp.clearState. TheBrowserandDevicefixture calls are steps (see App and browser fixtures);expect.pollis not a step yet. The records are internal, and the report writes them as the attempt’ssteps. A replayed act hands later steps the text the replay returns (Replayed recorded actions.), where upstream hands them the verdict the recording run wrote, because the port’s cache entry keeps no verdict, so the line readsrecorded in an earlier run: Replayed recorded actions. -
The tool loop’s turn policy is upstream’s (
agent/tool-loop.ts): with five turns left (WindDownTurns) it adds a wind-down notice, and with two or fewer (ForcedConclusionTurns), after a loop-guard stop, or when the remaining step time falls under a quarter of the step’s budget, capped at 60 s (ClockWindDownMs,ClockWindDownFraction, never on the first turn), it offers onlydoneand, on a low clock, asks for a verdict. A call to another tool on such a turn is answered<tool> did not run: only done is available now. Call done with your verdict.and costs the turn.ToolLoopExecutor.ToolCallsOnlyRule(upstream’sTOOL_CALLS_ONLY_RULE) is in the instructions from the first turn, andTextReplyNotice(TEXT_REPLY_NOTICE) answers a reply with no tool call. A step that runs out of turns returns a failed verdict withSTEP_NO_CONCLUSION(the agent used N of M turn(s) without calling done), where the port used to throwSTEP_BUDGET_EXHAUSTED; the model-call budget still throws it for an executor that records pastMaxModelCalls, and the action budget (MaxSteps) is unchanged. Differences: the tool isdone, notcomplete_step(deliberate, see the tool names above), so the notices and the rule namedone. The loop sendsModelRequest.ToolChoice(ModelToolChoice, the AI SDK’sToolChoice; port-only name for the SDK type): the loop’s mode (toolChoice) decides it, as upstream’sprepareStepreturnstoolChoice: this.toolChoice, or{ type: 'tool', toolName: 'complete_step' }on a forced turn when the mode isrequired. The loop starts inrequired, as upstream does. The wire forms are the AI SDK’s (Anthropicanyor{ type: 'tool', name }, OpenAIrequiredor{ type: 'function', ... }, GeminiANYwithallowedFunctionNames, Bedrockanyor{ tool: { name } }); a request with no choice still sendsauto. A provider option can no longer replacetool_choice(Anthropic, chat completions, Responses) ortoolConfig(Google; Bedrock already reserved it): it fails withINVALID_CONFIG, like the other fields the client sets (port-only guard, since the port builds the body by hand). The AiTrace records the choice as asked ({ type: 'required' }).ModelResponse.Warnings(ModelWarning, upstream’sCallWarning) carries what a provider changed:AnthropicModelandBedrockModelsendautoand warnunsupported/toolChoicefor a forced choice while the model thinks (both providers refuse a forced tool then; the AI SDK’s provider decides this per model). A model that refuses a forced choice is asked again withauto(ToolChoice.IsForcedToolChoiceRejected, upstream’sisForcedToolChoiceRejectedinagent/model/tool-choice.ts: an HTTP 4xx whose message matches one of upstream’s patterns, such as Claude Fable 5.1’stool_choice: type "tool" and "any" are not supported for this model, DeepSeek’s thinking mode, or Meta Muse Spark’s auto-only message, read through the exception chain), on the same turn budget and the same instructions (FreeToolChoiceRetry, upstream’sfreeToolChoiceRetry); the refused request is not a model call. So is a forced turn that came back as a finished reply without a tool call (IsForcedToolCallSkipped, upstream’sisForcedToolCallSkipped; the port reads it off the response throughToolChoiceViolationException, where the AI SDK throwsAI_ToolChoiceViolationError), and a provider that reports atoolChoicewarning (IsForcedToolChoiceDowngraded,NoticeToolChoiceDowngrade) continues the step withauto. Each of the three remembers the model (ToolLoopExecutor.FreeToolChoiceModels, upstream’sFREE_TOOL_CHOICE_MODELS), so later steps on it start inauto. Upstream’sWeakSetis keyed by the SDK model object, which a worker builds once and shares; the port builds a provider model per session, so a model object the caller owns (ScriptedModel, a customIAgentModel) is held weakly by object, and a built-in provider model (any disposableIAgentModel) is remembered for the process by its type and model id, whatever the endpoint. Deliberate .NET-only difference. Differences: the port’s failure message carries the response body (HTTP 400: {body}), where upstream readsresponseBodyapart, and the AI SDK’sRetryError(Errors,LastError) is carried as theInnerExceptionof theAgentExceptionthatModelHttp.SendAsyncthrows once its retries are spent (#1311; theAgentExceptionkeeps its code,ProviderStatus, and message, which are the last attempt’s, because it is sealed and public and callers match it), andToolChoice.IsForcedToolChoiceRejectedfollowsLastErroras upstream followscause ?? lastError; upstream’sisForcedToolCallMismatchedandrecordThrownTurnhave no counterpart, since a model returns the wrong-tool or prose reply as a response the loop already records as a turn and answers (<tool> did not run: only done is available now), where the SDK throws on it. The loop’s notices to the model carry upstream’s prefixes and wording withdoneforcomplete_stepandcodeforerrorCode:[SYSTEM NOTICE]for the going-in-circles warning, the failure-streak warning and the wind-down notice,[SYSTEM]for the loop-guard stop and the low-clock notice, and the loop records upstream’sloop guard warned before turn N: <reason>andthe step was stopped before turn N: <reason>notes on the turn. The loop-guard stop keeps its per-turnPrepareMessagesstop, which does not persist across turns. Tests:ToolLoopToolChoice(ToolLoopForcedToolChoiceTests,ToolLoopDowngradedToolChoiceTests,ToolLoopForcedConclusionAnsweredWithAnotherToolTests(whole: a tool call carriesModelToolCall.ProviderMetadata, upstream’sproviderMetadataof a tool call part, and the refused call goes back with it),IsForcedToolChoiceRejectedTests,IsForcedToolCallSkippedTests). -
ToolLoop.CreateToolLoopExecutorandDefaultAgent.CreateBuiltInAgentare public. Differences:ToolLoopExecutorOptions.Toolsreturns a list ofToolLoopTool(aModelTooland a delegate that answers aToolLoopResult), where upstream’s returns an AI SDKToolSet;BuildPromptanswers a string, where upstream’s can answer a whole message history; the chassis addsdone, where upstream addscomplete_step; there is nomaxTurnsto remove.ToolLoopHelpershasGuardAsync,Concluding, andReportHardStop, and the loop guards every tool call itself. The built-in agent drives the context the runtime builds, so it runs as a step’s executor or inside a custom executor that passes its context on, and not on a context built by hand -
Upstream’s
grammar-tools-exportchangeset (ffed34e, tester-army/e2e#960) exports the built-in agent’s tools. The port hasAgentTools.CreateGrammarTools(StepExecutorContext, GrammarToolsOptions?)(upstream’screateGrammarTools(ctx, { guard })),AgentTools.CreateVerdictTool()withVerdictTool(Tool,Verdict,Concluded,Execute),AgentTools.VerdictRules(VERDICT_RULES),DefaultAgent.BaseRules(BASE_RULES), and the existingStepExecutors.IsRuntimeHardStop. Differences: the grammar tools areToolLoopTools (aModelTooland a delegate), where upstream’s are AI SDK tools, andAgentToolsandVerdictToolwere internal before;GrammarToolsOptions.Guardtakes the body asFunc<Task<string>>and answers a string (body => helpers.GuardAsync(body)runs a tool under the loop’s policy), where upstream’s is generic; the built-in agent passes no guard, since the loop already ends the step on a hard stop. Thedonetool staysdone(notcomplete_step) and takescode(noterrorCode), soVerdictRulesnamesdone. The built-in rules were one text; they are nowBaseRules(the action guidance) andVerdictRules, andToolLoopappendsVerdictRulesafter the executor’s guidance and the project context, as upstream’s chassis appendsVERDICT_RULES, so every loop executor, the built-in one included, sends the verdict rules last.VerdictTool.Executekeeps the first accepted verdict, answersStep concluded.orThe step already concluded., drops a code sent besidepassedand says so, and refuses a blocked verdict without a blockable code;ToolLoopuses the same policy through a stateless internal member, so the loop’s owndoneanswers the same text (Step concluded., or the note that a code sent besidepassedwas ignored, which names the code only when it is from the closed set, and says a code was ignored without echoing any other). A call to a tool the step does not offer is answeredfailed: Model tried to call unavailable tool 'click'. Available tools: observe, tap, fill, done.(the list is the step’s own tools, so it varies with the engine and the project tools), the AI SDK’sNoSuchToolErrortext that upstream’sagent-policyandloop-guardstests read, withdoneforcomplete_step; the turn records it as[click] failed: ....ToolOutcome.Finishtakes the dropped code (droppedCode, .NET-only: upstream’s tool answers the text itself, and the port’s loop reads the text off the stateless outcome).ScreenOutputhas no counterpart: the port’s tool answer,ToolLoopResult(Content,Failed,Pixels), is public and carries the text and the screenshot. The screen presenter andonActionFailedstay internal (ScreenPresenter,ActTools).AgentToolsmembers the port had made public by mistake (MaxScrollTimes,ModelErrorCodes,IsReserved,Project,ExtractFor, and the others) are internal now. The internal definition builderCreateGrammarTools(EngineCapabilities, ...)isGrammarToolDefinitions(.NET-only, since the public name belongs to upstream’s). Tests:SdkTypes/SdkTypesTestsis the new lines oftests/types/sdk-types.tsas reflection checks (the fourPartial_ones check a shape the type checker checks upstream);AgentGrammarTools/CreateGrammarToolsTestsis .NET-only (a loop that spreads the grammar tools beside its own, the guard, the verdict tool). -
The verbs are the ones the port’s engines have:
TapAsync,DoubleTapAsync, andSecondaryTapAsync(all takeClickOptions, whoseModifiersneedTarget.TapModifiers, as upstream’stap(target, { modifiers })needstarget.tapModifiers),LongPressAsync,HoverAsync,DragAsync(upstream’slongPress,secondaryTap,hover, anddrag;Target.Verbslists them by the action kinds the engine declares inIEngineSession.ActionKinds:longPress,secondaryTap,hover,dragTo),TypeAsync,TypeSecretAsync,ClearAsync(upstream clears withtype),PressAsync,SelectAsync,CheckAsync,UploadAsync(upstream’supload),ScrollToAsync,ScrollUntilAsync,ScrollAsync,NavigateAsync, andBackAsync.TypeTextAsync(withTypeTextOptions.Replace) andPressKeyAsyncare upstream’stypeTextandpressKey, listed when the engine declaresKeyboard.DismissKeyboardAsyncis upstream’sdismissKeyboard, listed when the engine can hide its keyboard (IEngineSession.CanDismissKeyboard, withKeyboard); it is a default member ofIExecutorActionsthat refuses withUNSUPPORTED_CAPABILITY, so an existing implementation keeps compiling.Target.Verbsfollows the engine’s capabilities: the scroll verbs needScroll,BackneedsHistory,UploadneedsEngineCapabilities.Upload(.NET-only name for theuploadverb an upstream engine lists; the web engine declares it). A node is named by its ref (new ExecutorTarget("e12"), the[ref=e12]of a line), where upstream namesn42. Actions and looks run in call order, mutating project tools included, and a mutatingRunToolAsyncbody that calls an action or a look waits behind itself, as upstream’s does. A verb checks its argument before it takes a slot (INVALID_ARGUMENT), but the port has no key grammar, soPressAsynctakes any non-blank key -
ObserveAsyncanswersText,Truncated,KeyboardVisible,Path, andRevision, and withExecutorObserveOptionsTree(a list of rootExecutorNodes, redacted, with no value or selection on a secure field, a link target absolute and cut as a line cuts it) andPixels(the masked screenshot sized for the model, orPixelsWithheld, aVisionDegradation).Revisionis upstream’srevision(Observation.Revision, null when the capture carries none); it has noViewportand noframePath, since the port has none.ReplayedPrefixcarries the actions as the text the hand-off notice lists,ReplayHandOffReasonadds the port’sActionBudgetandInvalidEntry, and has noviewport-changed. A replay that meetsACTION_MAY_HAVE_COMMITTEDstops asaction-uncertainand names the action, which the built-in agent’s notice repeats.KeyboardVisibleis upstream’skeyboardVisible(commit5fce7b2):Observation.KeyboardVisiblecarries the engine’s measured on-screen keyboard state toExecutorObservation.KeyboardVisible, and the mobileDeviceSessionsets it from the capture’s keyboard fact (visibleis true,absentis false, and an unmeasured capture leaves it null). The web engine measures none, so it is always null there. Not ported: the part of that commit in@e2e-dev/decision(dismiss_keyboardand the page fingerprint), and thesdk-types.tschecks, which the C# types make. Tests:FixtureRuntime/ProjectToolDispatchTestsandE2E.Mobile.Tests’Engine/ObservationTests. -
The runtime owns the budgets and the clock.
RecordModelCallthrowsSTEP_BUDGET_EXHAUSTEDpastMaxModelCalls, and a verdict never outranks a hard stop: a passed one over a spent budget, a timeout, or a code-less failure after one ends with the runtime’s code. An executor that ignores its token gets one second to unwind after the step is stopped, and then the step settles without it. The closed verdict grammar is upstream’s: an empty summary, an unknown code, a passed verdict with a code, or a blocked one without a blockable code isMODEL_OUTPUT_INVALID, and so is a runtime code the runtime did not record. A thrown error that is no agent error becomesACTION_FAILED, as upstream’stoAgentErrordoes, and a cancel by the caller stays anOperationCanceledException. The message of a failed or blocked verdict is upstream’sagent.act failed: <summary>oragent.act blocked: <summary>(agent.assertfor an assert). The step keeps the bare summary as its explanation, as upstream does. A hard stop (Step timed out, a spent budget) that ends the step with no verdict, or over a passed or code-less one, has a message with no prefix (the reason, then the verdict’s summary if there is one); a coded failed or blocked verdict gets the prefix, also after a hard stop -
AssertAsyncon an agent with an executor goes to it as a step of kindAssert, with the agent’s budgets andJudgmentTimeout. An assert is never cached, and a passing one verifies the acts before it.Visionis refused withUNSUPPORTED_CAPABILITY, since the executor decides what its model sees, andScreenshotkeeps its evidence after the verdict, bounded by the action timeout: a capture that outlives it is dropped and the verdict stands.WaitForAsyncandExtractAsynckeep the judge, which is the executor’sJudgeorModel.ExecutorCache.Offnever replays or records, and takes no look before the step. A step with the cache on that cannot read its first screen (no app opened) still runs, and records nothing -
TypeSecretAsyncfills a secret the step’s params declared, and refuses withPOLICY_DENIEDany other name, a disabled or non-editable field, and a field whose purpose does not fit a password secret. A secret the attempt does not know isAUTH_CREDENTIAL_UNAVAILABLE. The built-in agent’sfill_secretgoes through the same check, so its refusals read as the dispatcher’s messages and not asSecret fill refused: ....ExecutorStep.Paramsis JSON: aSecretis its name and, when set, its purpose, and every string and key that holds a secret value the attempt knows is redacted.ExecutorAttempthas the session’sTestTitleasTestId, a fresh id per session, andIndexas the attempt number minus one;ExecutorStep.Indexcounts the agent steps of the attempt, where upstream’s counts every step.AttachTranscriptandAttachScreenshotAsyncwrite under the attempt’s results directory (transcript-<n>.txt,screenshots/<n>-<label>.png), and, as upstream, only underE2E_DEBUG=1.AttachTurnskeeps the step’s last 12 turns on the step record, redacted, as upstream’sattachTurnsdoes, and the tool loop reports every turn it takes with the same clips. Its loop notes cover the events the port’s loop has (a reply without a tool call, a shrunk history); upstream’s others (a forced tool choice, the wind-down notice, a resent stalled request) have no counterpart. Deliberate difference: upstream clips a turn’s text and then redacts it, so a cut can split a secret and leave a part the redactor no longer matches. The port redacts first and clips after, both in the loop and again inAttachTurns, which also enforces the bounds itself (the last 12 turns, 8 calls of 200 characters, an outcome of 2048) for any executor. A clip never splits a surrogate pair. The loop does not yet attach its debug transcript. The port has no step events -
The act tools word their results as upstream’s
actingdoes (agent/primitives.ts:ActionLabel,failureLead). A success leads with the label’sDoneline and then the screen:Tapped #e12.,Double-tapped #e12.,Typed into #e12.,Filled secret "name" into #e12; its value is masked in every observation.,Pressed Enter on #e12.(on the focused fieldwith no target),Selected "x" in #e12.,Checked #e12.,Unchecked #e12.,Navigated to /path.,Navigated back.,Scrolled down.(Scrolled down 3 screens.),Scrolled down until "x" was in view.,Scrolled into view #e12.,Observed.. A failed action keeps the screen and leads with its attempt, then the error’s code and message:tap #e12 failed: LOCATOR_NOT_FOUND: .... The attempt names the port’s tool (fill,fill_secret,double_tap), where upstream’s aretypeandtype_secret.#e12is the node’srefwhere upstream has its id (.NET-only: the port’s node ids are refs); a call that names its control by role and name has no ref before the lookup, so a failed lookup leads with the name.clearhas no upstream tool, soCleared #e12.is the port’s own. The tool loop’s own refusals (an unknown tool, malformed arguments, a spent budget) and project tools keep the port’sfailed: ...wording; they are the loop’s, notacting’s. The prepaid action slot stays: a call whose control cannot be found is resolved before the dispatcher runs, so the slot is taken first to keep a not-found call an attempt. -
maxObservationBytesandmaxInputTokensare upstream’s agent keys (config/agent.ts), ine2e.config.json, onAgentOptions,E2ESessionOptions, and the fixture.ResolvedAgent.Fromand the config check them as upstream’sboundedIntdoes (agents.default.maxInputTokens must be an integer from 1 through 1000000;maxObservationBytestakes 1024 through 16777216), and the defaults are upstream’s 262144 and 64000 (E2EDefaults).ObservationBudget.ObservationByteBudgetis upstream’sobservationByteBudget(agent/observation-budget.ts), overModelAdapter.TokenUpperBoundandImageTokenUpperBound(upstream’sadapter.ts), both in UTF-8 bytes.SnapshotText.Rendercuts the screen at that budget asprepareObservationdoes: the marker is reserved up front, the first node is always listed, and the first line that would pass the budget ends the screen with[observation truncated at the resolved observation byte limit]. A step that cut a screen reportsobservationTruncated. An act cuts each look atObservationFeed.Text(upstream’sbyteBudgetinobservation-feed.ts) around what every turn resends: the context, the prior-step ledger, and the instruction. Upstream redacts each capture once as it is taken; the port renders a look’s text when it is read, and keeps the newest rendering only while the attempt’s redactor is the one it was rendered under, so a secret registered since is never read from the kept text (AgentObservation/ObservationFeedTextTests, .NET-only). A judgment cuts atAgent.ObservationByteBudget(upstream’sinvocation.ts), around the system text, the instruction, and a screenshot whenVisionis on; underVisionMode.Onlythe tree does not reach the request, so onlymaxObservationBytesbounds it. A judgment whose request is still overmaxInputTokensfails withSTEP_BUDGET_EXHAUSTEDbefore it is sent (upstream’s pre-flight insdk.ts). Differences: the port’s tree text is its own format (Screen (/):and- role "name" [ref=e1]lines), so the header counts against the budget, and upstream’s second marker for an engine-cut tree is the port’s(More of the page is off screen. Scroll to reach it.), which a byte cut replaces. The act loop is not pre-flighted, as upstream’s is not, and the port’s tool loop resends its whole history, so a long act can still end inCONTEXT_OVERFLOW, which shrinks it. The run’s limits (ResolvedAgent.RunLimits, upstream’srunLimits) are the largest any agent allows, and the trace’s screens,screen.tree(), the failure evidence, and the report’slimitsread them. Upstream’s removed-key hints for the agent keys (timeout,maxTurns,maxModelTokensPerCall,limits) and the top-levelspecVersionandlimitsare ported. Tests:AgentObservationBudget/ObservationByteBudgetTestsandObservationBudgetWiringTests(.NET-only),AgentObservation/ObservationByteBudgetTests, andAgentConfig/AgentConfigDefaultsTestsandRunLimitsTests. -
AgentObservation.PrepareObservationis upstream’sprepareObservation(agent/observation.ts, #1303) and returns aPreparedObservation(upstream’sAgentObservation, renamed becauseAgentObservationis the static class of the observation functions):Kind(semantic or pixels),Text,Bytes,Location(the redactedlocation),Path(observationPathof it: the address after the origin, fragment included, or the location as it is when it is not a URL), the redacted node indexNodes,Parents,Tree(the redacted roots; upstream has one root),Truncated, and the pixels or why they were withheld.RedactNodeisredactNodeandRedactNodesAgainisredactNodesAgain. A role is redacted like every other string field, in the screen text, the executor tree, and the recorded anchors, and an executor node’s attribute names are redacted with their values, as upstream’sNODE_FIELDSdoes (a secret used as a role or inside a name such asdata-<secret>no longer reaches the model or the cache).AgentObservation.SettleAsyncreturns at once on a capture whose shape function answers null, assettleObservationdoes withundefined. Differences: the port renders the text from the raw nodes under the redactor at the point it is shown (the engine reads the raw name, role, and test id to tell twins apart), soPrepareObservationbuilds the redacted node index beside the text, andObservationFeeddoes not read from it yet.Observation.SecureNodeCountis upstream’sredaction.secureNodeCount: an engine reports how many secure nodes it saw, andPixelsForModelcompares it withEngineScreenshot.MaskedRegionCount(upstream’sredaction.maskedRegionCount,pixelsProvenMasked), so a pixel-only observation, which has no tree to count, is proven against the engine’s count (#1322). It is nullable (.NET-only): the proof uses the larger of the reported count and the tree’s secure nodes (upstream trusts the engine’s count), and a pixel-only observation with no reported count is counted as zero secure nodes, as upstream’s engine contract leaves it. No shipped engine produces a pixel-only observation yet, so none sets the count; a new one must.Partial_keeps_unavailable_semantics_separate_from_an_empty_tree_and_requires_permitted_masked_evidencenow proves masking againstSecureNodeCountwith empty roots, and stays partial for the pixel observation’s emptyNodesandTree, where upstream’s has neither property;Partial_redacts_every_string_field_a_node_carries_in_the_text_the_executor_tree_and_the_node_index_alikehas noselector,framePath, or unknown-field cases (the port’s nodes have none, #1324);Keeps_the_whole_address_after_the_origin_as_the_path_fragment_included_for_the_route_check_to_readis a full port (#1323):Observation.Locationis upstream’slocation, set by the web engine from the page URL.Observation.Routestays (.NET-only; the mobile and desktop engines report a route, not a location), and an observation with no location reads its redacted route asPath(.NET-only; upstream’spathis then absent).ObservationFeedis wired throughPrepareObservationin #1325. Tests:AgentObservation/PrepareObservationTestsandCollapsedSecretCutTests. .NET-only:PreparedKind,PreparedObservation, andPrepareObservationOptions(the options upstream passes inline).
Explore
Section titled “Explore”Explore.ExploreAsync ports upstream’s explore (packages/e2e/src/explore), the library under e2e explore, and e2e explore ports the command (see below). An exploration is the planner (ExtractAsync), the explorer (the built-in agent with the exploration rules and report_finding), and the loop of charters under the exploration’s budgets, with upstream’s outcome policy: a failed step is not a finding, a step at its limit is neither, three unproductive steps in a row end the run, reported issues fail it, and a run that explored nothing, or whose charters were all blocked, stays blocked. The planner’s prompt, the repairs of its answers (padded digit runs, a lone title or charter), and the explorer’s rules are upstream’s text, with done where upstream says complete_step and fill_secret where it says type_secret.
- The port has no runner, so
ExploreAsyncstarts oneE2ESessionand returns anExploreOutcome:Status(RunStatus:Passed,Failed,Blocked),ExitCode(0, 1, 2, or 3, from the error that ended the run by upstream’s table of agent codes),Error(theE2EExceptionthat ended the run), andExplore(upstream’srun.exploreblock asReportExplore). A config, agent, target, goal, or budget error throws before anything starts, as upstream does. A cancelled token throwsOperationCanceledException, where upstream’s interrupt is exit code 130. - A failure while closing the exploration (the engine’s
finishhook, or the session’s own release) does not throw and does not replace the outcome: as upstream’s runner records it as a run error of phasecleanupand folds its category into the exit code (precedence 130, 4, 3, 2, 1, 0),ExploreOutcome.ExitCodeis the verdict’s combined with the cleanup failure’s (an engine failure is 3),Erroris the verdict’s error or else the first cleanup failure, and a failure that is not an e2e error is anENGINE_FAILURE, as upstream’stranslateProvisioningErrormakes it. The findings stay inExplore. - Times are
TimeSpans:ExploreOptions.Timeout,ExploreBudgets.Timeout, andReportExploreStep.Durationwhere upstream hastimeoutMsanddurationMs. The step bounds areExplore.StepBounds(1 to 100, 8) and the time boundsExplore.TimeoutBounds(3 minutes to 2 hours, 10 minutes), upstream’sSTEP_BOUNDSandTIMEOUT_BOUNDSof tester-army/e2e#1523 (f4be1c4). - Upstream’s
ExploreOptions.rawConfigisRawConfig, anE2EConfig. Becausee2e.config.jsonholds a provider and a model id only,AgentsgivesAgentOptionsby name over the config’s, for a model of your own or a project tool, andEnginegives the engine, where upstream’s config file holds both.OnProgressreceives theExploreProgressmoments that upstream sends asexplorerun events throughonEvent;FindingReportedis upstream’sfindingphase.ExploreAsyncalso writes each moment to the process’s run events as anExploreEvent(see Run events), so a reporter on the bus sees an exploration as upstream’s does. - A target is named by
Target, or is the only one the config declares (TARGET_REQUIREDfor several,UNKNOWN_TARGETfor a name it does not declare). The config’scredentialsare the accounts, as upstream’scredentialAccounts(resolved.credentials)carries them.Credentialsadds accounts in code (.NET-only), by name, asUserCredentials, and one replaces a configured account of its name. Each travels into every step as the username and the secret<name>.password(purposepassword), and a secret anywhere in the params of anact, at any depth, is declared and remembered, as upstream’s walk of the params finds it. The size bound of the account inventory, a quarter of the params limit, is upstream’s. - A target’s engine is chosen from its platform, a .NET-only bridge: upstream’s config holds a live engine handle, and
e2e.config.jsonstill rejects anenginekey.webis aWebEngine.iosandandroidare aMobileEngine(MobileTargetEngine.Create,E2E.Mobile) built fromapp.bundleIdorapp.appPathandE2E_MOBILE_DEVICE, as forMobileAppTest.windowsis aWinAppEngine(WinAppTargetEngine.Create,E2E.WinApp; the CLI passesWindowsTargets.Createas thewindowsfactory ofTargetEngines.Create, which isINVALID_CONFIGoff Windows) built fromapp.appPathorapp.bundleId, as forWinAppTest.ExploreOptions.Enginestill wins. The device engine needs Node 22.12 or newer and a booted simulator or emulator.E2E_MOBILE_PROVIDER=limrunordevflowmakes the engine lease a hosted device, as the config of upstream’s CLI does withmobile({ provider: limrun() })(the port names the provider by variable, like the adapters). Any other value fails withINVALID_CONFIG;E2E.Expo,E2E.BrowserStack, andE2E.TestMu.Mobileare not referenced byE2E.Cli, because upstream’s CLI loads providers from the config and the port’s tool ships only Limrun and DevFlow. Upstream’sopenStandaloneAttempt(run/standalone.ts) prepares the engine for one slot of a run of its own and finishes that run when the attempt closes, on every path (engines.prepareandengines.finish,run/provision.ts). The port has the same:Standalone.OpenAttemptAsyncisopenStandaloneAttempt, overStandalone.OpenWorkerAsync(openWorker) and itsStandaloneHost(openAttempt,close), andPreparedEnginesisprovision.ts’s class of that name. Only upstream’s one-shot kind exists: the hosted kind publishes each session for another test runner, and the port’s tests run in their own. An engine takes part by implementingIPreparableEngine(.NET-only: upstream’s engine handle carries optionalprepareandfinishmembers).MobileEnginedoes;WebEnginedoes not, because it leases for the attempt it starts (below).e2e exploreande2e mcpopen their session through the host, so the lease happens when the session opens, never when the engine is built or whenENGINE_IN_USErefuses a second session, andMobileEngine.StartAsyncleases nothing itself. What prepare leaves (the device binding) reaches the worker inEngineStartOptions.Env, under the run’s own variables. The finish runs once, within the cleanup timeout, and a hook that outlives it is abandoned and reported asCLEANUP_TIMEOUTwhether or not it honors its token, as upstream does. A finish that fails is an error (close_sessionshows it as aCleanup:line, ande2e exploreends with it), because a hosted device bills until it is released. A start that fails or is cancelled after the lease was granted finishes the engine, with a failed finish added to the start’s message; a caller cancel surfaces asCANCELLEDand not as a provider failure; a lease the provider grants after the caller stopped waiting is released where it lands; and the end of the process finishes an engine still held (AppDomain.ProcessExit, .NET-only; a killed process is covered by the provider’s own time limit, 15 minutes for Limrun). Progress lines of the provider (session URLs, lease ids) have nowhere to go in a session and are dropped, as inWebEngine’s standalone run;LIMRUN_API_KEYis registered as a secret, so an error that quotes it is redacted. DevFlow’s agent runs inside the app, soIDeviceProvider.AttachesToRunningApp(.NET-only; a default interface member, false) makes the firstapp.open()attach with no relaunch. Live runs are not possible without Limrun credits or a DevFlow agent: the tests use a fake provider that counts leases and releases. Ported, in part, through the host:OpenHostLifecycleTests.Partial_Host_close_cancels_an_opening_session_and_waits_for_disposal_and_finish_exactly_once(upstream’sopen-host-lifecycleit, without the count of worker disposals, because the port has no workerdisposehook) andEngineTargetsTests.Partial_Ends_the_run_before_any_worker_starts_when_prepare_failsandPartial_Abandons_a_finish_hook_that_outlives_the_cleanup_budget_as_a_cleanup_error_instead_of_hanging_the_run(upstream’sengine-targetit, without the run’s status, results, and error events, because the port has no run). .NET-only:StandaloneHostTests,PreparableEngineTests,HostedDeviceSessionTests,ExploreHostedDeviceTests, andDeviceTargetsTests. The .NET-only symbols of this change are:IPreparableEngine,StandaloneAttempt(upstream’s type of that name, over the port’sE2ESession), the process-exit finish ofStandaloneHost,PrepareScopeandFinishScope(upstream’s, in C# casing),E2ESession.LaunchAsync(the start with the worker’s environment),DeviceTargetsandHostedDeviceProviders(they stand in for the provider upstream’s config holds as code),IDeviceProvider.AttachesToRunningApp, theMobileTargetEngine.Createoverloads that take a provider,SessionHostOptions.Credentials, andFakeCloud(test helper). TheE2E_MOBILE_PROVIDERmapping to Limrun and DevFlow is .NET-only, because upstream names a provider ine2e.config.tsand the port’s config file cannot hold code. DevFlow is .NET-only too: upstream has no DevFlow package, so the attach behavior has no upstream counterpart.EngineCapabilities.PinnedAppis the .NET-only stand-in for upstream’s test of the engine handle (a session withrestartand noopen):MobileEnginedeclares it.TargetEngines.LaunchesPinnedApp(target, engine)is upstream’slaunchesPinnedApp(config/targets.ts, upstream #1252): the target has noapp.urland the engine pins an app. The port’s config holds a platform and no engine handle, so it takes the engine too. Explore opens the app first when the target has a URL orLaunchesPinnedAppholds (openApp), so a device target’s pinned app launches before the planner’s first look. To make that call work,App.OpenAsyncon a target with no URL on a pinned-app engine launches the app throughRestartAsync, as upstream’slaunchPinnedAppdoes inrun/fixtures.ts, and refuses a path withAPP_URL_REQUIRED; upstream’sUNSUPPORTED_CAPABILITYfor an engine withoutrestarthas no port, becausePinnedAppimplies it. Tests:TargetEngineChoiceTestsandMobileTargetEngineTests(.NET-only);E2eExploreTests.Launches_a_device_targets_pinned_app_before_the_planners_first_lookandSessionHostTests.Launches_a_device_targets_pinned_app_before_the_first_observationport upstream’s twoitof #1252.AppSteeringHooksTestsports threeitof upstream’sapp steering hooksfor a device (app.open()launches through restart,app.open(path)isAPP_URL_REQUIRED, and the engine’s own reason is kept); the fourth, an engine with no relaunch hook, has no port, becausePinnedAppstands for that hook. .NET-only:SessionHostTests.Surfaces_a_cancel_during_the_launch_of_a_pinned_app_as_a_cancel_and_disposes_the_engine. The explore test reads the attempt’s steps fromreport.json, as upstream reads the report. - The goal is redacted for the secrets of the config and the credentials’ passwords, which the session also redacts wherever they appear.
- The tool is named
report_finding. A project tool of that name isINVALID_CONFIGfor every agent, as upstream’sHARNESS_TOOL_NAMEShas it (doneis reserved with the grammar’s names). The finding is recorded withArtifactId, the id of thescreenshotartifact that holds its evidence, as upstream’s is (attachScreenshotwrites the file, registers it with the attempt’s artifacts, attaches it to the step, and answers its id; the file isscreenshots/<n>-finding-<k>.pngunder the attempt’s results directory, where upstream names itfinding-<k>.png). The list reporter finds the screenshot among the run’s artifacts by that id, as upstream’sresult(artifacts)does; the port hands them over as the .NET-only internalExploreOutcome.ArtifactsandArtifactsRoot, and shows the path relative to the working directory. The exploration is a test of the virtual fileexplore(Explore.ExploreFile, upstream’sEXPLORE_FILE): the file joins the goal in the result id and leads<result>(explore-<goal words>-<id>), and every prompt opens withTest: <goal>, as upstream’s does, where ane2e mcpsession, which runs no test (noTestFile), gets no such line. The explore executor keeps the model’s screenshot, also after a secret fill (upstream #1437), so none is kept when the engine captures none, when it cannot prove its masking covered every secure node (MaskingUnproven, as upstream’spixelsProvenMasked), or when the observation or the attachment fails (the finding is still recorded). A finding recordsObservationRevision, the revision of the screen the finding tool observed (Observation.Revision, #648), as upstream’sobservationRevision; it is null when the observation failed, and the report writes it asobservationRevisionon the finding. e2e explore [goal](E2E.Cli,ExploreCommand) takes--config,--target,--agent,--max-steps,--timeout(milliseconds),--headed,--output,--debug,--ai-trace,--trace, and--video, with upstream’s bounds, and exits with the outcome’s code: 0, 1, 2, 3, and 130 for an interrupt. A bad flag exits 2 with commander’s message (option '--max-steps <n>' argument '101' is invalid. must be an integer from 1 through 100). EachE2E_USER_<NAME>_USERNAMEand_PASSWORDpair in the environment that no configured credential owns is passed asCredentials(named<name>in lower case; .NET-only, upstream carries the config’scredentialsalone). A username with no password, or a short one, exits 2.- The output is upstream’s list reporter, fed by the run’s events (see List reporter and Run events):
explore-text.tsisExploreText(the severity words, why-it-ended text, step counts, and the order of findings), andlist-explore.tsisExploreViewinE2E.Cli.ExploreCommandsubscribes aListReporterto the process’s events,Explore.ExploreAsyncwrites the run’s start (HostRun.Started, with the explored target and agent) and plan, and the command ends the run withHostRun.FinishAsync. The output is theRUNheader, the header of the exploration, each finding and each step as they happen, then theFindingssection, theAssessment, and the summary rows (Findings,Steps,AI,Start at,Duration). Differences: no live window (the command always prints the output a pipe gets, where upstream paints a live window on a terminal), the model and the target text the command redacted before are now redacted where the run writes its events (the explore state and the session’s results), and a failure that is not the findings’ verdict prints asCODE: messagebelow the record. An interrupt (exit 130) prints no summary. An error thrown after the run started (the engine failed to start) is oneerror CODE: messageline on standard error, below the header. --debug,--ai-trace,--trace [mode], and--video [mode]are upstream’s, with its parser: a bare--traceor--videoison, the optional value is greedy (--trace "Explore checkout"reads the goal as the mode and is refused withwrite --trace=<mode>, or put test files before --trace), and the old spellingsallandretriesare refused with the mode they meant.ExploreOptions.Trace,Video,Debug, andAiTracecarry them; aTraceorVideois aRunsource over the target’s and the config’s, else the target’s mode.E2E_TRACE,E2E_VIDEO,E2E_DEBUG, andE2E_AI_TRACEset them without the flag. An exploration is one attempt, so a retry mode keeps nothing, andExploreOptions.Noticesays to pass--trace onor--video on(upstream’srecordingNoticesforexplore, asExplore.RecordingNotices, internal), as it says that a--videothe engine cannot record is skipped. An exploration’s verdict (ASSERTION_FAILEDwith an issue finding) gets no trace page (isExploreVerdict, asTracePages.IsExploreVerdict), andReportRun.Explorecarries the record for that.e2e mcptakes none of the four, as upstream.- Not ported:
--sessionand--reporter(the command refuses them with exit 2, since running without a session or a report would change what the run means).--sessionneeds a runner that finds and runs the setup test that saves the session and restores it into the exploration’s attempt; the CLI has no such runner (a setup test is a compiled[E2ESetup]test in the user’s test assembly), and a saved session lives in the store of one process (SessionRun) and is deleted when the run ends, so another process cannot restore it.ExploreOptions.Session(upstream’ssession) is ported for the part that does not need the runner: it names a session the host has already restored (for example through anEngineof its own), and then the planner and the explorer are told the app starts signed in (ExplorePlan.SignedInContext, upstream’ssignedInContext, added to the explorer’s agent context as upstream’sagentContext), and the planner plans no sign-in and offers no other-account lens. It does not run a setup or restore state itself, and an unknown name is notCOLLECTION_ERROR. Also not ported:--reporter json(the port has no reporters;.e2e/report.jsonhas the record underrun.explore, see Report document),--reporter json(the port has no reporters;.e2e/report.jsonhas the record underrun.explore, see Report document), a start from a restored session by the command, and the--artifactsrefusal (the port never had the flag). - The planner prompt (tester-army/e2e#1523
f4be1c4, #152273734c6):ExplorePlan.PlanInstructionlists summaries for the latest 8 steps only (SummarizedSteps, upstream’sSUMMARIZED_STEPS), and carries upstream’s lenses and finish rule. The “another account or role” lens needs several accounts and noPlanRequest.Session(the session ofExploreOptions.Session), as upstream.PlanInstructionadds thesignedInContextline and the “work as the signed-in user” text for a session. Tests:ExplorePlan/PlanInstructionTests(upstream’sexplore-plan.test.ts, whole).ExploreRulesinExecutor.cshas upstream’s edge-case rule and its “same defect on another screen is a new finding” sentence, word for word. - Tests:
E2eExploreTestsports theitofexplore.test.tsthat says to pass--video onwhen a retry mode would record nothing (partial: the notice comes throughExploreOptions.Notice, and a scripted engine that declares the video capability stands in for the web engine). The--traceand--videoparser tests ofcli.test.tsare aboute2e run, which the port lacks;ExploreFlagsTests(.NET-only) covers the same parser one2e explore, andExploreRecordingTests(.NET-only) covers the files.
Doctor
Section titled “Doctor”e2e doctor (tester-army/e2e#1493, 91bd614) is E2E.Cli DoctorCommand over Doctor (upstream’s cli/doctor.ts), with IDoctorEngine for upstream’s optional doctor hook of Engine. See Checking your setup. The device engine’s checks, --check-model, and the blank device name check were ported next (hardkoded/e2e-dotnet#971, second part).
DoctorCheck,DoctorReport,DoctorStatus,DoctorOptions, andDoctor.FormatDoctorReportare upstream’s names, internal toE2E.Cli.EngineDoctorInfoandEngineDoctorCheckare upstream’s, inE2E.EnginebesideEnginePrepareInfo;EngineAppInfois upstream’s with the members the port’s config declares (Site,BundleId,AppPath,LaunchArguments,Permissions), built byTargetApps.EngineAppInfoOf(upstream’sengineAppInfo). The schemadoctor-v1.schema.jsonand both fixtures are copied.- .NET-only:
IDoctorEngine(the hook is its own interface, asIPreparableEngineis, so an engine without it compiles unchanged),EngineDoctorStatus(upstream’s status is a union of four strings), theCancellationTokenofDoctorAsync(upstream’sinfo.signal), theruntimecheck (upstream’snode, which names the Node.js version;nodestays a reserved id, so an engine cannot take either),DoctorOptions.CreateEngine(the config names a platform, not an engine handle),DoctorOptions.CreateModel(a test seam for the model of an agent; upstream’s tests script an AI SDK instance in the config), andLoginModel.LoginOf(upstream’sloginOf, by the config’sprovider: upstream records the login on the model instance). - The verdict line says
e2e explore and e2e mcp can start herewhere upstream sayse2e run can start here: the port has noe2e run. The message of thebrowsercheck namese2e installwhere upstream namesnpx @e2e-dev/web install. - Engines:
WebEngineimplementsIDoctorEngine(WebEngine.Doctor.cs):init-scriptsandbrowser, as upstream’s web engine does. The installed-browser lookup reads the revision from the driver’sbrowsers.jsonand checks the cache forINSTALLATION_COMPLETE, instead of asking a driver for the executable path, which would start a process; a revision override for an old operating system is not read.MobileEngineimplements it too (MobileDoctor.cs, upstream’smobile/doctor.ts): agent-device’sdoctorcommand once per configured device (once with no device, for the booted one a run picks), with the machine checks (agent-device,toolchain,ios-runner-cache) reported once,infofindings,metro, andtarget-app-devicedropped, a device’s message prefixed with its name,targetAppset to theBundleIdwhen there is noAppPath, andapp-pathfor a build that does not exist; with a provider onlydevice, asskip. The client calls it ascommand.doctor(DeviceCommandsmaps it to thedoctorcommand), and, as upstream does, the daemon may start an iOS runner build in the background.DocumentEngine,WinAppEngine, and the MAUI DevFlow and TestMu engines have no hook, so their targets get the oneenginecheck with statusskip. - A target’s engine is built before its checks run, as
e2e explorebuilds it; one that cannot be built (awindowstarget on another host, a badE2E_MOBILE_PROVIDER) is that target’s failedenginecheck, and the other targets are still checked. A problem resolving a target’s app is theconfigcheck’s. - A model: the JSON config names a
providerand a model id, somodelandjudgereport those, where upstream reports the names the AI SDK instance gives itself. Aproviderthat reads ane2e login(chatgpt,copilot,grok,opencode-console) is checked on the stored login or the API key variable; every other model isunknown(the model reads its own credential; --check-model calls it) and neverpasswithout--check-model. With--check-model, a call goes through the agent’s own model (AgentConfig.CreateModelandCreateJudge), once per model, provider, base URL, key variable, provider options, andMaxInputTokens, withModelRequest.MaxRetries(upstream’sModelCall.maxRetries) set to 1 and a 1 minute limit, which fails asMODEL_PROVIDER_FAILED(the model did not answer within 1m); aMODEL_REFUSEDorMODEL_OUTPUT_INVALIDcounts as an answer. The call sets nomaxOutputTokens(the port’s models set their own). The config has no custom executor, so theexecutorfield of the check is never set. - Messages are redacted for the config’s secrets and the hosted-device credentials before they enter a check, and an engine’s progress lines are redacted too. The human output passes each line through
Format.Bounded. - Not ported: the manifest’s
doctorkey and the protocol (lifecycle/doctor, thedoctorrole ofTransportContext, the grace for a protocol engine’s connection), since the port has no engine protocol, client, server, or transport;bin.ts‘s Node.js version report; the migrate guides’ change fromagent-device doctortoe2e doctor(the mobile get-started guide now points ate2e doctor); a third Ctrl-C that exits at once (the tool cancels once, ase2e exploredoes); and SIGTERM, which onlye2e mcphandles. - Tests:
CliDoctor/E2eDoctorTestsports all 10itofcli-doctor.test.ts(integration): six whole, four partial (Partial_: the model naming, which leaves out the agent that holds a custom executor; ‘retries a refused connection once’, which answers 503 from a local server where upstream’s scripted instance throwsECONNREFUSED; and the two Ctrl-C ones, which cancel a token and send no signal). The models are scripted by id throughDoctorOptions.CreateModel.CliDoctor/DoctorTestsports bothitof the unit file, partial: the engine’s own teardown stands in for a protocol connection’s close.WebDoctor/WebDoctorTestsportsweb/tests/unit/doctor.test.ts,Install/BrowserCheckTeststhebrowserCheckaddition toinstall.test.ts, andSchemaFixtures/DoctorV1SchemaTeststhedoctor-v1case ofschema-fixtures.test.ts.Doctor/DoctorTestsinE2E.Mobile.Testsportsmobile/tests/unit/doctor.test.ts(fiveit), andEngine/LifecycleTeststhe blank device nameitofengine.test.ts.NoOutputError/NoOutputErrorTestsports the ‘plain call: an error finish’itofno-output-error.test.tsas far as the port has one (partial: an agent turn, since the port has no plain call that parses a reply, and no built-in provider reports anerrorfinish); ‘plain call: a finished reply that is not JSON is MODEL_OUTPUT_INVALID with its text’ is not ported, for the same reason.ModelCallRetries/ModelCallRetriesTestsis .NET-only (upstream has no test ofmaxRetries). Not ported: theengine-protocol.test.tscase and the manifest case ofschema-fixtures.test.ts.
Reporters
Section titled “Reporters”Reporter,FinishedRun, andReporterSummaryRow(E2E.Reports,Report/Reporter.cs) are upstream’sReporter,FinishedRun, and the elements ofReporterSummary(types.ts, as ofbd7f45f).OnEvent(RunEvent)isonEvent(event): a virtual no-op that sees every run event as it happens (see Run events) and must not block or throw.OnRunFinishedAsync(FinishedRun, CancellationToken)isonRunFinished(run, signal): it runs once, when the report is final, within one minute (Runner.ReporterTimeout, upstream’sREPORTER_TIMEOUT_MS); its token is cancelled when that runs out or the run is forced to stop; a throw, a timeout, a forced stop, or a row with no label and text is onee2e: reporter "name" ...line on stderr, with upstream’s wording, and never changes the outcome.Runner.RunReportersAsync(Run/Runner.cs) is upstream’srunReporters(run/runner.ts).FinishedRun.TracesandFinishedRun.AiTracePathare upstream’stracesandaiTracePath, as init members so a positionalnew FinishedRun(...)still compiles:Tracesis aIReadOnlyDictionary<string, string>(upstream’sReadonlyMap), empty when no test kept a trace;AiTracePathis null when the process wrote no AI trace. A reporter that gives up on is work left behind:AbandonedWork.LeftWorkBehindis upstream’sleftWorkBehind(internal/abandoned.ts), set byRunner.RunReportersAsyncwhen it stops waiting for a reporter past its budget or after a forced stop (a reporter given up on before it was called is not work left behind), as upstream’srunReporterscallsleaveWorkBehind. Nothing in the port reads it yet: upstream’s CLI exits without waiting for such work, and a test host exits on its own.reportersine2e.config.jsonis upstream’sreporters(resolveReporters,config/resolve.ts), with a different shape. Upstream’s entries are built-in ids and reporter objects built in code (github(options)); the JSON config holds no code, so an entry here is a type name or{ "type", "options" }and the reporter is built by reflection when the run begins, so itsOnEventsees the run from the start.reportersthat is not an array, an entry that is neither a string nor an object with a stringtype, an unknown entry key, andoptionsthat is not an object areINVALID_CONFIGat config load. The type is resolved late, when the run begins (Reporters.Create), since a type of the test assembly is not loaded for every command that reads the config (e2e explore,e2e login): a name that is not found, a type that is abstract, is not aReporter, or has no public parameterless constructor, andoptionsfor a type that is not anIConfigurableReporter, are one stderr line that names the type string (e2e: reporter "X" could not be created: ...). The other reporters still run and the outcome is unchanged. A message never holds an option value. Order is config order, a type listed twice runs twice, and no config file means no reporters. Config is the only way to choose reporters: the earlier[assembly: E2EReporter]attribute (E2EReporterAttribute, from #883) was removed, a breaking change to a .NET-only API. A reporter that fails to build or run is still one line on stderr. Trimming and AOT: the type is found by name at run time, so a trimmed or Native AOT app must keep it (a root descriptor orDynamicDependency); there is no source-generated registry.- .NET-only:
IConfigurableReporter(Configure(JsonElement options)), since upstream passes options as arguments in code and a JSON entry has none; it is called once, only when the entry hasoptions, and rejecting unknown option content is the reporter’s job.ReporterEntryandReporters.Create, which build the reporters of the config;HostRun(Run/HostRun.cs), whichE2ERunFixture(E2E.NUnit,E2E.XUnit.V3) drives, the only run-level hook a test framework gives (a run without the fixture calls no reporter and emits no run-level event): it builds the reporters when the fixture is set up and subscribes eachOnEventto the process’s events, emitsrun-started, thecollectsetup step, andplan, and when the fixture is torn down emitsrun-finishedfor each run the process wrote a report for and then runs the same reporter instances’OnRunFinishedAsync;ReportFile.FinishedRunsAsync, which readsreport.jsonback as theFinishedRunof each output directory.Runner.RunReportersAsyncstarts each reporter on the thread pool (Task.Run), so one that blocks before it returns a task still meets its budget; upstream’s promise cannot block its own timer. The rows print to standard output after the tests, where upstream’s list reporter prints them under the summary.Reporteris an abstract class,OnRunFinishedAsyncreturnsnullfor upstream’svoid, and the C# types make upstream’s malformed-row and scalar cases impossible except an empty label or text. FinishedRun.LastRunis upstream’slastRun: the report of the run a--last-failedrerun selected from (see Test filters),nullfor any other run. Not ported: the built-injson,junit, andmarkdownreporters (a reporter renders the markdown page itself:MarkdownReport.RenderMarkdownReport(run.Report, options)is public).exitCodeis the report’s, not the test process’s.- Tests:
Reporters/ReporterObjectsTestshas the 4itofdescribe('reporter objects')intests/integration/reporters.test.ts(as ofbd7f45f), whole: a run starts, a passing session over a fake engine is the test, and the run ends. Not ported: thescalarreporter of the thirdit, whoseonRunFinishedanswers with something other than rows (untyped JavaScript): a C# reporter returns rows or nothing, so the case cannot be written. Theloudandquietreporters and the host’sonEventareOnEventand a sink on the process’s events.Reporters/RunReportersTests,Reporters/FinishedRunTests(the trace map andAiTracePath) andReporters/ConfigReportersTestsare .NET-only.
Run events
Section titled “Run events”The run’s event spine of upstream’s run/events.ts (bd7f45f) is public, in E2E.Reports (Run/Events.cs): RunEvent (the envelope: Seq, At, and Fact, since a C# record keeps the fact as a member where upstream spreads it) and RunEventFact, a closed hierarchy with one record per upstream type: RunStartedEvent, PlanEvent, NoticeEvent, SetupEvent (with SetupStep, SetupState, SetupOutcome), TestStartedEvent, StepProgressEvent (step; .NET-only name, since StepEvent is the report’s model-turn record), OutputEvent (output, with OutputPair and OutputStream; defined, not emitted), TestFinishedEvent, ExploreEvent (explore, with the ExploreProgress moment it carries), RunErrorEvent, RunInterruptedEvent, RunStoppedEvent, and RunFinishedEvent. A reporter receives them in Reporter.OnEvent. The list reporter reads the same facts.
- The emitter is upstream’s
createRunEventEmitter:RunEventEmitterandRunEvents.CreateRunEventEmitter(Run/RunEvents.cs) stampseq(from 1, counted only while someone listens) andat, and quarantine each sink on its own with one stderr line,e2e: reporter "name" threw on <type>: <message>; ignoring it for the rest of the run. Not ported: async sinks, since the port’s sinks are synchronous. .NET-only:RunEvents(Emit,Subscribe) is the process’s one bus, since a .NET test run has no runner that owns an emitter. It is thread-safe, takes sinks while it runs (Subscribereturns anIDisposable), and delivers under one lock, so every sink sees the events inseqorder and a sink must not block.EventWirebuilds the public events from the port’s own records, asStepProgressWiredoes for a step. - Emitted:
E2ESession(Run/SessionEvents.cs) emitstest-startedwhen the attempt has launched,stepfrom the recorder’s progress, andtest-finishedafter the attempt’s report is built andreport.jsonis written; the run fixtures emitrun-started, thecollectsetup step,plan, andrun-finished(before the reporters’OnRunFinishedAsync), andrun-errorfor a failure of their own setup;HostTestFiltersemits each filter’sfiltersetup step (with its outcome) and its notices (targetfilter);RunAppsemits the app command’sappsetup steps and its notices (targetapp).RunApps.StartAsyncandAcquireAsyncno longer take anonEvent: a caller subscribes to the bus. - A session is one attempt of a test, so a test that retries emits
test-startedandtest-finishedonce per attempt, the later result holding every attempt so far;RepeatandDeclarationIndexare 0 (no repeat-each, no declaration order),SerialIdis null, and the test’s file is the full name of its test class, as a session names it.RunEventResultcarries the report’s public tree (ReportAttempt,SkipInfo,ResultStatusofE2E.Reports); its internalRecordedmember (.NET-only) is the port’s own record, whichListReporterrenders from. An exploration is a test of the virtual fileexploreand emits itstest-started,step, andtest-finishedlike any session, andExplore.ExploreAsyncwrites eachExploreProgressmoment to the bus as anExploreEvent(upstream’sexploreevent, which its run writes to the same stream), in addition toExploreOptions.OnProgress. The tests of a process that explores while another listens to the bus see those events too. planis an estimate (HostRun.Planned): the test methods the framework adapter finds by reflection (RunSelection.Discover), grouped by test class, without the tests the framework ignores or the filters left out. A parameterized test counts once, and a test that skips itself while it runs is counted. Upstream’s plan counts the pairs the selection chose.run-startedhas the project id of the project folder’s name (the port’s config has noprojectId), the config’s targets, and the default agent’s model asprovider/model.- Not emitted:
output(the test framework captures standard output),serial-group(the port has no serial groups),run-interruptedandrun-stopped(no runner to interrupt or stop; the records exist for the list reporter), andprepareandservicesetup steps (no services; engines prepare on their own).e2e explorefeeds aListReporterfrom these events, without a live window; the live window needs a command that feeds a terminal (#882). - Tests:
RunEvents/CreateRunEventEmitterTestsis the firstitofunit/run-events.test.ts, whole (withseq); the two async-sinkitare not ported.RunEvents/RunEventBusTests(ordering andsequnder parallel sessions, quarantine per sink, subscription),RunEvents/SessionEventsTests, andRunEvents/HostRunTestsare .NET-only, as isExplore/ExploreRunEventsTests(an exploration writes its moments and its test’s events to the bus), andHostFilterSeam/HostTestFiltersTestshas the filter events.
GitHub reporter
Section titled “GitHub reporter”@e2e-dev/github (packages/github, as of tester-army/e2e#1438, d181e26) is E2E.GitHub, a NuGet package that references E2E (#745). List it in reporters of e2e.config.json (see Reporters): { "type": "E2E.GitHub.GitHubReporter, E2E.GitHub", "options": { "key": "chromium" } }. Ported: the whole of actions.ts, post.ts, reporter.ts, and merge.ts (as of tester-army/e2e 50fa7af). The docs guide is Pull request comments.
GitHubReporteris upstream’sgithub()andGitHubOptions { Key }isGitHubOptions. Upstream’sgithub(options)is called in the config module; the port’s config builds a reporter by type name with a public constructor with no parameters, soGitHubReporterimplementsIConfigurableReporter(.NET-only):Configurereadsoptions.key(a string), and an unknown option or akeythat is not a string throws anArgumentExceptionthat names the option and never its value (INVALID_CONFIGat config load). Withoutkey, the reporter reads theE2E_GITHUB_KEYenvironment variable (.NET-only), at the time the run finishes.GitHubOptions { Key }stays: it is the optionsConfigurebuilds and a derived class’s protected constructor takes. A class that derives fromGitHubReportercan passGitHubOptionsto its protected constructor (.NET-only). The reporter is namedgithub, builds itsHttpClientwhen the run finishes, and has no side effects before.Actions(detectActions,ActionsContext,ActionsDeps),Post.UpsertCommentAsync(upsertComment,PostParams),GitHubReporter.ReportRunAsync(reportRun),ReportDeps,CommentMarker(commentMarker), andMarkerField(markerField) are upstream’s, in the equivalent files, and are internal as upstream does not export them. The page isMarkdownReport.RenderMarkdownReport(run.Report, ...)(see Report document), with the run page’s#artifactslink, the source links under the project’s path in the checkout, and the key as the title. The marker is<!-- e2e-github project=... workflow=... job=... [kind=explore] [key=...] -->, byte for byte as upstream’s, soencodeURIComponent’s spelling is kept (! ' ( ) *stay as they are) and a comment posted by upstream’s reporter is found by the port’s.- Differences, all .NET-only:
fetchis anHttpClient, the abort signal is theCancellationToken(a cancelled call surfaces as a cancellation, with no reason text), andjson.ts(isRecord) has no counterpart sinceSystem.Text.Jsontells the kinds apart. TheUser-AgentisE2E.GitHub, where upstream sends@e2e-dev/github, so the port’s traffic is not counted as upstream’s. The token goes through the redactor before any text GitHub sent back reaches an error, so an error never holds it; upstream’s messages cannot hold it. The reporter never logs the token. Merge.FoldLastRunis upstream’sfoldLastRun(merge.ts, internal as upstream does not export it): whenFinishedRun.LastRunis set, the reporter renders the rerun folded into the run it selected from. Differences: the port has no serial groups, so the fold joins none (serialGroupsofrunand ofcarriedare empty). The guide has no built-inmarkdownreporter line.- Known gap: an exploration finding names its screenshot only when a result carries an artifact with its
ArtifactId, which the port’s exploration keeps as a file path (#958); the comment of ane2e explorerun is posted all the same, under its own marker. - Tests:
E2E.GitHub.TestshasActions/DetectActionsTests(all 5itofactions.test.ts),Post/UpsertCommentTests(all 10itofpost.test.ts; the abort one isPartial_since a .NET cancellation has no reason text;Keeps_the_token_out_of_the_error...is .NET-only), andMerge/FoldLastRunTests(10 of the 13itofmerge.test.ts; not ported, since the port has no serial groups:joins a rerun serial group's attempts...,shows a carried serial member's group..., andcounts a serial member executed...), andReporter/ReportRunTests(all 12itofreporter.test.ts, theit.eachof two cases as aTheory).Reporter/GitHubReporterTestsis .NET-only (the key fromConfigure, fromE2E_GITHUB_KEY, and from the derived class; an unknown option, a wrong kind, and a non-object are rejected without their value). The fake GitHub (FakeGitHub) isfake-github.tsandFixturesisfixtures.ts, over the publicReportrecords. No test uses a real token.
List reporter
Section titled “List reporter”ListReporter(E2E.Cli,Report/ListReporter.cs, internal) is upstream’sreport/list.ts, withFileGroupandTestLineinListModel.cs(report/list-model.ts) and the formatting helpers inFormat.cs(report/format.ts):Tally,StateString,FileOutcome,StatusBucket,StepsUsage,UsageText,ModelsText,DurationText,StepsCacheTally,CacheText, and the rest the summary reads.Handletakes the run facts ofRun/Events.cs(run/events.ts, public: see Run events):RunStartedEvent,PlanEvent,NoticeEvent,TestStartedEvent,StepProgressEvent,TestFinishedEvent,ExploreEvent,RunErrorEvent,RunInterruptedEvent,RunStoppedEvent, andRunFinishedEvent. The test sessions, the run fixtures, andExplore.ExploreAsyncemit them, so a reporter can be given them throughReporter.OnEvent.e2e explorefeeds them toListReporterand prints the run summary; no other command does.ListReporterrenders a result fromRunEventResult.Recorded, the port’s own record, and reads astepfact’s publicStepProgressand arun-errorfact’s publicReportError.- The summary rows are upstream’s, in its order:
Test Files,Tests,Left out,AI,Cache,Errors,Cleanup,Start at,Duration. TheCacherow counts the steps byCache.Mode, as upstream does:self-finalizedis replayed,agent-concludedis handed off, andmissedis missed, with a zero count left out (Cache 4 replayed · 1 handed off · 1 missed · 1 not saved).not savedisFormat.NotSavedCount(upstream’snotSavedCountofreport/format.ts): the steps of a passed or flaky result whoseCacheWriteisUnconfirmed,NoChange, orNotWritten, taken from the result’s latest passing attempt only (PassingRunSteps, upstream’spassingRunStepsofreport/list.ts). The port’s list reporter has no serial groups yet, so upstream’sserialMemberDetailspart of this change is not ported; four serial-memberits of upstream’sreport-list.test.tsare not ported with it (see #974). TheLeft outrow (upstreamlist.tsata9c3de9, tester-army/e2e#1206da13624) counts the tests each test filter left out, from the unselected results whoseSkip.Filteris set, throughLeftOut.LeftOutTests(upstream’sleftOutTestsofreport/left-out.ts), so a test left out on several targets or repeats counts once:Left out 2 by areas, 1 by jev, orLeft out 1 test by areasfor one filter. TheCleanuprow (tester-army/e2e#123334287cf) appears in the final summary only:Cleanup 1 cleanup failure: ENGINE_FAILURE: attempt end failed: close exploded (+2 more), the first cleanup failure of the run’s tests. A passed or flaky test shows each such failure under its row as→ cleanup failed: <code>: <first line>, and its file lists its tests too (TestLine.CleanupErrors,ListReporter.CleanupLines, fromReportRecords.CleanupErrorsOf, upstream’scleanupErrorsOf). TheAIrow names the models the steps reported, most calls first, and falls back to the configured model. - App errors (tester-army/e2e#1480,
723c1af). Under theapp 2 errors, 1 warning loggedrow, a failure in theFailed Testssection quotes the app’s first 3 errors, oldest first, as× console error: ...(uncaught error,network error), loopback origins dropped, then1 more app error logged.ListReporterreads them withFailureText.AppErrorsOf, the same call the Markdown page’sAppErrorLinesuses; its privateAppLogSummaryrecord is upstream’sAppLogSummary(AppLogSummaryOfis upstream’sappLogSummary). The upstream commit also renamedstepLabeltoquotedLabelinlist-steps.ts; the port has nolist-steps.tsorRunningTreeyet (#843), andFailureText.StepLabelis the Markdown page’s own helper, so nothing renames. No command prints the list reporter yet. - The
Screenshotsrow (tester-army/e2e#1481,f078364). AfterTraces, the summary names the first 10app.screenshotfiles of the run, one per line, thenand N more (the report lists every artifact).RequestedScreenshotsis upstream’srequestedScreenshots, andListReporter.PrintScreenshotsitsprintScreenshots;ResultDetails.Screenshotsis upstream’sscreenshots. A screenshot an assertion or a failure kept is left out. Serial groups are not ported, so a serial member contributes none. No command prints the list reporter yet, so the row cannot be seen in a run. Tests:ReportList/ScreenshotsRowTests,Counts_the_files_past_the_first_tenandPartial_Names_each_app_screenshot_file_and_leaves_out_assertion_and_failure_screenshots(the serial half of upstream’snames each app.screenshot file, ordinary and serial, ...is missing). - Setup lines name the app URL (tester-army/e2e#1483,
0b84d35) in upstream’ssetupWording, on theappsetup event’surl. The port hasSetupStep(CollectSetupStep,FilterSetupStep,PrepareSetupStep,ServiceSetupStep,AppSetupStepwithUrl),SetupOutcome, and theSetupEventfact (upstream’ssetup, withStateStarted or Finished) inRun/Events.cs, andListReporterhandles it:setupWording, the in-flight step the interrupt line names, theNarratedrule, and the startup split ofDuration. The port has no runner, so the emitter isRunApps, whereManagedProcessHooks.StartingandReadyemit theAppSetupStepthatAppStepbuilds withUrls.PrintableUrl(upstream’sappStepinrunner.ts).RunAppswrites to the process’s events (see Run events), so a sink that throws is quarantined with one stderr line and cannot fail the start of the app. .NET-only:EventType, which derives upstream’stype(setup) from the fact’s record name because the facts carry notypefield. A process that attaches to one aSharedAppProcessesalready holds emits nothing for the second caller. The run fixtures emit thecollectstep andHostTestFiltersthefiltersteps; nothing emitsprepareorservice(no services);ListReporterrenders them from the tests. The threeitofsetup stepsinreport-list.test.tsare inReportList/SetupStepsTests.AppPortAllocation/AppPortAllocationTestshasserves the app on a port the run picked ...as partial: it starts the command throughRunApps, listens on the process’s events, and asserts the twoappsteps carry<origin>/, but runs no test against the base URL, reads no reportbaseOrigin, and starts no second run. The other twoitof that file (two targets on distinct ports, the worker process) are not ported, since the port has no runner or workers.ListReporter.Setupis upstream’ssetupStep, renamed because theSetupSteptype takes that name in C#. - Skipped after a failure and repeats. A test that called
Skipafter a failed attempt is listed in aSkipped After Failuresection afterFailed Tests, with the failed attempt’s error and evidence, and the summary names the count on aWarningsrow (Records.FailureBeforeSkip, upstream’sfailureBeforeSkipinrun/records.ts, without itsgroupOfargument, which only a serial member reads). A--repeat-eachrun gets aRepeatsrow, then one line per test that missed a run (Repeats.RepeatGroups,RepeatSummary, andRepeatLine, upstream’sreport/repeats.ts, which the Markdown page already used).ReportList/RepeatsRowTestsis .NET-only: noitofreport-list.test.tsreads the row. - Code frame and video rows. A failure in
Failed Testsnames the failing line under its message (❯ tests/login.e2e.ts:4:22) with a code frame (CodeFrame.Render, upstream’scodeFrame), then the evidence rows, then one❯ video <path>row per recording the attempts kept (a hosted service’s URL is printed as is).ListReporter.PrintFailureLocationis upstream’sprintFailureLocation,VideoPathsitsvideoPaths,PrintVideositsprintVideos. Upstream finds the line withuserFramein the error’sstack; a .NET error carries aStackTrace, not text, and the report keeps no stack, so the frame is found once, when the error is serialized, bySource.Locate(the port’suserFrame, andsourceLocation, which upstream’sinternal/source.tskeeps beside it: the first frame in the project root and outside the runner’s assembly, where upstream skipsnode_modules), and the reporter reads the result fromReportError.Source. Upstream’s file URLs and module-cache query strings (file:///project/tests/login.e2e.ts?worker-collect-1) have no .NET counterpart. The threeitofdescribe('failure locations')are inReportList/FailureLocationsTests, on stack traces that real calls produce:extracts the first project frame, skipping runner and node_modules framesisPartial_(nonode_modulesframes),returns undefined without a stack, root, or matching frameis ported, andresolves file URLs and strips module-cache query stringsis not ported. - Closing
Failedrows (tester-army/e2e#1482,d94593b).ListReporter.Rowsprints the rows reporters resolved with, then the run’sFailedrows last, so a run piped throughtailstill names what broke: each failed test asFailed × |chromium| tests/login.e2e.ts:4 > login > welcomes, its error’s first line, and its trace page.FailedRowsis upstream’sfailedRowsand_closingRowsitsclosingRows; the run-finished event builds them andRowsprints and clears them, as upstream’srows()does. The line is the error’sSourceline when the test file itself threw, else the line the test is declared on (Failure.DeclaredLine, upstream’sdeclaredLine). The port’s declared line isReportResult.Source, which a session sets to the line its first step was called from, since a .NET test method has no declaration line a stack names; a test with no step has none. - Differences.
RunEventResultis the report’sReportAttemptlist andReportSkipwith the test and target identity; it carriesResultId, which the caller supplies because the port has noresultIddigest (internal/ids.ts).ListReportertakes aTimeProvider(.NET-only, for the clock tests) andIListReporterOutputis upstream’sListReporterOutputwithoutraw.DefaultOutputis upstream’sDEFAULT_OUTPUT; its privateStdoutOutputclass is .NET-only, since a C# interface needs a class to implement it. Other .NET-only helpers ofListReporter:Colors(picocolors, which C# lacks),TestLineRows(upstream’stestLine; the name is theTestLinetype’s),IndexOfTarget(thetargets.indexOfof upstream’sbadge, which several callers need), andStatusName(aResultStatusas its wire name, which upstream prints as the string it already is).FDownandFRightare upstream’sF_DOWNandF_RIGHT.ModelTallyis a plainDictionary<string, int>, as upstream’sMap<string, number>. TheRUNbanner prints the assembly version. - Live window and console output (upstream
report/live-window.tsat7e967d9,report/running-tree.tsandreport/list-steps.tsat723c1af,report/list.tsatb8485ba).LiveWindowandRunningTree(E2E.Cli,Report/LiveWindow.csandReport/RunningTree.cs, internal) are the block below the permanent log: it is painted throughIListReporterOutput.Raw(upstream’s optionalraw; an output without it paints no window) whenListReporterOptions.Liveis true or, by default, the console is a terminal, and it repaints everyLiveWindow.RepaintIntervalMs(80 ms) so the clocks tick.ListReporterhandles thestart,event,activity,replay, andendphases of a step: with a window the finished agent steps wait under their test and print nested in the file block (a file that has any lists its tests too), without one they print at once, as before.ListSteps.EventLineiseventLine. The model classesCurrentStep,SetupInFlight,ListModel.IsShownEvent, and theStepsof aTestLineand aRunningTestarelist-model.ts‘s.OutputEventis theoutputfact (OutputPair,OutputStream) andListReporter.TestOutput,ProcessOutput,EndProcessOutput,SourcedOutput,PrintOutput, andFlushOutputaretestOutput,processOutput,endProcessOutput,sourcedOutput,printOutput, andflushOutput: a test’s console output prints above the window under onestdout | <badge> <file> > <title>heading per source, a line written in pieces prints once whole, and what the runner process printed has arunnerheading. Nothing emitsOutputEvent(the test framework captures standard output).Format.VisibleWidthandFormat.FitColumnsnow count terminal columns per grapheme cluster (Format.Graphemes, upstream’sgraphemes, withWIDE_RANGESand the emoji rules), where they counted text elements before, andFormat.TerminalRowsisterminalRows. Differences, all .NET-only:LiveWindowtakes aTimeProviderfor its timer and a lock (ListReporterholds it while it handles an event, because the timer’s thread is not the one that handles events);Format.WithTerminalSizesets the terminal size in an async flow (upstream’s tests setprocess.stdout.rowsandcolumns);Colors.Whiteis picocolors’white. Not ported: serial groups (the user left serial runs to the test runner), soRunningTesthas noserialIdandexecuting, and theserial-groupfact; the live rows of an exploration and theexploreevents (thee2e exploreview isExploreView; #1019). - Step lines and replay notices (upstream
report/list.tsatb4dd4bd,report/list-steps.tsat723c1af), without a live window.ListReporterhandlesTestStartedEvent(testStarted, keeping the pair’s title) andStepProgressEvent(step): each finished agent step prints at once as✓ checkout > agent.act "pay" 4.20s · 3 model calls, and deterministic steps never print.ListSteps(E2E.Cli,Report/ListSteps.cs) islist-steps.ts:QuotedLabel,StepLine,ReplayNotices,ReplayLine. A test row now prints as the test finishes, prefixed with its badge and file, and the file’s block is the file line alone, as upstream does without a live window (the port printed the rows inside the block before;SummaryTestsfollows the new line). A replay notice (replayed · recorded with <model>) prints under the test whose steps replayed a recording made by another model than the header’s. Differences: the port’s step records the recording model as one label (CacheInfo.RecordedBy,IAgentModel.Name), soReplayNotice.Sourceis that string andmodelLabelhas no counterpart;StepEventis taken by the report’s model-turn record, so thestepfact isStepProgressEvent(RunEvents.EventTypestill names itstep);TestStartedEvent.SerialIdis carried and not read. Nothing emits the two facts: they need the runner (#882), whereE2ESession’sOnProgress(StepProgress) is the source ofstep, and the test lifecycle is the source oftest-started. Tests:ReportList/FileBlocksTests(all 9itofdescribe('file blocks')),ReportList/StepStreamingTests(all 5), andReportList/RecordingModelMismatchTests(4 of 5, each with and without a live window; the serial one is not ported).ReportList/LiveWindowTestshas all 15itofdescribe('live window'),ReportList/ListReporterTeststhe two sanitizingit(never lets control characters through error codes, phases, categories, or pathsisPartial_: the port’s category and phase are enums, which cannot hold control characters), andLiveWindow/islive-window.test.ts:LiveWindowTests(7),VisibleWidthTests(3),FitColumnsTests(1),QuotedLabelTests(2), andEventLineTests(2); its twoExploreViewitwait for #1020.CodeFrameWidth/CodeFrameTerminalColumnsTestsnow has all 7 cases ofcode-frame-width.test.ts, with the CJK and emoji rows. - Exploration (upstream
report/list.tsandreport/list-explore.tsata9c3de9).ListReporterhandlesExploreEvent(exploreProgressisExploreProgress;exploreBadgeisExploreBadge, the target its test started on;printExploreisPrintExplore). The first moment creates anExploreView(Report/ListExplore.cs), which stands in for the one synthetic test: without a live window the header, each finding, and each finished step print as they happen; with one,ExploreView.LiveRowsis the window (the header with its clock, the finished steps, the step in progress with its latest calls and findings in time order, or the planner deciding, and theFindingsandStepssummary rows) and the record prints the header and every step at the end (Record(badge, withSteps)). The view counts the step’s engine events as actions (Action; the finding tool’s own call is not one), keeps the test’s artifacts for the findings’ screenshots (Result), and decides which error is the verdict (IsVerdict, on the error’s code): any other failure of the exploration test keeps itsFailed Testsentry.ExploreViewreads the terminal size as the other list helpers do (Format.TerminalColumnsandTerminalRows), where it took the width as an argument;ExploreVerb(Exploring,Explored) is .NET-only, standing in for upstream’s string union, and thetimeargument of the constructor (aTimeProvider) is upstream’snow. A step line counts actions only when the view is fed engine events, whiche2e explore’s own printer does not do, so its step lines show none. Tests:ReportList/ExploreRunsTestshas the two live-windowitofdescribe('explore runs')(Badges_the_record_with_the_explored_target_after_its_test_has_finishedandWith_a_live_window_shows_the_exploration_...) andLiveWindow/ExploreViewTestsbothitofdescribe('ExploreView')oflive-window.test.ts. - Tests:
ReportList/ReporterRowsTestshas bothitofdescribe('reporter rows').ReportList/SummaryTestshas all 12 non-serialitofdescribe('summary'), among them the two newer ones:closes with each failed test after the reporter rows: ...andcounts the tests each filter left out on a Left out row, ...(the 4 serial ones are not ported), withListReporterKitfor the helpers the file declares at its top;vi.useFakeTimersisListReporterKit.FakeTime, aTimeProviderwhose timers fire as the clock is advanced, like vitest’s.ReportList/GoldensTestshas all 5itofdescribe('ListReporter goldens')against upstream’s fixtures (tests/fixtures/list-reporter/, copied asFixtures/ListReporter/, byte for byte: pass, fail, error, interrupted, and live frames), at 80x30 in UTC on a frozen clock;E2E_GOLDEN_UPDATE=1rewrites them in the source tree.ListReporter/ListReporterOutputTestsistests/integration/list-reporter.test.ts, the oneitthat reads the cleanup lines:Partial_Shows_a_cleanup_failure_under_a_passed_test_and_in_the_summary_...hands the reporter the result such a run records, without the runner or the exit code 3; the otherit, the--repeat-eachtally, needs the runner:ReportList/RepeatsRowTestsis itsPartial_port, from events.ReportList/FailedTestsSectionTestshas all 3itofdescribe('failed tests section'), among them the one upstream (tester-army/e2e#1480) added,quotes the first app errors under the tally, loopback origins dropped, and counts the rest.ReportList/ListReporterTestshas theitdirectly underdescribe('ListReporter'),titles the later runs of a repeated test and keeps each run its own line. Not ported: theserial groupsblock ofreport-list.test.ts(serial runs are the test runner’s feature), theresolves file URLs and strips module-cache query stringsitoffailure locations, the explore golden, and the live-windowitofexplore runs(#1020); thescreenshots rowtests are inReportList/ScreenshotsRowTests.
Environment variables
Section titled “Environment variables”docs-site/src/content/docs/reference/environment.mdx ports upstream’s docs/reference/environment.mdx (tester-army/e2e#1582, f185ca8), listing the variables the port reads (user-facing ones; each checked against src/): the model keys, E2E_OAUTH_CREDENTIALS, E2E_USER_<NAME>_*, E2E_SECRET_<NAME>, CI, E2E_CACHE_DIR, NO_COLOR, the GitHub reporter’s variables, PLAYWRIGHT_BROWSERS_PATH, PLAYWRIGHT_SKIP_BROWSER_GC, KERNEL_API_KEY, EXPO_TOKEN, LIMRUN_*, BROWSERSTACK_*, LT_*, and the internal E2E_WEB_BROWSERS_<TARGET>_<digest> and E2E_AGENT_DEVICE_POOL_<TARGET>_<digest>. Differences from upstream’s page:
- .NET-only variables, marked on the page:
E2E_HEADLESS,E2E_SKIP_BROWSER_INSTALL,E2E_MOBILE_*,E2E_AGENT_DEVICE_BIN,E2E_DEVFLOW_PORT,E2E_DEVFLOW_APP,E2E_DEVFLOW_TRACE,E2E_WINAPP_APP_PATH,E2E_GITHUB_KEY,E2E_AGENT,E2E_CHANGED_SINCE,E2E_LAST_FAILED,E2E_TRACE,E2E_VIDEO,E2E_UPDATE_SNAPSHOTS,E2E_NO_CACHE,E2E_CACHE_DIR_OVERRIDE,E2E_DEBUG,E2E_AI_TRACE(the test host has no flags for them),KERNEL_BASE_URL,TESTMU_USERNAMEandTESTMU_ACCESS_KEY,CODEX_PATH,AZURE_*, and the BedrockAWS_*variables. - Not read, because the feature is not ported:
FORCE_COLOR,TERM, the telemetry and update-check variables, the CI-vendor and coding-agent markers,LIGHTPANDA_PATH, andTESTMU_API_ENDPOINT(the port’s TestMu package has no session recording lookup).CIsets theretriesandcache.modedefaults only: the port has noworkers,ONLY_IN_CI, orreuseExisting. NO_COLORis read byListReporter,e2e explore, ande2e doctoras a non-empty value; upstream’s page saysset.- Upstream’s skill (
skills/e2e/references/*.md) does not link to its environment page, soskills/e2e-dotnethas no pointer to add.
Config
Section titled “Config”E2ETest loads the nearest e2e.config.json above the test assembly directory, then above the working directory, once per run. Supported keys: targets (one entry with name, platform, and app with url, command, and readyUrl), timeout, launchTimeout, actionTimeout, assertionTimeout, cleanupTimeout, retries, agents, cache (mode, dir, strict), secrets, and testAssembly (.NET-only, for e2e mcp’s open_session {test}). Defaults, the CI cache demotion to read-only, E2E_SECRET_<NAME> overrides, the 6 code point secret minimum, and INVALID_CONFIG for unknown keys follow upstream.
app.url is normalized as upstream does, with System.Uri instead of WHATWG: a missing scheme becomes https://, or http:// for a loopback host. Userinfo, a query, a fragment, a scheme other than http(s), and plain HTTP on a non-loopback host are INVALID_APP_URL, with upstream’s messages. A base URL set in code (E2EFixture.BaseUrl, E2ESessionOptions.BaseUrl) follows the same rule. Port 0 on 127.0.0.1 or [::1] asks for a free port and needs an app.command to start the app on it (INVALID_CONFIG without one, or with reuseExisting); any other host with port 0 is INVALID_APP_URL. A base URL set in code with port 0 is INVALID_CONFIG, since only app.command starts an app on a free port. Keys of the old .NET shape (app, engine, agent, timeouts) fail with a hint to the upstream key.
app.command and app.readyUrl port upstream’s config/command.ts and config/app.ts (CommandConfig, Command.Normalize, TargetApps.ResolveTargetApp), and ManagedProcess ports run/managed-process.ts (readiness polling, the preflight probe and reuseExisting, the startup-failure tail of command.log, inheritEnv). executable is started with an argument list, never a shell. {port} expands in args, in env values, and in readyUrl, and a url on port 0 takes a free loopback port (AppPorts.AllocateTargetPorts, upstream’s allocateTargetPorts). The first test, e2e explore, or e2e mcp session that needs the command starts it, through Provision.StartDeclaredProcessesAsync and one process-wide SharedAppProcesses pool (upstream’s startDeclaredProcesses and SharedAppProcesses): they share one instance, and it stops when the last holder releases it. A test holds it for the run (E2EFixture.StartSessionAsync calls RunApps.StartAsync); Explore and the MCP session hold it for their own life (RunApps.AcquireAsync) and release it when they close. The tests’ hold ends with the run fixture (E2E.NUnit.E2ERunFixture, a [SetUpFixture] base, or E2E.XUnit.V3.E2ERunFixture, an assembly fixture, both .NET-only: a .NET test project has to register them, since neither framework runs a hook from a referenced library), and without one it lasts until the process ends, where ManagedProcess.KillManagedProcessGroups takes it down on the way out; on Windows the process runs in its own job object (ProcessJob, .NET-only), which ends it and what it started when it is stopped, and when this process is killed outright, as a test host is once its run ends. On Unix a descendant is read with pgrep -P when the app is stopped, so one that outlives a leader that exited earlier is not found. The app command differs from upstream’s in these ways:
- There is no runner, so a command starts once per test process (a .NET-only holder,
RunApps), not once per run. Two processes that declare one command, such asdotnet testande2e mcp, each start their own, so give a shared app a fixed port andreuseExisting. Upstream’sSharedAppProcessespool (ProcessPool.cs),declaredCommands(DeclaredProcesses.DeclaredCommands, over a target’s name and resolved app, since the port has noResolvedTarget), andstartDeclaredProcesses(Provision.StartDeclaredProcessesAsync, withProcessPools.Unsharedfor upstream’sUNSHARED) are ported, and share the instance inside one process. The enginepreparehooks thatstartDeclaredProcessesshares a provision with are not ported. A caller whose token is cancelled leaves a shared start withOperationCanceledException, where upstream throwsCANCELLED. A target whose command ended while it was held is started again byRunApps(.NET-only: the holder outlives its callers), on a new port when it asked for a free one. - A started process is stopped with
SIGTERMand thenProcess.Kill(entireProcessTree: true)aftershutdownTimeout. On Windows, which has no signal to ask a process to stop, the first step is the kill. There are no process groups: on Unix the descendants are read withpgrep -Pbefore the leader is signalled, then each is sentSIGTERMand, aftershutdownTimeout,SIGKILL, so a descendant that outlives its leader’s exit onSIGTERMis still ended. The twomanaged-processintegration tests about that (stops a surviving child after the command leader exits on SIGTERM,lets a child finish its shutdown after the leader exits) are ported and return at once on Windows, as upstream skips them there.stdoutandstderrare read together intolog(or dropped when there is none), line by line as the process writes them. - A cancelled token ends
ManagedProcess.StartAsyncby throwingOperationCanceledExceptionafter taking the process down, where upstream’sstartreturns and the caller reads the signal.startupTimeoutandshutdownTimeoutareTimeSpans (CommandConfig.StartupTimeout,ShutdownTimeout), and a value over 2147483647 milliseconds, which a .NET timer cannot wait, isINVALID_CONFIG. A readiness probe still waiting when the process exits ends there. - JSON has no
secrets.get()handle, so the message that names one for a string value ofargs,env, orurlis not reachable, and anenventry ofnullstands for upstream’sundefined.command.logcontainment resolves symlinks asrelativeToProjectRootdoes (Paths.RelativeToProjectRoot). An app key outside the port’s set is named in the port’s own words (unknown targets[0].app key "readyURL"), where upstream saystarget "web" app has unknown key; the command’s own keys use upstream’s message. - The resolved app (
ResolvedApp) hasBase,PortRequest,Site,Environment,Identity,BundleId,AppPath,LaunchArguments,Permissions,Command, andReadyUrl, as upstream’s.SiteisUrls.SiteOf,Environmentdefaults byUrls.IsImplicitTestHost, andIdentitykeeps the declared:0.AppConfig(Identity,Environment,LaunchArguments,Permissions, with theAppPermissionStateenum) is the checked declaration (upstream’sTargetAppDeclaration, read from JSON inE2EConfig; the shape errors readtargets[0].app.<field>where upstream’s name the target).TargetApps.DigestTargetAppandCommand.DigestCommandare upstream’sdigestTargetAppanddigestCommand, andResolvedConfig.ComputeConfigDigestputs them in the config digest (see the config digest entry); theconfigDigestchecks ofapp-ports.test.tsstill compare the app digest alone (partial), since the port has noassignPorts. Upstream’sengineAppInfoandEngineAppInfoare not ported: the port’s engines are built from the target (MobileTargetEngine,WinAppTargetEngine), not handed its app atprepareandinit. The report’srun.targets[].environmentis still alwaystest, not the app’s resolved environment. - Tests:
ManagedProcess/ports theitoftests/unit/managed-process.test.tsandManagedProcessIntegration/those oftests/integration/managed-process.test.ts, with the program they start (E2E.Tests.App) where upstream runsnode -e; the notice tests wait out a real budget where upstream moves a fake clock.AppPorts/portsapp-ports.test.ts(partial: one target, and no config digest).Config/ports the command andreadyUrltests ofconfig.test.tsand itsidentity,environment,site, app shape, and app digest tests.TargetIdentity/portstarget-identity.test.ts(theproject iddescribeis not ported: the port has noprojectId).DeclaredProcesses/portsdeclared-processes.test.tsandSharedAppProcesses/portsshared-app-processes.test.ts(each target is a name and a resolved app, since the port loads one target per config).RunApps/is .NET-only.AppPortAllocation/portsapp-port-allocation.test.ts(partial: the firstitonly, without a run). Not ported, because the port has no runner or target-selection execution path (targetIds,runExisting): the fouritoftarget-processes.test.ts,starts the shared app command of the selected targets once, and nothing for the others,copies inheritEnv variables from the environment the run is given,rejects an unknown target with its suggestion before starting any process, andpreserves an initial interrupt before validating target IDs or starting processes.
Differences:
- JSON has no engine handles or model instances. The fixture’s
CreateEnginechooses the engine,platformmust beweb, andtargetsholds one entry.agents.<name>.modelandjudgeare model ids for the .NET-onlyprovider(see Models), with the .NET-onlybaseUrlandapiKeyEnvbeside them. A subscription provider refusesbaseUrlandapiKeyEnv.E2ETestpassesagents.defaultas the session’s own agent settings and every other entry throughCreateAgents Secrets.Getof a name the config does not declare throwsSECRET_UNAVAILABLEwith upstream’s message, naming theE2E_SECRET_<NAME>variable and, throughConfigSecrets.CredentialNamed, the credential whose password the name is (#1314; theSecretsthe config builds carries the credentials map, .NET-only: upstream reads a module-global registry). The engine-in-config resolver half of #1314 moved to #1339. A secret set tonullreads onlyE2E_SECRET_<NAME>. A test reads secrets withSecrets.Get(name). A JSON config holds no function, so a secret or a credential’s password that upstream writes as aSecretProvideris set in code (.NET-only, asWithCacheStoreis):E2EConfig.WithSecretProvider(name, provider)for asecretsentry andE2EConfig.WithCredential(name, username, provider)for an account, over aSecretProviderdelegate (ct => Task<string>, upstream’sSecretProviderofconfig/secrets.ts; the token is .NET’s). A provider entry replaces a file entry of the same name, andE2E_SECRET_<NAME>,E2E_USER_<NAME>_USERNAMEandE2E_USER_<NAME>_PASSWORDstill win, so a provider yields to a rotated value. The provider runs on every fill, inside the step and before the node is looked for (upstream’slocator.fill), after the policy of an agenttypeSecretpasses (authorizeSecretFill), and for an engine option (ResolveSecretValueAsync, upstream’sresolveSecretValue,run/secrecy.ts). Its value must be a string of at least 6 code points, or the fill fails withAUTH_CREDENTIAL_UNAVAILABLE(a password) orSECRET_UNAVAILABLE; the value joins redaction before it is used. A replay of a recordedtypeSecretruns the same authorization before it asks the provider (ActReplayHost.TypeSecretAsynccallsActionDispatcher.AuthorizeSecretFill; upstream replays through the dispatcher’stypeSecret), and types the value as sensitive (#1315). Test:Agent/ASecretFillReplayedIntoAFieldThePolicyRefusesTests(.NET-only: no upstreamitcovers it). A provider that throws propagates its own error, as upstream’s does. Asecretsentry now has the purposegeneric-secret(upstream’sSecretPurpose), as a credential’s password haspassword; before, it had none (the params projection the model sees and the cache’s display string name it; the cache key does not).ConfigSecretshas upstream’ssecretLength,isSecretValue,secretValueProblemandcredentialNamed; a password or secret that is empty or not a string saysmust be a non-empty string or a provider function.IEngine.Secrets(default empty) is upstream’s enginesecrets:WebEnginedeclares itsBasicAuthpassword.ResolvedConfig.CheckEngineSecretsis upstream’scheckEngineSecrets; the port has no resolver that holds an engine in a config, so nothing calls it yet (theitisPartial_)retriesis validated and resolved (1 in CI, 0 elsewhere) but NUnit retries still come from[Retry]cache.stricttreats any replay that finds a recording but does not finish it as stale. Retries replay too, and a strict run never writes or deletes a recording, whatevercache.modesays- A launch or cleanup timeout fails with
ENVIRONMENT_UNAVAILABLE traceandvideoare accepted at the config root and on the target, as upstream. The modes areoff,on,retain-on-failure,on-first-retry, andon-all-retries(RecordingMode,RecordingSource,ResolvedRecording). The mode is resolved as upstream’sresolveConfigdoes it: the flag, else the target’s key, else the config root’s, else the default (retain-on-failurefortrace,offforvideo), and a mistake in a target’s key is reported even when the flag wins. The oldtrace: 'all'andtrace: 'retries'spellings, bare or as{ record }, are refused with the mode they meant. The port recordsvideoon the web engine (see Video) and writes the trace page (see Trace page): the settings are read and carried onTargetConfig.TraceandVideo, the fixture’sTraceandVideoproperties, andE2ESessionOptions. The port has no--traceand--videoflags, so the .NET-only variablesE2E_TRACEandE2E_VIDEOstand in for them, with sourceRun.RecordingSource.Testis the source of a setting made for one test; the port has no per-test option yet. The per-attempt rules (attemptKeep,attemptVideo,keeps,recordsOnSomeAttempt) are inRecordingModes, internal. Upstream’s “keeps the mode, at the top and on a target, out of the digest” is ported asPartial_Keeps_the_mode_at_the_top_and_on_a_target_out_of_the_digest(the flag is the variable; #1309); the replay cache key does not read these settings.config.test.tstests are inConfig/:TraceTestsandVideoTests(all fourit, the digest one included; the flag is the variable, so “lets a target override the config, and the flag override both” and “refuses a mode it does not know” are partial),ArtifactsConfigTests(only the old trace spellings; the port has noartifactskey), and “uses CI defaults for retries and workers…” inResolveConfigTests(partial, no workers).recording-modes.test.tsisRecordingModes/failOnSkippedFailure(a boolean,E2EConfig.FailOnSkippedFailure, false by default) andmaxDuration(a positive integer of milliseconds up to2147483647,E2EConfig.MaxDuration, aTimeSpan?, unset by default) are accepted and validated as upstream’sresolveConfigdoes (failOnSkippedFailure must be a boolean;maxDuration must be a positive safe integer of milliseconds, got <value>;maxDuration must be at most 2147483647 milliseconds, got <value>), and neither enters the config digest. They are carried only: the port has no runner to choose an exit code from skipped tests (failOnSkippedFailure) or to stop a run at a limit (maxDuration;e2e run --max-durationstays missing), so nothing reads them. Tests:Config/ResolveConfigTests(bothit, whole)- Not supported, and rejected with
INVALID_CONFIG:projectId,tests,workers, the non-URLappkeys, and the agent keystools(setAgentOptions.Toolsin code), andexecutor(setAgentOptions.Executorin code) cache.storeisCacheConfig.Store, anIStepCache(the port’s counterpart of upstream’sCacheStore:Writable(writable),Read,Write,Delete;Writereturns the entry’s byte count ornullwhen not written, as upstream’swritereturns{ bytes } | undefined; the breaking change for a custom store written against the oldervoid Writewith noWritableis accepted; the file store,FileStepCache, takes upstream’smaxBytesandwritableasnew FileStepCache(directory, maxBytes, writable): it refuses to write an entry over its byte cap, never writes or deletes when not writable, and itsWritereturnsnullwhen it refuses). A store is code, so the config file cannot name one (cache config key "store" is not supported by the .NET port):E2EConfig.WithCacheStore(store)returns the config with it (.NET-only name; upstream writes the object literal). As upstream’sresolveCacheConfigdoes, a store ends theE2E_CACHE_DIRoverride and exempts an unset mode from the CI clamp. A fixture reads it asCacheStore, a host asCache.Store.- The config digest (
ResolvedConfig.ConfigDigest,ResolvedConfig.ComputeConfigDigest,DigestAgents,DigestCache,DigestTargets, andModelIdentity, upstream’sconfigDigest,computeConfigDigest,digestAgents,digestCache,digestTargets, andmodelIdentityinconfig/resolve.tsandconfig/targets.ts) is the SHA-256 of the RFC 8785 canonical JSON of the config as written, with a credential’s password and a secret’s value replaced by{ secretName }, a command’s env values by{ envName }, the agents’ tools by name, an executor by its name, version, cache, and models, a model by its identity, andcache.storeby{ writable }.failOnSkippedFailure,maxDuration,filters,artifacts,output,trace,video(at the top, on a target, or byE2E_TRACE/E2E_VIDEO), and a reporter that is no type name never enter it. It is internal:HostTestFilters.ResolvesetsResolvedConfig.ConfigDigest, and theagentsargument ofComputeConfigDigestcarries the agents built in code (an executor, tools, and models are code). Differences:E2EConfig.RawConfig(.NET-only) keeps the JSON as written, since the digest reads the declared values; a model is itsIAgentModel.Namealone (upstream’s provider, model id, and specification version); anAgentOptionsentry digests its unset options at their defaults, since a property cannot tell a default from a written value; a custom store digests as its ownWritable, and the file store the port builds is writable only inread-writemode (upstream’screateAgentCacheContext); an executor’scachealways enters (upstream adds it only when set); the port has noprojectIdor engine on a target, so neither enters (upstream digests the platform an engine declares); and the report’sproject.configDigestreads it throughBuildReportOptions.Config(upstream’sconfigofbuildReport; the zero digest without one or when the resolver computed none, as upstream’sconfig?.configDigest ?? '0'.repeat(64)).ReportFile.WriteLeftOutAsynctakes the config the host resolved (HostTestFilters.WriteReportAsync), so a run whose filters left tests out carries the digest; a session’s own write holds no resolved config (E2ESessionbuilds the report from its options), so a run with no left-out tests still reports the zero digest (#1306 stays open for that), andproject.idstaysunknown(the port has noprojectId). The host computes that digest without code-built agents (HostTestFilters.Resolvepasses none toComputeConfigDigest).ReportConfigDigest/ReportConfigDigestTestsis .NET-only: upstream has noitthat pinsproject.configDigestinbuildReport. Partial ports (Partial_): “keeps reporter objects and artifact stores out of the config digest” (a reporter is data in JSON, so its cyclic client is not written; #1309), “keeps an engine option’s secret out of the config digest” (no engine option; #1308, #1246), “digests the platform an engine declares” (the target’s own platform; #1308), and thetrace/video“keeps the mode out of the digest” (the flag is the environment variable; #1309). Tests:Config/ResolveConfigTests,FiltersTests,CommandLogTests,OutputConfigTests,ArtifactsConfigTests,TraceTests, andVideoTests, and inAgentConfig/:ACustomExecutorTests,TheBuiltInAgentOptionsTests, andNamedAgentsTests. outputis ported as upstream’sresolveOutputreads it (E2EConfig.Output,OutputLayoutfor upstream’soutputLayoutinrun/output.ts): the directory is relative to the config’s directory,.e2eby default, andresults/,sessions/, andvideos/<session>/sit under it. It is refused (INVALID_CONFIG, upstream’s messages) when it is the project root, outside it, a file or under one, the cache directory or inside it, or wraps the cache inresults,sessions, orvideos; paths are compared through symlinks (Paths.RealPathOfExisting, upstream’srealpathOfExisting), a dangling link followed. The fixtures, hosts,e2e mcprecordings, and the run’s session store use it.e2e explore --output <dir>is the output directory now (it was the results directory;results/is under it, as upstream), over the config’soutput. Not ported: the check that the output does not hold a directory thetestsglobs scan (the port has notests),--cache-dirin the overlap messages,report.jsonandai-trace.jsonin the layout (no report writer; the AI trace keeps itsai-trace-<process id>.jsonname in the output directory).outputstays out of the config digest (OutputConfigTests.Stays_out_of_the_digest).credentialsis ported as upstream’sresolveSecretsreads it (E2EConfig.Credentials,ResolvedCredential,ConfigSecrets.CredentialSecretNameandEnvName): an entry is{ username, password };E2E_USER_<NAME>_USERNAMEand_PASSWORDwin over the config (the name is uppercased and every character outside A-Z and 0-9 becomes_), andusernamemay come from the variable alone; the password is the secret<name>.password(purposepassword, at least 6 code points). Two credentials that map to one variable, an unknown key, a non-object entry, a non-string username, a missing username, and a secret named like a password handle areINVALID_CONFIGwith upstream’s messages, none holding a value. A secret may share a credential’s name.E2EConfig.AllSecrets(upstream’sallSecrets: the passwords, then the secrets) is what redaction reads in a hosted run,e2e mcp, ande2e explore. A JSON config has no provider function, so a password is a string, and the messages leave out upstream’s “or a provider function” and “only password may be a provider function”, and the shape errors name the kind of the value (a string,a number,null) where upstream quotes it, because a credential written as a bare string may be the password. The engine-secret check (ResolvedConfig.CheckEngineSecrets, upstream’scheckEngineSecrets) runs from the internalResolvedConfig.Resolve(E2EConfig)(.NET-only, besideHostTestFilters.Resolve) over the internalTargetConfig.Engine, set through the internalE2EConfig.WithTarget; no public API puts an engine in a config yet (#1339, #1246), soResolveConfigTests.Partial_Checks_every_secret_an_engine_option_holds_against_the_configured_secrets_never_a_credentialstays partial and a JSON config never reaches the check. The config digest replaces passwords (see the config digest entry).Credentials.User(name)returns the account of the config the session runs with (upstream’scredentials.user); outside a session, or for a name the config does not declare, it reads theE2E_USER_*variables alone, naming them with the sameEnvNamemapping as the config (.NET-only: upstream throwsAUTH_CREDENTIAL_UNAVAILABLE). Ane2e mcpsession holds the registry too; itstype_secrettool offers each credential’s password.
Web engine
Section titled “Web engine”WebEngine launches Chromium (or Firefox or WebKit, per BrowserName) through Playwright and builds a semantic tree in the page: explicit roles, the upstream implicit role table (landmarks, lists, tables with rows and cells, dialogs, options, img alt="" as presentation unless it has a title, a tabindex, or a global ARIA attribute, and role="presentation" or role="none" ignored on a focusable element or one with a global ARIA attribute, select multiple as listbox, and the rest), accessible name, text, test id, heading level, and the disabled, checked, expanded, selected, pressed, focused, and hidden states. As upstream, the name reads aria-labelledby before aria-label and associated labels. Disabled covers :disabled (including a disabled fieldset), aria-disabled="true" on the element, and aria-disabled inherited from an ancestor for the roles it applies to. Checked is the native state for checkbox and radio inputs and aria-checked="true" elsewhere; mixed reads as not checked. Hidden is what renders, as upstream: display: none, a visibility other than visible, content under content-visibility: hidden, and content a closed details folds away. A display: contents element is shown when a child element is, or when it is visibility: visible and its own text has a box. One exception, described below: a box with no size does not hide a node. aria-hidden is a separate state, not part of hidden. A child that sets visibility: visible under a hidden parent is visible; nothing under display: none is. An explicit role is the first recognized token of the role attribute; with none recognized, the node keeps its native role. role="img" is reported as image, and an open details is expanded. A closed select lists up to 60 options under it: the ones it offers, so an option that is hidden, display: none, aria-hidden, or inert, or sits under such an optgroup, is left out before the limit counts, as upstream’s isOfferedOption does (#900). A visibility: hidden option stays listed, since a closed select paints none of its options anyway, and a disabled one keeps its state. Each observed element keeps a stable ref for the life of the document, and the engine runs an action on the element that ref names, with no fallback to a text or role lookup in the page. The agent adds the fallback upstream’s agent has: a tap, double_tap, fill, fill_secret, press, select, check, uncheck, or clear whose node the engine reports NODE_STALE finds the node again by its role, name, and test id in a fresh look and retries, up to twice, scroll and swipe do not retry, and a ref the newest look no longer lists (not one it lists as hidden) is found the same way from the last node it named. A description that matches no node or several fails the verb with LOCATOR_NOT_FOUND. Upstream also matches a node’s placeholder and input purpose, and forgives a test id that changed; the port matches the three fields it records, and never finds again a node with no name and no test id. Upstream’s stale-node relocation describes the node with describeTarget, which carries no container key, so neither side looks at the container there. A trace replay does: see the recorded container key below. Upstream wraps the retry in commitTargeted and the step’s accounting; the port has no such wrapper, so each verb runs the loop (TargetedAsync) directly, and ObservationFeed.Relocate takes the redactor as an argument. Firefox and WebKit launch through WebEngineOptions.BrowserName. .NET-only: the first launch in a process runs Playwright’s install for the selected browser, and E2E_SKIP_BROWSER_INSTALL=1 turns it off. As upstream, an install that exits non-zero fails with BROWSER_INSTALL_FAILED (an infrastructure error, exit 3), not ENVIRONMENT_UNAVAILABLE; the message names the exit code. Upstream’s message quotes the e2e-web install command to run by hand, where the port’s says to install the browser yourself and set E2E_SKIP_BROWSER_INSTALL=1; the install runs in process, so there is no spawn-error variant. .NET-only: dotnet test has no flag like upstream’s --headed, so when WebEngineOptions.Headless is unset, E2E_HEADLESS=0 or false shows the window. As upstream, a run is headless by default. As upstream, a headless Chromium run installs with --only-shell, a headed Chromium run installs the full build, and Firefox and WebKit install their one build, and the install runs with PLAYWRIGHT_SKIP_BROWSER_GC=1 unless the user set it. Upstream checks the cache before it spawns the install; the port leaves that to Playwright’s install, which does nothing when the build is there. Playwright’s .NET Program.Main starts the driver with the process environment, so the port sets PLAYWRIGHT_SKIP_BROWSER_GC on the process, not on the install alone.
The walk goes through open shadow roots and closed ones that page script attached (an init script records them, as upstream does). Each iframe is a boundary node whatever its role, so an <iframe role="none"> stays listed with the role none, as upstream’s walk emits it before any role check, and the engine reads that frame’s document through Playwright and puts it under the node, so same-origin and cross-origin frames are both listed and acted on. One observation lists at most 3000 nodes across all frames. When a document has more, nodes that intersect the viewport come first and the rest of the budget goes to the others in document order; the observation reports Truncated, and the snapshot tells the model to scroll. A locator resolves against that tree, so matches come in tree order: a match inside a closed root sits where its host is, where upstream lists the light-DOM matches first and the closed root’s after them. OpenAsync waits for the load event.
WebEngineOptions carries the upstream web() options: Viewport (default 1280 by 720, null for no emulation), TestIdAttribute, Headers, BasicAuth, UserAgent, Locale, TimezoneId, ColorScheme, ReducedMotion, InitScripts, Connect (a CDP endpoint resolver, with an optional ReconnectEndpoint), and Browser (an IBrowserProvider, upstream’s browser: BrowserProvider). Differences:
Headersride requests to the base URL’s host. Upstream scopes them to the app’s site, which can include sibling subdomainsBrowserports upstream’sBrowserProviderseam (provider.ts):IBrowserProvider(Name,Scope,AcquireAsync,ReleaseAsync,SweepAsync),BrowserProviderScope(Worker,Attempt),BrowserRequest,BrowserLease, andBrowserReleaseContext, and the engine side,LeasedBrowsers.BrowserLease.Protocol(BrowserProtocol.Cdp, the default, orPlaywright) is .NET-only: aPlaywrightlease is dialed withChromium.ConnectAsync, the engine opens its own context with the options it gives a launched one, and it needsWorkerscope and noReconnectEndpointbecause that connection cannot be reattached (a dropped one is replaced by a new lease). A provider is an interface, so upstream’sasBrowserProviderchecks that a method exists have no port; the engine still refuses a blank name, a scope outside the enum, andConnectbesideBrowser(INVALID_CONFIG).ScopeandSweepAsyncare default interface members: a provider that leaves them out leases per worker and sweeps nothing. Neither a request nor a context carries upstream’ssignal:AcquireAsync,ReleaseAsync, andSweepAsynctake aCancellationToken.Downloads(BrowserProviderDownloads, withBrowserDownloadContext) andRecordAsync(ProviderRecordContext,ProviderRecording,ProviderRecordingStopContext,ProviderRecordingResult) are default interface members too: a provider with no downloads returns null, and one that cannot record a browser returns null fromRecordAsync, where upstream leaves the method out.LeasedBrowsers.Downloads()andRecorder()are upstream’sdownloads()andrecorder(), andProviderRecordings.StopProviderRecordingAsyncisstopProviderRecording(recording.ts, withVideoSegmentasVideoFileorVideoLink).ProviderRecording.StartedAtis aDateTimeOffset, so upstream’sisProviderRecordinghas no port. The engine callsRecordAsyncthroughRecorderwhen an attempt records video (see Video).Browser.WaitForDownloadAsynccallsDownloads(upstream’swaitForDownload, withsaveDownloadsTo,saveFromBrowser, andsaveLocallyofdownloads.tsasDownloads.SaveDownloadsToAsync,SaveFromBrowserAsync, andSaveLocallyAsync). A provider’s directory is checked at config load too- A runner calls
WebEngine.PrepareAsync,Init,FinishAsync, andDisposeAsyncas upstream’sprepare,init,finish, anddispose, withEnginePrepareInfo,EnginePrepareResult,EngineInitInfo, andEngineFinishInfo; an attempt isStartAsyncand the dispose of its session (startAttemptandendAttempt). The hand-off to a worker travels in the sameE2E_WEB_BROWSERS_<TARGET>_<DIGEST>environment variable, capped at 16384 bytes. The port has no runner, so an engine whoseInitnever ran leases for the one attempt it starts, as upstream’s standalone run does: it prepares one slot of a run of its own, readingEngineStartOptions.Env(the process environment by default), and gives the lease back, and sweeps, when the session is disposed, with the default cleanup timeout for each step (the engine does not see the session’s).EngineStartOptions.AttemptIdnames the attempt to a per-attempt lease - Differences from upstream’s lease flow, all from the port’s engine. It keeps no browser connection between attempts, so a worker dials the endpoint of the lease it holds at every attempt, and leases a replacement only after an attempt attached to a browser that was no longer connected when the attempt ended (upstream: when the next attempt finds the connection dropped). A start that fails gives its lease back itself, since there is no
endAttemptto call after it. A lease that arrives too late, after the attempt was cancelled or the worker disposed, is given back under a cleanup budget of its own (upstream passes the signal that already aborted). Upstream’sstatecapability, which an attempt-scoped provider drops, does not exist in the port, so onlyapp.clearState()is refused (UNSUPPORTED_CAPABILITY, naming the scope) - The lease tests are
BrowserProvider/inE2E.Tests, frombrowser-provider.test.ts. Not ported: “rejects a sweep that is not a function” and “rejects a record that is not a function” (both are methods of the interface), “releases the replacement on dispose even when ending the attempt failed” (the port’sDisposeAsyncdoes not end an attempt), and “refuses, at the start and named, a recording without a start time and a stop” (a recording is typed). The other tests of the recording group are ported in full, on a real Chromium the provider leases (upstream drives a scripted page), throughStartVideoAsyncandStopVideoAsyncof the engine session. Also not ported: “knows a recording by a parseable start time and a stop” ofprovider-recording.test.ts. The rest of that file isProviderRecording/, andprovider-downloads.test.tsisProviderDownloads/, on a real Chrome over CDP, with theBrowserfixture over the engine session Browser.OnDialogAsyncandBrowser.WaitForDownloadAsyncare upstream’sonDialogandwaitForDownload.DialogHandleris upstream’sDialogHandler(DialogHandler.AcceptandDismissare its'accept'and'dismiss', and aFunc<Dialog, Task>converts to it),Dialog.Typeis aDialogType(Alert,Confirm,Prompt,BeforeUnload) where upstream’s is a string union, andOnDialogAsyncreturnsFunc<Task>for upstream’s unsubscribe. The engine side isDialogRouter(dialogs.ts) andErrorLatchandWebSupport.SanitizeFilename(support.ts), andWebSession.ArtifactPathis the surface’sartifactPath. Differences: the engine session hasOnDialogAsyncandWaitForDownloadAsync(default members ofIBrowserSession), and theBrowserfixture attaches the file to the step (attachArtifact), since the port’s fixture holds no context;BrowserDownloadis the result upstream types inline. A dialog handler’s failure is latched and fails the next step, as a route handler’s does, and one that no step follows fails the attempt at its end:ErrorLatch.TrackandSettleAsync(support.ts) are behindIEngineSession.SettleAttemptAsync(upstream’s optionalsettleAttempt, whoseEngineCleanupContextis the timeout and the token) andE2ESession.SettleAttemptAsync(the runner’ssettleAttempt), which the NUnit and xUnit fixtures call when the body settles and again after the teardown, within the cleanup timeout. A handler still running at the budget fails the attempt withCLEANUP_TIMEOUT, as upstream does, and what it throws later is dropped. The MCP server,Explore, and standalone sessions have no attempt end to settle at, so they do not call it, and the attempt record has no phase, so the failure is not markedbody. A test framework’s assertion is not anE2EException, so one thrown in a handler fails the next step asENGINE_FAILURE,dialog handler failed: ..., where upstream’sexpectfailure keeps itsASSERTION_FAILED. A download is adownloadartifact of thebrowser.waitForDownloadstep, with the media type of its extension.AttemptScope.AttachArtifactregisters the file through the attempt’s sink (ArtifactPaths.CreateAttemptArtifacts, see Artifact store), as upstream’sattachArtifactdoes, and the sink rewrites a download assink.registerdoes: when the session has a secret value and the media type is text-like (text/*orapplication/json), it rewrites the file through the redactor (ArtifactPaths.RedactDownload, upstream’sredactDownload) and the record sayscomplete; any other download, one it cannot decode as UTF-8, one containing NUL bytes, or a session without a secret value stays as served and the record saysincomplete. Unlike upstream, the port rejects NUL-containing text conservatively so BOM-less UTF-16 cannot hide secrets between NULs and still be markedcomplete.DownloadRedactionSessionTestsextends the binary-download case with a BOM-less UTF-16LE CSV regression.AttemptScope.ArtifactsDiris upstream’sArtifactSink.dir. The redactionits ofengine-secrets.test.ts(the page’s echo of the password, and of the base64 credential in theAuthorizationheader) arePartial_: they assert the failure message and the report, and scan every file the sessions wrote under their results directories (the screen, the trace page, and the download among them), where upstream scans the reporters’ files as well and the download comes from the same run. The handler-assertion tests ofweb-platform.test.tsare ported with a stand-in forexpect(value).toBe, which the port lacks: the handler throws theASSERTION_FAILEDit would. “fails a %s handler assertion at the attempt end when no step follows it” and “takes the failure evidence of a late handler assertion before a teardown navigates away” arePartial_: they do not read the phase (body),attempt.cleanup, the run’s errors, the steps list, orfailure.urlfromreport.json. TheErrorLatchtests ofdialogs.test.tsareDialogs/ErrorLatchTests. The frame tests ofdialogs-frames.e2e.tsareDialogsFrames/FramesTests, and the download tests trigger the link withbrowser.locator('a[download]')as upstream doesBrowser.WaitForDownloadsAsync(trigger, count, timeout?)is upstream’swaitForDownloads(trigger, { count, timeout })(#1048). It calls the trigger once and returns the firstcountdownloads in start order, each its owndownloadartifact;WebSession.CollectDownloadsAsyncis upstream’scollectDownloads, whichWaitForDownloadAsyncshares with a count of one. One timeout bounds the start, completion, and save of every file (also forWaitForDownloadAsync): a timeout before the trigger returns fails withACTION_FAILEDbrowser.waitForDownload(s) exceeded its timeout of <n>ms, and one after names<k> of <count> downloads started within <n>ms; the trigger resolved after <m>ms(no download startedfor a count of one) ordid not finish within <n>ms. On any failure the listener is removed, the downloads that started are canceled, and the provider’sReadAsynctoken is canceled. Acountbelow one fails withINVALID_ARGUMENTbefore the trigger runs. Differences: the engine session hasWaitForDownloadsAsync(a default member ofIBrowserSession, besideWaitForDownloadAsync), and theBrowserfixture attaches the files once all are saved, where upstream attaches each as it is saved, so a failure after the first file attaches none.countis anint, so upstream’s “safe integer” check is thecount < 1check. The wait budget in the messages is the time left less Playwright’s lead, as before.ProviderDownloads/ports the twoits ofprovider-downloads.test.tsin full, with the%iand%scases as theory data, andRoutes/BrowserRouteDecisionsTeststhe five newits ofroutes.test.ts; the page’sdownloadlistener count is read from the Playwright page’s event field by reflection. Not ported:tests/types/downloads.ts, because the C# signature refuses a missing count and a synchronous trigger at compile time.- Aborted navigations and screenshots across navigations (
fix(web): classify aborted navigations and capture screenshots across navigations,4e7e8b8, tester-army/e2e#1550, #1095). AGotoAsync,App.OpenAsync, back, forward, or reload whose document request a route aborted fails withACTION_FAILED(navigation failed: a route aborted the request for <url>: ...) instead ofENGINE_FAILURE;WebSession.NavigatingAsyncis upstream’snavigatingandNoteRouteAbortisnoteRouteAbort, called byPlaywrightRoutebefore every abort it makes (upstream’sabortinbrowser.ts). A route handler that throws, such as aFulfillAsyncwith an invalid header, aborts the request, and the step fails with the handler’s error:WebSession.GuardAsync(upstream’sPlaywrightSurface.guard,RunAsyncbefore) rethrows a latched error before it runs the step, prefers one latched while it ran, and refuses a cancelled token or stops waiting on the call once it cancels, both asCANCELLED. On a persistent context (cdpEndpoint) a caller’s own cancel stays anOperationCanceledException, as before, because the operation waits on a shared reconnect andPropagates_the_recovery_owner_cancellation_to_another_waiting_operationdocuments that type; so the exception type depends on how the engine started. A cancelled call whose work honours the token getsCancelGrace(one second, .NET-only) to undo itself, such as a drag releasing the button, before the step reports.App.ScreenshotAsynctaken while the page navigates is taken again, within the step’s deadline, of the document that replaced the one its masks were resolved in (DocumentWatchiswatchDocuments); a timeout isOPERATION_TIMEOUTscreenshot timed out: the page replaced its document during every capture for <n>ms. A capture that fails with no document replaced isENGINE_FAILURE, as upstream (the port’s artifact screenshot answeredNODE_STALEfor a navigation race before). Differences: theframenavigatedevent can arrive after the failure it explains, so the port makes one to five round trips to the page (SettleDocumentEventsAsync) before it reads the watch, where upstream’s caret cleanup is that round trip. The port’s artifact screenshot does not hide the caret (see the caret paragraph). .NET-only seams:WebEngine.CapturePage(what upstream’s tests do by spying onpage.screenshot), andWebEngine.GuardandWebEngine.Latch(upstream’s tests callsurface.guardandsurface.latch.latch). Tests:ScreenshotNavigation/(the five its ofscreenshot-navigation.test.ts),Routes/BrowserRouteDecisionsTests(the two new its ofroutes.test.ts),SurfaceGuard/(the four its ofsurface-guard.test.ts). Theshould work while navigatingit ofscreenshot.e2e.ts(whose skip the commit removes) is in the screenshot port of #1060. - With
ReconnectEndpoint, as upstream, each attempt rides the default context of a fresh browser fromCdpEndpoint, refuses a browser an earlier attempt of the sameWebEnginerode, and reconnects once to the same browser and page after a transport drop.Headers,BasicAuth,UserAgent,Locale, andTimezoneIdareINVALID_CONFIG, andapp.clearState()isUNSUPPORTED_CAPABILITY. After a reconnect,PerformAsync, the agent’s key press, and the viewport swipe fail withNODE_STALEuntil the next observation; the browser fixture’s keyboard and mouse are direct input and keep working. As upstream, the reconnect is spent from the budget of the operation that found the transport dropped, both for the CDP dial and for the operation itself BasicAuthtakes aSecretpassword. As upstream, the attempt redacts the password and theAuthorizationcredential the browser sends with it, padded and not, as text only: a page that shows the value outside a secure field is not masked in screenshots, and the agent cannot fill it by name.ASecretInAnEngineOptionTests.Protects_the_secret_as_text_only_screenshots_are_kept_the_text_download_rewrittenports upstream’sitof that name withApp.ScreenshotAsyncandWaitForDownloadAsync: one session per test of upstream’s suite, against one site that echoes theAuthorizationheader. The port has no engine secrets to declare, so the engine resolves the password through the attempt when it starts. A plain string password is not redacted- Not ported from
protected-app-options.test.ts(the audit of tester-army/e2e#1582), becauseWebEngineOptionsis typed. Type-level, so the case cannot be written: “rejects headers that are not a plain object, null included” (Headersis a dictionary of strings), “rejects credentials that are not a plain object, null included” (BasicAuthis aWebBasicAuth), “refuses the old video key, naming screencast” (WebEngineOptionshas noVideoproperty and no untyped options object to carry one), “rejects an option it does not know, naming the nearest driving option” and “rejects an unknown key inside connect and basicAuth” (the compiler rejects an unknown property), and “keeps the removed options their own messages” (allowedOriginswas never ported). Missing feature: “declares a secrets.get() password as the engine secret it resolves per attempt” (the port has no engine secrets; the engine resolves aSecretpassword through the attempt, see above). - An
InitScriptsentry is aWebInitScript: source (a string converts to one),WebInitScript.FromPath, orWebInitScript.FromFunction. A C# lambda cannot run in the page, so a function is its JavaScript source. A relative path resolves against the project root (EngineStartOptions.ProjectRoot, whichE2ESessionpasses fromE2ESessionOptions.ProjectRoot). Each attempt reads the files when its session starts; upstream reads them once per process ColorSchemeandReducedMotionare the enumsWebColorSchemeandWebReducedMotion, andBrowser.EmulateMediaAsynctakes aWebMedia; upstream’s are string unions. A value outside an enum (a cast number) isINVALID_CONFIGin the options andINVALID_ARGUMENTinEmulateMediaAsync; anullmedia throwsArgumentNullException. A feature or value outside the type cannot be written, so upstream’s unknown-key and wrong-type refusals have no port. Playwright sets the media per page, so a tab the app opens itself gets a test’s change as it appears, on a persistent context too, so a script it runs at load may still read the configured values, as upstream. After a reconnect the new transport sets the media again on the app’s own tabs
The tree is a subset of upstream’s: names follow upstream’s accname rules, and nodes are listed by role, test id, or direct text (not by name alone, or as an empty painted box). So getByText answers with the innermost element that reads the text, such as a <strong> inside a paragraph, as Playwright does. Text inside a <label> of a control, or in an element an aria-labelledby names, is not listed: the labelled element carries it as its name, so getByText answers with that element (Playwright answers with the label and retargets a fill to the control). A node listed for its text alone does not count against the 3000-node budget: such nodes have an allowance of their own, so a page full of text cannot push controls out. In the agent snapshot, a node that lists its children shows its own text, read as a person reads its line: the text of an inline link, emphasis, code, or span in the sentence stays in place, so <p>Read our <a>privacy policy</a> for details.</p> reads whole while the link is also listed as a control. An inline aria-hidden or inert element adds no words to the line, as upstream’s hidesSubtree leaves it out of the line. Inline text-only elements are not listed again, unless the line is longer than the 512-character text bound, or the element has a test id, a role, or can be acted on (tabindex, onclick, or an <a> with no href). getByText still answers with such an inline element: the page script sends it as a bare text node under the line, which the agent does not read. This differs from upstream, whose text engine finds the element in the page. A leaf such as a button or a heading shows its whole text. Locator reads (TextContentAsync, text matchers) still read the whole rendered text, as upstream’s node read does. A contenteditable editing host (the root of a rich-text editor, never a canvas, a frame, or a native control) is a textbox named by aria-label, aria-placeholder, or the data-placeholder its editor paints, with its rendered text as the value, as upstream. Its children stay in the tree as content, so getByText finds them. A <p> inside an editor has no role. A document in designMode is not an editing host, though its <html> is editable; upstream has no such check. Playwright’s role selector knows a bare host only by an explicit role="textbox", while the port’s GetByRole reads the tree and finds it. Upstream’s getByText runs Playwright’s text engine; the port matches the tree, so text split across child elements with no text of its own between them (<div><b>a</b><i>b</i></div>) is not one match.
A web screenshot (toHaveScreenshot, failure evidence) hides the text caret with a stylesheet adopted into every frame and shadow root, closed ones included, and takes it back afterwards, as upstream’s screenshot-caret.ts; Playwright’s caret: 'hide' would write an inline caret-color a hydrating framework reads as a mismatch. It works under a style-src policy. The port has one web screenshot path, so there is no separate observation-pixels capture. Not ported: upstream’s leaves the caret to the adopted stylesheet instead of editing element styles (observe.test.ts) and the frame stubs added to observation-capture.test.ts and semantic-fallback.test.ts, which fake page.screenshot and page.frames(); the port has no fake page. The three screenshot-caret.test.ts tests are Partial_: Playwright’s page cannot be spied on, so they sample the page inside the helper, not inside the engine’s own capture.
The snapshot leaves out a checkbox’s or radio’s value, which inputValue still reads (on by default). uncheck on a checked native radio is NOT_ACTIONABLE; on a role="radio" it clicks, as upstream and Playwright, and the failure when the click leaves it checked names the radio group.
The page script reads the text selected inside the focused input, textarea, or contenteditable host into SemanticNode.Selection, as upstream does. A caret, an unfocused field, and a secure field have none. The agent snapshot lists it as selection="..." after the field’s value, verbatim and escaped (a lone space counts, an empty selection does not), as upstream does. The runner drops it from a field whose value or text holds a registered secret, and from a field cut at its length limit when the selection is not in the part shown. Differences: the port’s press has no times, so one call presses the key once; and the snapshot shows a value as it is, a newline included, where upstream escapes it.
Upstream leaves an aria-hidden subtree out of its tree walk, and its text and visibility reads go through Playwright. Here every locator read comes from the tree, so the port lists the subtree and marks each node AriaHidden (.NET-only), and role queries and the agent skip those nodes. They are not hidden: a painted aria-hidden node is visible to isVisible, toBeVisible, and toBeHidden, as upstream, and a visible query keeps it. An action on one is not refused as hidden. A box with no size is not hidden here, since role queries skip hidden nodes and an empty landmark has no size; isVisible, toBeVisible, toBeHidden, WaitFor, and the visible option read NodeStates.EmptyBox too (LocatorEngine.IsNodeVisible, .NET-only, web only), so an element with an empty box is not visible, as upstream. A node with no layout box (display: contents) and an option keep their hidden state. NodeStates.Mixed and NodeStates.ExpandedAbsent (.NET-only, web only) stand for upstream’s nullable states: a role query for Checked or Pressed skips a mixed node (an indeterminate checkbox, aria-pressed="mixed"), and Expanded = false skips a node with no aria-expanded. Level of a role="heading" element is its aria-level, else 2. A hidden node reads its DOM text (textContent) instead of innerText, so a text query still finds a visibility: hidden copy.
Password fields and autocomplete=current-password fields are marked secure. Their values, and their value attribute, are omitted from the snapshot. A text, value, or attribute expectation on a secure field fails with POLICY_DENIED, as upstream. So do the textContent, inputValue, allTextContents, and getAttribute reads (for any attribute).
Selected is aria-selected="true" or a selected <option>, expanded is aria-expanded="true" or an open details, and focused is the active element, followed into shadow roots. Attributes (for getAttribute and toHaveAttribute) and the client rect (for boundingBox, null for a node with no layout box: display: none on it or an ancestor, or any display: contents element) are read for every kept node; they are not sent to the model. The tree reduces a link’s href attribute as upstream’s tree does: origin and whole path, without userinfo, with ?… or #… for a dropped query or fragment, mailto: and tel: kept, blob: reduced to its inner origin and path, and data:… or javascript:… for an inline payload. Upstream’s node read keeps the whole value; the port reads every locator attribute from the tree, so it keeps the whole href on the side and getAttribute and toHaveAttribute read that. The agent snapshot lists a node’s test id, its href, and its placeholder when it has no name, as upstream’s line does: a link target on the app’s origin shows as its path, any other as the whole URL, and a target over 256 characters is redacted, then cut there and ends with …. The executor tree carries treeHref’s result: a link target on the app’s origin keeps the origin and loses no more of its path than the line does. The snapshot is not part of the cache key or of a recording, so showing them does not change the replay policy version. The snapshot joins its lines with \n on every OS, as upstream does (the port used Environment.NewLine, so on Windows the lines ended \r\n); the cache key and recordings do not embed the snapshot text, so no recording is invalidated. A rect in an iframe is in the top-level viewport, shifted past the frame’s border and padding and clipped to its content box.
A display value query never matches a checkbox or radio, which carries a value it never shows. Text, label, placeholder, test id, and display value queries keep hidden matches, so toBeVisible fails on a hidden match and toBeHidden passes on no match or one hidden match. Role queries skip hidden nodes, and toBeAttached and waitFor attached or detached also match hidden nodes for role queries. A single-node matcher that still sees more than one match at its deadline fails with LOCATOR_AMBIGUOUS.
Playwright failures never escape as PlaywrightException. WebEngine throws EngineException with an upstream engine code from EngineErrorCodes: NOT_ACTIONABLE when an action timed out before its input was dispatched or the target does not take that input, ACTION_MAY_HAVE_COMMITTED when it timed out after dispatch, NODE_STALE when the element or its document is gone, OPERATION_TIMEOUT for a navigation or key press timeout, and ENGINE_FAILURE otherwise. EngineException.Retryable is true only for NODE_STALE and FRAME_NOT_FOUND; any other retryable claim becomes ENGINE_FAILURE, as upstream. As upstream (commit c23944c), a Playwright timeout stays a timeout: StaleOr and NavigationStaleOr never turn a TimeoutException into NODE_STALE, even when its call log says an element detached or the page navigated, so a read or a navigation that times out is OPERATION_TIMEOUT and is not retried. The action path is unchanged by that commit. Tests: Errors/StaleOrTests and Errors/NavigationStaleOrTests. A sensitive fill’s value is redacted from the message. As upstream, check and uncheck click once and read the state back on the same element until just before the action timeout, so a control that commits its state late passes. A control gone by the first read (replaced, or navigated away) took the click, so the action passes. Each of these is NOT_ACTIONABLE: a control that goes later in its old state, a click that leaves the state unchanged at the end of the wait, and an uncheck on a checked radio. The port ends the poll min(250 ms, timeout/4) before the action deadline, which upstream does not: upstream polls to the full timeout, but here the deadline that abandons the call would win the race and report ACTION_MAY_HAVE_COMMITTED. The document engine still uses NOT_FOUND for a ref missing from its last observation.
A page stuck in a script fails an operation at the action timeout, not the test timeout. As upstream, each page operation (a navigation, back, forward, reload, observe, an action, a scroll, browser.evaluate, browser.title, browser.setViewport, browser.emulateMedia, a key press, typing, and browser.mouse) has one deadline, the action timeout, that every page call in it shares. Playwright’s own timeout is set 250 ms short of what is left, or half of it when less than 500 ms is left, so Playwright’s reason (what blocked an action, or that its input was dispatched) arrives first. A call Playwright never answers, such as an evaluate or input on a page stuck in a script, is abandoned at the deadline. A read cut off that way fails with OPERATION_TIMEOUT. An action or input cut off that way is ACTION_MAY_HAVE_COMMITTED, because it may have reached the page.
Locator.SetInputFilesAsync(path | paths) is upstream’s setInputFiles, and LocatorAction.SetInputFiles its { kind: 'setInputFiles', paths } action (upstream #958). Paths resolve from the project root (Screen.ProjectRoot, upstream’s context.projectRoot), and a blank entry is an ArgumentException where upstream’s is INVALID_ARGUMENT. An empty list clears the input and fires input and change (tester-army/e2e#1546 a8ed7f7); the web engine hands it to Playwright’s SetInputFilesAsync([]) unchanged, for a file input and for the chooser a button opens. UploadActions/ThroughTheLocatorTargetTests and ThroughTheElementTargetTests each add the clear it as one theory over the two targets (a file input, a button over a hidden input); LocatorActionOptions/LocatorActionOptionsTests adds the empty-list it and the blank-path it (its number-among-the-paths case is left out, as the C# types refuse it). The agent’s upload tool keeps refusing an empty list, as upstream’s authorizeUploadPaths does. The web engine’s UploadFilesAsync is upstream’s uploadFiles (web/src/actions.ts) with its isFileInput (PageScript.IsFileInput): a file input, or a node inside a <label> for one, takes the files directly, and anything else is clicked with the filechooser wait already attached, so a control that opens no chooser is NOT_ACTIONABLE (upload clicked the control but it opened no file chooser). The locator reports that as ACTION_FAILED, as for every other action (TranslateLocatorError, #846). The other engines refuse the action with UNSUPPORTED_CAPABILITY. The observation lists no node for a <label>, and folds its text into the hidden input’s name, so a test reaches a label’s control through an element inside the label. The agent’s upload tool (files, project-relative paths) and IExecutorActions.UploadAsync are upstream’s upload and its path policy authorizeUploadPaths (agent/upload-paths.ts), UploadPaths.AuthorizeUploadPaths: a path outside the project root (a symlink out too), a hidden file or one under a hidden directory is POLICY_DENIED, and a missing file, a directory, an empty or blank list, or more than 16 files (Trace.MaxTraceUploadPaths, upstream’s MAX_TRACE_UPLOAD_PATHS) is INVALID_ARGUMENT; the allow and each POLICY_DENIED refusal is an upload.path policy event (Phases.RecordPolicyEvent, with StepEvent.Decision; an INVALID_ARGUMENT records none, as upstream), the paths are authorized before the node is resolved and before a slot is taken, and an upload is recorded as upload with its Paths (templated with the call’s params) and authorized again on replay. The tool is offered when the engine declares EngineCapabilities.Upload (.NET-only: upstream lists upload in an engine’s verbs), and the web engine does. Differences: the typed policy takes a list, so upstream’s bare-string input is a null list; a replayed upload records no engine event (a replay records none for any verb); an unreadable path (an invalid character) is INVALID_ARGUMENT (.NET-only: .NET path APIs throw where Node’s do not); and the MCP catalog has no upload line. The upload tool name is reserved for project tools whatever the engine declares, as upstream’s GRAMMAR_TOOL_NAMES does. A refused upload (policy or bad files) spends no action slot, as upstream’s. A recorded path that replay now refuses spends none either. .NET-only deviation: upstream refuses a path that is no regular file by isFile(); the port refuses a directory or a missing path, but accepts a FIFO or socket on Unix. .NET has no public API for the entry type (File.Exists is true and FileInfo.Attributes reads Normal), and opening the entry to find out would hang on a FIFO. Tracked in #877. The upload tool words its result as upstream’s does, Uploaded "<path>" to #<ref>. and upload "<path>" to #<ref> failed: <code>: <message>, each followed by the screen, with the node’s ref where upstream has the id (.NET-only: the port’s node ids are refs). Every other grammar tool words its result as upstream’s acting does (see the act tools’ wording below). Tests: UploadPaths/AuthorizeUploadPathsTests is upload-paths.test.ts (its list-input it is Partial_, for the bare string; the symlink entry of the refusal it is left out where the platform cannot link); the two upload it of agent-act-verbs.test.ts are in AgentActVerbs/AgentActGrammarVerbsTests, and the upload line of its replay it is in AgentActGrammarVerbsRecordThenZeroTurnReplayTests (which lacks the hover and drag lines); UploadActions/ThroughTheLocatorTargetTests and ThroughTheElementTargetTests are the four it of upload-actions.test.ts for each target kind (locator and element; the port’s element is the observation’s node); the upstream test calls dispatchLocatorAction and classifyActionError, which the port has inside WebEngine.PerformAsync, so it acts through the session. The five new it of actions.test.ts are in Actions/DispatchLocatorActionTests: they drive a live page where upstream stubs the page, so the first two (Partial_Uploads_through_a_file_chooser_it_awaits_before_clicking_a_button and Partial_Sets_a_file_input_directly) do not check the order and the arguments of the page calls, and the unhandled-rejection it checks TaskScheduler.UnobservedTaskException. Controls/ControlsTests ports every it of controls.e2e.ts (the secondary tap, the long press and double tap, and the link attribute reads included; the link it reads the class through expect(browser).toHaveClass) including the three upload it (several files reach a multiple file input and the two for /controls’ avatar button). The locator refuses a hidden node, so a hidden file input cannot be targeted by itself (as upstream’s); the label or button over it is the target. The /controls page has upstream’s avatar button, hidden input, and output.
A web scroll is a wheel gesture, as upstream’s performViewportSwipe and performElementSwipe (web/src/support.ts): WebEngine.PerformViewportSwipeAsync wheels by SwipeDistance of the viewport’s extent (VideoRecorder.CurrentViewportAsync, upstream’s currentViewport), and PerformElementSwipeAsync reads PageScript.WheelAim (wheelAim): a node the pointer hovers takes the wheel where it is, one hit at its centre takes it there, and any other (or a node inside an iframe) is hovered first, which waits for it to be actionable and reports what intercepts the pointer. The extent is the node’s own box, not clientHeight. Both wait for a rendered frame after the wheel (PageScript.NextRenderedFrame, upstream’s nextRenderedFrame). A node that no scrollable ancestor takes the wheel from scrolls nothing, where scrollBy scrolled the node itself. The port keeps three quarters for a swipe that names no momentum; upstream’s is half (momentum ?? 'none'). back is the browser history.
Artifact store
Section titled “Artifact store”artifacts.store is IArtifactStore (upstream’s ArtifactStore, types.ts), with StoredArtifact and StoredArtifactLink. A store is code, so the config file cannot name one: call E2EConfig.WithArtifactStore (E2EConfig.ArtifactStore; a fixture and E2EHost.OpenAsync read it), set E2ESessionOptions.ArtifactStore, or override ArtifactStore on the fixture. The artifacts JSON key holds no store (INVALID_CONFIG, naming WithArtifactStore); it still exists so the removed kinds list and trace and video blocks fail with upstream’s hints (resolveArtifactStore’s removedRecordingReplacement), which name E2E_VIDEO where upstream names --video, and artifacts must be an object where upstream says { store }. Each artifact an attempt registers (a download, a video file, a screenshot or log the test attaches) is handed to PutAsync as it is produced, with its bytes, digest, redaction label, and the identity the report files it under (RunId, TestId, AttemptId, StepId, StartedAt), and the store’s reference is recorded as the record’s Ref. A store that throws, or returns an empty reference, leaves the record with its local path and no Ref; the run never fails for it. A provider-hosted video link goes to PutLinkAsync, which a store may leave at its default (no reference), as upstream’s putLink is optional; a passed attempt’s link under retain-on-failure is never handed over. Known gap: the automatic failure evidence (the failure screen text and the failure screenshot, written by FailureEvidence.CaptureAsync) is not registered through the sink, so a store does not receive it and it carries no Ref; upstream registers it.
ArtifactPaths.CreateAttemptArtifactsandAttemptArtifacts(SettleAsync,Records,Sink,Dir) are upstream’screateAttemptArtifactsandAttemptArtifacts(run/artifacts.ts),IArtifactSink,ArtifactRegistration, andArtifactLinkareArtifactSinkand its argument types (run/fixtures.ts), andArtifactIdentityis theidentityoption.REDACTION_BY_KINDisArtifactPaths.RedactionByKind.AttemptScope.Artifactsis the oneAttemptArtifactsof an attempt (the runner makes it in upstream), andAttemptScope.Attachedits records.- Differences:
PutAsyncreturns the reference string where upstream returns{ ref }, andPutLinkAsyncis a default interface member.ReportArtifactstays the port’s in-memory artifact, built from the sink’sArtifactRecords. The sink’s ids are<attemptId>:artifact:<n>, as upstream’s; the port’s failure evidence (its screen text and screenshot) is not registered through the sink yet, so a store never receives it, andApp.ScreenshotAsyncregisters its file with the running step (see App and browser fixtures). The session waits at most the cleanup timeout for them before it reads the records. A download’s text scan runs on the registering thread, up to the first await, so its label is on the record whenRegisterreturns. - .NET-only guards, which upstream lacks: (1)
E2ESession.SettleArtifactsAsyncstops waiting for the store at the cleanup timeout and logs it, then goes on to the report, because upstream’ssettleawaits every pendingputwith no bound and a hung store would hang the test (the store call itself is not cancelled; a lateRefis not in that report). (2)ExecuteVideo.Registerhands a video file to the sink only when it lies inside the attempt’s directory, because an engine’s video path is its own word and the sink reads the file’s bytes and hands them to a store; upstream registers every path. A file outside the directory is still kept inKeptand reported as a video, just not read or handed over. - .NET-only:
AttemptScope.Artifactsmakes the attempt’sAttemptArtifactson first use, andAttemptScope.CreatedArtifacts(internal) reads it without making it. Upstream’s runner callscreateAttemptArtifactsonce per attempt, which creates the attempt directory at once and keeps the returned object, so it needs neither. The port’s scope is built before it is known that anything is kept, and the report and the settle must not create an empty attempt directory for a passing attempt that keeps nothing.StoredArtifactLink.KindandRedactionare upstream’skind: 'video'andredaction: 'incomplete', defaulted since a link is always both. Output/ArtifactStorePutLinkTestsisdescribe('ArtifactStore.putLink')ofoutput.test.ts(bothit), through a session over a fake engine with a hosted link, since the port has no run:Partial_, they readE2ESession.Report()and notreport.json(no schema check, no run status, nocleanupfield). Not ported: thedescribe('output')tests of the same file, which are about the run’soutputdirectory.- Tests:
ArtifactStore/holdsartifact-store.test.ts:CreateAttemptArtifactsWithAnArtifactStoreTests(6it),ArtifactRedactionLabelsTests(2), andDownloadRedactionTests(8), throughCreateAttemptArtifactsas written.FilledSecrets/FilledSecretsTestsisfilled-secrets.test.tsthrough the real web engine, one session per test of its suite.Keeps_a_screenshot_after_a_filltakes the screenshot withApp.ScreenshotAsync. Partial:Downloads_without_a_fill_the_text_file_is_kept_as_served_PARTIAL(upstream declares the credential in the config, so the session scans a download it never filled; the port has nocredentialskey, so with no secret known the download staysincomplete). The executor’s fill is recorded as afillaction whose value is the secret’s marker (<secret:member.password>) where upstream’s entry has atypeSecretaction with asecretfield; both name the secret and carry no value.DownloadRedactionSessionTestsis .NET-only (the rescan, see Web engine).
video records an attempt on the web engine. The modes, their precedence, and E2E_VIDEO are under Config. This is the rest of upstream’s video.ts, provider-video.ts, attempt-session.ts (startVideo, collectVideo), and the video half of execute.ts.
IEngineSession.LocateAsyncis upstream’slocate(EngineSession.locate), with the flatLocatorExpressionrecord and the budget left as atimeoutargument. Core resolves a locator through it when the session saysCanLocate(.NET-only, transitional).WebEngineandDocumentEngineimplement it: each reads its semantic tree and resolves the expression over it with the core resolver, so a match is a node of that observation with the ref the page script minted. Upstream’s weblocate(surface.ts) projects the expression onto Playwright selectors (locators.ts), which the port’s page script replaces; the port resolves over the tree it already reads, so only theselectorandframeexpression kinds ask Playwright (see theBrowser.Locatorbullet below). The web engine reads under thetimeoutit is given (what is left of the wait, at least 500 ms), or the action timeout when that is shorter; the document engine answers at once and does not use it.LocatorExpression.IncludeHiddenis .NET-only:toBeAttachedandwaitForset it so an engine that resolves over its tree matches hidden role nodes, which they matched before the engine located; upstream’s Playwright has no such switch. A locate hands the trace the observation it read (TraceFeed.ShowScreen, andEngineStartOptions.Screenon the document engine), as core’sAgent.ObserveAsyncdid for the resolve it replaces; upstream’s weblocateshows none. A retryableEngineExceptionof the read (NODE_STALEduring a navigation) is now retried until the wait’s deadline, asresolveOncedoes. Any session that says noCanLocate(the WinApp engine, a scripted engine) has its locator resolved overObserveAsyncin core, as before.Screen.GetByTestIdon such an engine, and theLocatorResolverreaders of screenshot masks ande2e mcp, still resolve over the observation.- A web node that
LocateAsyncreturned as the only match of its locator stays strict, as upstream’slocate(surface.ts, #859) keeps the strict Playwright locator for a single match:PerformAsyncresolves the same locator again and, when a second element now matches, throws a retryableNODE_STALE(Node <ref> now matches more than one element. Observe again.) before any input, so the action acts on neither. Upstream gets this from Playwright’s strict mode; the port’s refs are page-script ids, soWebEnginekeeps the locator of each single-match node (_strict, .NET-only, keyed by the node instance a locate returned) and re-resolves it inRequireNoNewTwinAsync. A node the observation listed (it has the same ref), a node among several matches, and every match of a display-value or exact-label query (upstream pins those to the element handles it read) name their own element and are never stale for a twin. Differences: upstream counts the elements of the whole projected locator (reads.length) and the port the nodes its resolver returns; and the port has no webdragTo, so upstream’s drag case of #859 (ACTION_MAY_HAVE_COMMITTED when a drop target turns ambiguous after the press) has no port. - An observed web node’s element handle is made when an action reaches for it, as upstream’s
ElementListandRefRegistrydo (element-list.tsandrefs.ts, tester-army/e2e#1571; hardkoded/e2e-dotnet#1172).WebEnginekeeps each document’s elements in one in-page array behind one handle (ElementList, withFetchAsyncandAtAsyncfor upstream’sfetchandat) and publishes a generation ofListedTargets per observation throughRefRegistry(BeginCapture,Publish,LookupAsync,Clear,ReserveIds,MintId,StoreLocated).PerformAsynclooks a node up there; the list owns the handle, so the action no longer disposes it. A node whose element is gone, a document replaced since the walk, and a list released by the next observation are a retryableNODE_STALE. Differences: the port’s refs are the strings the page script stamps (e12) with no revision, soLookupAsynctakes a string where upstream’slookuptakes aNodeRef;ActionTargethas only the element kind (ElementTarget) because the port keeps no strict Playwright locator target, soStoreLocatedhas no caller outside the tests untilLocateAsyncstores its targets as upstream’slocatedoes (hardkoded/e2e-dotnet#1229); an iframe’s owner is still found from the page script’s ref, where upstream fetches the boundary element through the list; the walk still hands its elements to the page-side map thatRefsOrForcereads.RefTarget(the base of the upstream unionActionTarget | ListedTarget),ElementTarget(upstream’s{ kind: 'element' }literal), andWebSupport.DisposeQuietlyandDisposeWhenSettled(upstream’s inlinevoid handle.dispose().catch(...)) are .NET-only. So is the pin that keeps a list alive while an action uses it (RefRegistry.LookupPinnedAsync,ElementList.Pin,WebSupport.DisposePinWhenSettled): the port’s locator reads publish observations while a click runs, which upstream’srefs.storeLocatedavoids (#1229 removes the need). The port’s page script no longer hasFind: an action resolves its element from the list. Tests:ElementList/holdsunit/element-list.test.tsandintegration/element-list.test.ts(ElementListTests6it,ObservedRefsTests2,ElementListOnARealPageTests3) andRefsDisposal/LocatedElementRefsTestsholds bothitofrefs-disposal.test.ts, each as written. Browser.Locator(selector)andBrowser.FrameLocator(selector)are upstream’sbrowser.locatorandbrowser.frameLocator(browser.ts).FrameScreenis upstream’sFrameScreen: aScreen(soScreenis no longer sealed, though only the port can derive from it) whose every query goes through aframeexpression, withLocator(selector)andFrameLocator(selector)for a CSS or XPath selector and a nested frame. A locator of a frame screen canOr,Filter, and scope as any locator, sinceScreen.OwnLocatorcompares the attempt’s root screen (upstream compares the context).LocatorExpressionhas theselectorkind (the device’s, now the web engine’s too) and theframekind (Selectoris the iframe’s selector,Sourcethe scoped expression).WebEngine.LocateAsyncresolves them inWebSession.ProjectAsync, over the tree: Playwright says which elements a selector, or an iframe, names (WebLocatorsis upstream’slocators.ts, withFrameSelectors), the elements’ refs go to the resolver as arefsexpression (LocatorExpression.Refs, .NET-only, internal), and a frame scopes its queries to the iframe node’s descendants, where the walk hangs the frame’s document. Any element a selector names is a node, as upstream’s Playwright locator matches any element and itse2e-readengine reads it: when the observation does not list a match (html,body,head, a wrapper with no role, test id, or text of its own),LocateAsyncmarks it in the page and observes again, and the page script lists the marked elements as nodes (forcedinPageScript.Collect, .NET-only, withForcinginWebEngine). They get refs of that observation, stand in the tree where they sit in the document (soLocator("div").GetByRole(...)scopes to what is inside), and are not held to the node budget (a locator whose selector names many elements lists them all, as upstream reads them all); the walk also enters a leaf node (a button, a link) when a marked element is inside it. A poll of such a locator observes twice, and the next ordinary observation lists the tree as before. A marked element in a hidden iframe is still unreachable, and an element Chrome drops from the tree (inert) is not read. Differences: an iframe the page does not show has no node, so it isFRAME_NOT_FOUND(retryable) and its content is not reachable; a read that does not wait (Count,AllAsync,AllTextContentsAsync,IsVisible,IsHidden,toBeAttached,toBeVisible,toBeHidden,toHaveCount, a text list, andWaitForforDetachedorHidden) answers no match for a missing frame (MissingFrame.Empty, upstream’smissingFrame: 'empty'), and any other resolve polls for it until its timeout and fails withLOCATOR_NOT_FOUND(FRAME_NOT_FOUND) orLOCATOR_AMBIGUOUS(FRAME_AMBIGUOUS), as upstream’stranslateLocatorErrormaps them toLOCATOR_NOT_FOUNDandLOCATOR_AMBIGUOUS. AFilter(has)resolves inside each match, so a frame its locator shares with the source is the source’s; ahasfrom another frame fails withUNSUPPORTED_CAPABILITY. A frame selector must match aniframeorframeelement, else the frame is missing. A selector that captures with*before its last part fails withINVALID_LOCATORwhen the locator resolves; upstream finds out when its read selector returns nothing for the captured element, the port reads the spelling (WebLocators.RefuseCapture, which splits on>>outside quotes), and its message saysFilter(Locator)where upstream saysfilter({ has }).- Upstream’s
packages/web/tests/unit/locators.test.tsis ported in part (#1171).describe('frameSelectors')(bothits) isLocators/FrameSelectorsTests, overWebLocators.FrameSelectors. Not ported, because the port has no Playwright projection of aLocatorExpression(projectExpression,applyPostSteps,ProjectedLocator,PostStepinlocators.ts; extracting them is tracked in #1213): it resolves over the semantic tree (see the bullet above). The 13its ofdescribe('projectExpression')anddescribe('applyPostSteps')that #1171 lists, and the parameterizedit.eachofapplyPostSteps, all assert the chain of Playwright calls such a projection records, or the post steps it defers: projects an exact label query onto the label engine, narrows a visible query inside the selector for every kind, narrows a visible or role query inside a hidden frame to nothing, projects a testId query onto the configured attribute, passes role states and the heading level through to getByRole, spells the contract image role as the img role, the five displayValue position/filter/scope/has rules, projects a union onto Playwright or, and runs a filter step only on the matches the steps before it selected. The behaviors they stand for (visible, testId, role states, union, displayValue positions) are exercised end to end by the tests of the tree resolver. The test directory isLocators, soIsNodeVisibleTestsandTranslateLocatorErrorMappingTableTestsaliasE2E.LocatorEngineasLocatorEngineTypeinstead ofLocators. BrowserExpect.ToHaveClassAsync(locator, expected)is upstream’sexpect(browser).toHaveClass, onExpect.That(browser)andExpect.Soft(browser). A string is the whole class list, whitespace-normalized, and aRegexis tested against it. A locator with no match yet keeps it polling (observed: no node), a node with noclassattribute fails it (observed: no class attribute;class=""is an empty list), and several matches fail it at once withLOCATOR_AMBIGUOUS. The step’s label ispage, as the otherexpect(browser)matchers’ here, where upstream’s is the expected pattern.IEngineSession.StartVideoAsyncandStopVideoAsyncare upstream’sartifacts.startVideoandartifacts.stopVideo, andEngineCapabilities.Videois itsvideoartifact capability.EngineStartOptions.ArtifactsDirisEngineAttemptContext.artifactsDir: the attempt’s.e2e/results/<result>/attempt-<n>.WebEnginestarts the video once the attempt’s page is open, andWebSession(upstream’sAttemptSession) tells it when pages open and close.VideoRecorderandProviderVideoimplementIAttemptVideo(internal), upstream’sAttemptVideo.VideoRecorderwritesvideo/video.webmand, for later pages,video/video-part<n>.webm, each with itsStartedAt, from Playwright’sIPage.Screencast.StartAsync.ProviderVideoreturns the one segment the provider made: a file it wrote undervideo/(Kernel’sreplay.mp4) or aVideoLink. The first-frame wait is the sameFirstFrameWait(1 s).WebScreencastOptions(WebEngineOptions.Screencast) is upstream’sWebScreencastOptions;Sizeis aWebViewportand a size under 1 pixel or aQualityoutside 0 to 100 isINVALID_CONFIG. The oldweb({ video })key has no port, since the options are typed.- A browser provider that records is asked through
LeasedBrowsers.Recorder. Upstream leavesrecordout of a provider that cannot record, and the engine then records the screencast. A .NET provider is an interface, so it returns null fromRecordAsyncandProviderVideo.IsRecordingis false: the session then arms aVideoRecorderinstead. A page the app closes under aProviderVideoneeds nothing, as upstream. ExecuteVideo(internal) is upstream’sexecute.tsvideo code:PlanisvalidateEnginefor the one attempt a session is (UNSUPPORTED_ARTIFACTwhen a mode a target or a test set cannot be recorded by the engine; a config-root orE2E_VIDEOmode is skipped),StartAsyncis the video part oflaunchSession(a default mode fails quietly, a set one fails the start), andStopAsyncisstopVideo,closeSession, andregisterVideos(a video the mode does not keep for the verdict is deleted, a link that is nothttp(s)fails the cleanup after the other recordings are kept).E2ESessionstarts the video after the engine, finalizes it before the engine is released when the session is disposed, and reads the verdict from the errorCompleteis given: no error is a pass, aSkipExceptionis a skip. A required video that cannot be finalized makesDisposeAsyncthrow. The kept segments areE2ESession.Videos(internal); the port has no report to register them in.App.StartRecordingAsync/StopRecordingAsyncare upstream’sapp.startRecording/app.stopRecording(#1381), withRecordingOptions,RecordedVideo,RecordedVideoFile, andRecordedVideoLink(a class hierarchy where upstream has a union;StopRecordingAsyncreturns anIReadOnlyListthat is never empty, where upstream types a non-empty tuple).Recordings.csisrun/recordings.ts:SessionRecordingsshares the engine’s one recorder between the attempt’s video and the spans (Recordings.SessionRecordingsissessionRecordings; the extrarecordsVideoargument is .NET-only, since the port’s session always hasStartVideoAsyncand the engine declaresEngineCapabilities.Video). A span moves its files intorecordings/001-<name>.<ext>(-part<n>for later pages) and registers them; a span left running is stopped within the cleanup budget byE2ESession(upstream’sstopRunningRecording).WebSession.StartVideoAsyncarms the recorder again on a later start, as upstream’sstartVideodoes.FailureTextplaces a step in a stopped recording only until its stop step ends (TimedVideo, upstream’stimedVideos), viaReportArtifact.Producer. .NET-only hardening: a video path an engine returns that leaves the attempt’s directory fails the stop withENGINE_FAILURE. The App methods take a cancellation token, not upstream’s action-timeout bound, asScreenshotAsync. Not ported: therun_codesurface entries (mcp/code-surface.ts; the port has norun_code), and the serial-group stop of a member’s recording (the port has no serial groups). Tests:AppRecording/(AppRecordingsTests, all sevenitoftests/unit/app-recording.test.ts;AppRecordingsRunTests, the four oftests/integration/app-recording.test.ts, partial: one session each, no runner),Video/VideoRecorderTestsandE2E.Mobile.Tests/Engine/VideoTests(the added re-recordits), andReportFailureText/RenderTracePageTests(the recording-span offsets).- Differences: a test run has no
--videoflag (E2E_VIDEO, see Config;e2e explore --videois the flag itself), no run-wide check, and no notice, so a run-wide mode that an engine cannot record is skipped without one, and a retry mode with no retries says nothing.e2e explorehas both notices (see Explore). A session knows only its attempt number, not the test’s retries, soUNSUPPORTED_ARTIFACTis raised only when the attempt records, where upstream raises it before any test when some attempt would. xUnit v3 has no retry, soon-first-retryandon-all-retriesrecord nothing there. The test optionvideoandtest.describeoptions have no port (RecordingSource.Testis set by code that builds the session). A mode set on a test is not checked against a serial group, which the port does not have.MobileEnginerecords the device screen with agent-device (see Mobile engine); a device provider’s own recording (DeviceProvider.record) is not ported. - Tests:
Video/(video.test.ts,VideoRecorderTests, the nineit),ProviderVideo/(provider-video.test.ts, both),BrowserProvider/RecordingTests(the recording group ofbrowser-provider.test.ts, see Web engine),ProtectedAppOptions/WebScreencastTests(the firstitofdescribe('web({ screencast })'), partial: typed options have no fractional size or unknown key; “refuses the old video key, naming screencast” has no port),EngineContract/VideoArtifactsTests(describe('video artifacts'), all seven partial, session level, no report;describe('video capability and plan notices')is not ported, it needs the runner’s notices) and “surfaces UNSUPPORTED_ARTIFACT before any attempt…” inRunnerEngineContractTests(partial), andVideoModes/(video-modes.test.ts, partial: no runner, report, or serial group, so thewizardgroup is not run, and the modes are already resolved).E2ESessionCleanupTestsnow fails the start with a required video, since a bad results directory is refused before the engine starts.
Trace feed
Section titled “Trace feed”What the trace page shows about the app is collected as upstream’s trace-feed.ts collects it, and kept on the attempt’s step records. The page that reads it is described in Trace page.
EngineStartOptions.ScreenandEngineStartOptions.Environmentare upstream’sEngineAttemptContext.screenandenvironment.TraceFeed(Engine/TraceFeed.cs, internal) is upstream’s class: after an action,ScreenAfterActionAsynccaptures the screen like an observation without publishing it, so the refs a test or the model holds stay valid, within one second;TellEnvironmenttells the browser (chromium 141.0) and the page’s user agent once an attempt, without anyone waiting for it. The web engine builds the feed when the attempt starts. It hands the screen afterOpenAsync,BackAsync,PerformAsync,PressAsync, andSwipeAsync(upstream’sopen,back,perform,pressKey, and the viewport swipe), and tells the environment afterOpenAsyncandBackAsync(upstream’snavigating). Upstream’stypeTextand the point actions have no engine member here.- An attempt that keeps a trace (the same keep rule as the video:
attemptKeepof the resolvedtracemode) hands the engine aScreensink. An attempt that keeps none hands none, and takes no screen from what the test observes. The default mode,retain-on-failure, keeps one for every attempt, since the verdict is not known before the end. SessionScreens(Run/SessionScreens.cs) is upstream’sscreensofTargetSessionandEnvironmentFactsis itscreateEnvironmentFacts: a name told again overwrites, blank values are dropped, at most 8 facts, each redacted and then cut to 40 and 200 characters. The port has nocreateEngineSession, so they are classes of their own.AttemptScope.ObserveAsyncshows each observation the test, the screen fixture, and the agent take to the same sink.StepRecorder.RecordScreenandStepScreens.CompareScreensandTraceScreen(Run/StepScreens.cs) are upstream’srecordScreenandstep-screens.ts. A step keeps how the last screen it saw differs from the step before’s (StepRecord.Screen): the node lines added, removed, or changed, without node ids, 12 at most. Differences: the engine hands the port a typedObservation, soSessionScreenshas no check for a malformed snapshot ortreeUnavailable, and no revision to mint. The screen’s location is the route (/todos), not the whole URL, and a node that is hidden oraria-hiddenis left out, as the lines the model reads leave it out. The byte budget is the run’smaxObservationBytes, the largest any agent allows (262144 by default), as upstream’sconfig.limits.maxObservationBytes.E2ESession.Steps,E2ESession.Environment, andE2ESession.AppLog(internal) hold what the page reads.- The app log is collected apart from the feed, as upstream does it.
EngineStartOptions.AppLogandEngineStartOptions.Navigationare upstream’sEngineAttemptContext.appLogandnavigation, andAppLogEntryis itsAppLogEntry;AppLogSourceandAppLogLevel, the records’ enums, are public for it.AppLog.InstallandNavigationLog(Engine/AppLog.cs, internal) areinstallAppLogandNavigationLogofweb/src/app-log.ts. On every context the web engine configures, a persistent one too, it reports console output (errorandassertas errors,warning,logandinfoas info;debugand the rest are left out, and so is Chrome’sFailed to load resource:echo, which the network lines tell), uncaught errors, failed requests (one the browser cancelled is left out), and responses with a status of 400 or more (5xx an error, 4xx a warning, a missing/favicon.icoleft out). It tells where the page went:navigated to /checkout,the new tab navigated to /help,frame "pay" loaded /embed, andthe app opened a new tab at /help; the test stays on its page. A navigation the engine makes itself is not told, since its step says it:NavigatingAsync(upstream’snavigating) wrapsOpenAsyncandBackAsync, and alsoForwardAsync,ReloadAsync, andGotoAsync, as upstream wrapsbrowser.goto,reload,back, andforward. It also tells the environment, as upstream’snavigatingdoes. Differences: the console location is Playwright’sURL:line:columnstring, read to(at URL:line), and an uncaught error is the text Playwright gives (the message, then the firstatframe), where upstream reads the error’s name, message, and stack. - As upstream, a tab’s first document is told by its opening, a page that is not the test’s current page counts as a tab (so the test page’s navigation while
RestartAsyncreplaces it reads as a tab’s), and a request a test aborts itself (net::ERR_FAILED,ERR_BLOCKED_BY_CLIENT) is logged: only the browser’s own cancellations are left out. - .NET-only names:
StepHooks,E2ESession.PhaseandE2ESession.AppLog(internal),StepEvents(the step’s events, safe to read while the engine appends), andAppLog,NavigationLog, andAppLogRouteas the homes of upstream’sinstallAppLog,NavigationLog, andAppLogRoute. .NET-only tests:StepHooks/StepHooksTestsinE2E.TestsandE2E.NUnit.Tests.EngineStartOptions.AppLogandNavigationare for engine authors, asScreenandEnvironmentare; no user guide describes the engine contract, so the guides tell only what the trace page shows. AppLogRoute(Run/AppLogRoute.cs) is upstream’sAppLogRouteofTargetSession, built bycreateAppLogRoute(engine/session.ts), andAppEventandAppLogLimitsare itsAppEventandAPP_LOG_LIMITS. The engine reports from the moment it starts, before any step records, so what arrives before the recorder takes it waits: errors and warnings up to 200, info up to 100, navigations up to 50, so chatter never crowds out an error. An entry with a source or a level outside the enums, or a blank text, is dropped. The route is a class of its own, since the port has nocreateEngineSession.StepRecorder.RecordAppEventandAppLog()are upstream’srecordAppEventandappLog(): a line goes to the attempt’s app log with the step running in this async context, else the step that started last, redacted and then cut to 300 characters; where the app went is anavigationevent of that step, and one before the first step is told under it.- Step events, #443. A locator action records an
engineevent, upstream’srecordActionof the locator engine: the action, the node it landed on as the resolve read it (role and label, secrets redacted), andappeared after Nmswhen the node took more than one round to appear, andwent stale Nxwhen the node went stale under the action N times. An action that failed records its code.PressSequentiallyAsyncrecords noengineevent, where upstream’sperformUntilrecords itsfocus(the port’sPerformUntilAsyncrecords none, as for a swipe or a scroll into view); the actionselectOptionis namedselect, as the engine contract names it.RecordedTarget.TargetLabelis upstream’stargetLabel(cache/trace.ts). An assertion on a locator andWaitForAsyncrecord apollevent with the count of reads and, when the reading changed or the poll failed, the readings in order:SampleHistory(Expect/SampleHistory.cs) is upstream’s class (expect/samples.ts),RecordAsyncitsrecord. An agent step records the events upstream’sinstrumentPhaserecords (Phases.InstrumentPhaseAsync,agent/phases.ts;PhaseHost,PhaseSpec, andPhaseDetailfor itshost,spec, anddetail;PhaseDetailis .NET-only, since upstream’s is aPartial<StepEvent>; the port’sPhaseSpechas noapi, which upstream never reads). Every look the step takes is anobservationevent with the nodes it read and its size in bytes, as a model reads it, and a look taken inside an action is named:relocatefor the fresh look that re-finds a stale node,pagefor the look between the pages of a scroll. Every grammar action is anengineevent named for the verb (tap,doubleTap,type,typeSecret,press,selectOption,check,uncheck,scrollIntoView,scrollUntil,scroll,navigate,back; andclear, which upstream has no verb for), with the action it recorded as its detail, and a project tool is one namedtool:<name>(ActionNames.ProjectToolEventPrefix,agent/action-names.ts). A judgment records oneobservationevent for its look. Differences: the port’s action body commits and notifies inside the phase (the action is recorded and the test’sOnActionhook has run when the event ends), where upstream’s phase ends before it, so anengineevent also holds the settle look and the hook; themodelevents are recorded where each model call is counted (AddModelCall), so the model phase announces no activity; and there is noagent.cachephase orpolicyevent. - Agent step events, #648.
Observation.Revision(public, set by the harness; upstream’sObservation.revision) isb<n>for the attempt’s n-th capture throughAttemptScope.ObserveAsync, so an observation an engine hands a locator directly has none. A step records the revision of the last screen it read asStepRecord.ObservationRevision(StepAgentDetails.ObservationRevision), and the report writes it asobservationRevisionon any agent step that read one.StepAgentDetails.ObservationByteskeeps the largest observation inStepMetrics.ObservationBytes.Phases.RetryingObserveAsyncandPhases.CheckStepClockare upstream’sretryingObserveandcheckStepClock: the observation feed and the judgments (assert, extract) capture through the first and check the step clock with the second;waitForretries a race the same way and guards the capture with the step clock too (#775, upstream’sinvocation.observepassingguard: checkDeadline): a capture that outlives the deadline reportsSTEP_TIMEOUT(agent.waitFor exceeded its N ms timeout). Between judgments the wait maps that timeout ontowaitFor timed out; last judgment: ...with the step’s timeout as the cause, as upstream’swaitForNextJudgmentdoes; the first capture, before any judgment, keeps the bare message. Tests:AgentPhases/InstrumentPhaseTests,RetryingObserveTestsandCheckStepClockTestsport the threedescribeblocks ofagent-phases.test.ts;foreignEngineError(an engine from another module registry) has no .NET counterpart, so those tests throw the engine’s ownEngineException. The events and the revision are read in the ported tests ofagent.test.ts(thewaitForand repair cases),agent-act.test.ts(the executor step and the stale node),agent-vision.test.ts(observationBytes) and the secret-fill describe ofagent.test.ts(typeSecret). Not ported: thepolicyevents (recordPolicyEvent) and theobservationevent of a denied pixel fallback (agent-fallback-handoff.test.ts’sPOLICY_DENIEDobservation event), because the port has no pixel fallback. - The hook a step ran in, #443.
StepRecorder.Phaseis upstream’sphase, andE2ESession.Phase(internal) itsenter. Upstream’s runner entersbeforeEachandafterEachitself. The port has no runner: NUnit or xUnit calls the hooks. So whenPhaseis null,StepHooks(Run/StepHooks.cs, .NET-only) reads the step’s call stack. The first method outside the library that carries a mark decides: an NUnit[SetUp]isbeforeEach, a[TearDown]isafterEach, a[Test],[TestCase], or[Fact]is the body, and a test class’sInitializeAsyncorDisposeAsyncis the xUnit pair. A step called after anawaitinside a helper the hook called belongs to the body, since the stack no longer shows the hook.[Theory]and[TestCaseSource]are test methods too, andInitializeAsyncandDisposeAsynccount on a class that implementsIAsyncLifetime.OneTimeSetUpandOneTimeTearDownare not hooks of a test (upstream’sbeforeAllandafterAll), and their steps carry none. - Tests:
StepScreens/(step-screens.test.ts, all 11it; “hands every engine screen to the routed sink …” is partial, with no malformed ortreeUnavailablesnapshot to drop, and is named for what it checks),Traces/TracesTests(see Trace page),AppLog/(unit/app-log.test.ts, all 7it:StepRecorderRecordAppEventTestsandTheSessionAppLogRouteTests; “holds lines and navigations until a sink is routed …” is partial and named for what it checks, since a typed entry cannot have a source that is no source),WebAppLog/(web/tests/integration/app-log.test.ts, bothit, in Chromium;AppLog/is taken by the unit test of the same name; the server of upstream’s firstitdestroys the socket of/api/reset, which anHttpListenercannot do, so a route aborts that request and the line endsnet::ERR_FAILED),SampleHistory/(unit/sample-history.test.ts, all 6it), and the .NET-onlyTraceFeed/WebTraceFeedTests, which drive the web engine in Chromium, where no upstreamitdoes, andE2E.NUnit.Tests’StepHooks/StepHooksTests, which runs a fixture with a[SetUp]and a[TearDown]through NUnit and reads the trace page.
Trace page
Section titled “Trace page”Upstream’s --trace writes <output>/results/<result>/trace.md, a markdown page that tells the whole attempt: what failed and where to look, every step with what it did, the cache’s decisions, what the app logged, the agent’s last turns, the screen at failure, and what the attempt ran on. You open the file; there is no viewer. A test run has no --trace flag, so trace and the .NET-only variable E2E_TRACE choose which attempts keep a page (see Config); the default is retain-on-failure. e2e explore --trace [mode] is the flag itself.
- A session writes the page when it is released, after the video is stopped, the engine is closed, and the debug table and the AI trace are written, and before a required video’s failure is rethrown. It writes when an attempt of the test kept a trace, by
attemptKeepandkeeps(the rule the video follows), and the page then tells every attempt, see below. A page that cannot be written prints a line on stderr and never hides the test’s result. The page goes in the test’s directory under the results directory,.e2e/results/<result>/trace.md, beside theattempt-<n>directories, as upstream’s does. A session is one attempt, and each adds itself toRunReport(.NET-only,Report/RunReport.cs), which collects the attempts of a test: a first attempt starts the test over, a later one extends it. The page tells every attempt the test has had so far, as upstream’s does from the run report, and is written when any of them kept a trace (upstream’stracedResultIds). So a flaky test readsPassed after 1 failed attemptwith the last failure, and a test that failed every attempt readsFailed the same way on both attempts, even when the passing or last attempt kept none itself. The run keeps the attempts of a test only while it has not passed and the mode is notoff: an attempt that passed or was skipped ends the test and drops them. The port cannot know the last attempt of a test that keeps failing, since the adapters do not tell the session the retry count, so those entries stay until the process exits. Upstream’s runner holds every result of the run in memory too (const results: ResultRecord[] = []inrun/runner.ts), for its report. - The MCP server’s sessions set
tracetooff, so they write no page and take no screens: an MCP session is for looking, ande2e mcphas no--trace, as upstream. An exploration takes the target’s mode, or--trace; its own verdict gets no page. TracePages.WriteTracePagesAsyncandTracePages.TracePageare upstream’swriteTracePagesandTRACE_PAGE(report/traces.ts).FailureText.RenderTracePage(which reads the publicReport:TracePagesbuilds it from the document the run holds),ToldAttempt,FailedStepOf,AttemptsLine,FailureSource,EvidenceOf,DetailLines, andStepLabelare the matching functions ofreport/failure-text.ts, andMarkdownTextandReportFormatarereport/markdown-text.tsand the parts ofreport/format.tsthe page uses.ArtifactPaths.ResultSegmentisresultSegment(run/artifacts.ts; it also strips a.csextension). All are internal. The trace map ofFinishedRun.Traces(see Reporters) is what each session’s call toWriteTracePagesAsyncreturned, kept byReportFile.SetTracein the process’s state for the run and unioned over the tests; a first attempt that keeps nothing removes the page and its entry. Upstream’swriteTraceswrites the pages once when the run ends and the runner holds the map.Report1Document,ReportRun,ReportResult,ReportAttempt,ReportError,ReportArtifact,FailureEvidence, andOutcome(Report/ReportRecords.cs) are the part of upstream’s report the page reads, andAttemptReport.Build(Run/AttemptReport.cs, .NET-only) fills them from the step recorder, the environment facts, and the video segments of one attempt.ReportAttemptis upstream’sReportAttemptandAttemptViewin one, since the port has no serial groups. The file is the first step’s file (unknownwithout a step), the run id is one per process, and the title is the test’s title as one part.RunReport.Addjoins an attempt to its test’s result and derives the result’s status from the attempts (Flakywhen the final attempt passed after one that did not), where upstream’s runner keeps the result record andbuildReportreads it.- What the page tells: the title, the file, the status and duration, what the attempt ran on, the error (a fence in it cannot close the block),
Look at:, whether the attempts failed alike, every step (its label, duration, model calls, the video offset, the hook, the explanation of a failed one, the cache’s decision, the steps’ screenshots, and how the screen changed), the app log, the agent’s last turns, the screen at failure, other errors, and the evidence. Every piece of text goes throughMarkdownText(a mention or a URL becomes code, markup is escaped, a loopback origin is dropped), and the whole page goes through the attempt’s redactor again before it is written. - Not filled by the port yet, each with its issue. The renderer shows them when a record carries them, and the tests build such records by hand. A serial group’s members: the port has no serial groups. Filled since: the agent’s turns of a step (#481), the step events, the hook, and the app log (see Trace feed), and what became of a step’s recording with the model that recorded it (see Trace page).
- Recording outcome.
E2ESession.Flushis upstream’ssettleStagedTraces: it returns aCacheWriteper step index, and the session setsStepRecord.CacheWriteon each step that carries cache detail. A step decides two itself when it concludes:Evicted(a passed step anend-mismatchhand-off had to repair) andNoChange(the step changed nothing a replay could check and read no entry; one that read an entry is evicted at the settlement instead). The settlement reports the rest:Saved,Kept(the replayed entry, or one holding the same flow, which ignores the recording model),Unconfirmed, andEvicted(an entry the step read that the settlement deleted: a whole replay no check confirmed, a replay that ended in a failure, or an entry the step read and replaced with nothing). A flow the step recorded anew isUnconfirmedwhen no check confirmed it, whether or not an older entry was deleted, as upstream’ssettleStagedTracesreports it (only an entry replayed whole isevicted). Both reportEvictedonly afterIStepCache.Deletereturned, as upstream’sevictandsettleStagedTracesdo since689620d(#1072).IStepCache.Deletereturns when the entry is absent and throws when deletion fails, as upstream’sCacheStore.deletedoes, andFileStepCache.Deleteignores only a missing file or directory, as upstream’sFileCacheStoreignores onlyENOENT. ADeletethat throws leaves the entry in place:E2ESession.FlushreportsUnconfirmedfor a whole replay or a new recording and nothing for an act that recorded nothing (upstream’sevictstages nothing then), andStepTraceSession.ConcludeAsync(upstream’sevictfor a repairedend-mismatch) stages no decision. Upstream also evicts a failed step’s consumed replay inconclude; the port does both at the settlement, so a deleteConcludeAsynccould not make is tried once more there. Tests:StepCache/StepTraceSessionTests“does not stage an eviction outcome when deleting a consumed entry rejects” and the threeitoftrace-cache-config.test.tsinTraceCacheConfig/FlushStagedTracesTests, the default-store one a no-op as root and on Windows, as upstream.NotWrittenis a store whoseWritethrows or returnsnull(as upstream’swritereturningundefined: aFileStepCacheover its byte cap, or not writable);StepCache/FlushPipelineTests“says a confirmed recording the store did not write was not written, rather than saved” ports upstream’sitover a 16-byte cap. Unlike upstream, a cancelled attempt reports none, since it never settles. The page tells the model after the cache decision:recorded with `fake-loop/model-A`.CacheEntry.RecordedByandCacheInfo.RecordedByare upstream’srecordedBy, but one string,IAgentModel.Name, which spells provider and model id together (upstream’s is aproviderand amodel). The recorder redacts it and drops one that is blank or past 300 characters, and a read does the same, so a malformed one never makes an entry a miss. It is the agent’s configured model, which an executor’sModelbecomes when the agent sets none; an agent with none records none. It never keys the entry. The port has no list reporter, so therecorded withnote on a list line has no port;cache.recordedByandcache.writeare inreport.json(see Report document). Tests:CacheModelProvenance/holds bothitofcache-model-provenance.test.ts, each partial: they read the step record, the entry file, andreport.json(checked against the schema), not the list line ortrace: 'on', and the malformed cases are one string (the nine cases of the first are seven). The second is also partial where an executor reports no model: upstream’s report names the executor, the port’s saysunknown.StepCache/CacheWriteTests(.NET-only) covers each outcome.TraceRecorderTestshas the two oversized cases as one theory, the blank cases as one theory, and the redaction in “records a secret fill by name only”. The twoitoftrace-cache.test.tsthat read a bounded or blankrecordedByare covered by theoversized-model,blank-model, andinvalid-modelcases of the first test. - Semantic evidence in the replay (
step-cache.test.ts,describe('StepTraceSession'),describe('recordedVerdictOf')).IReplayHost.TraceEligibleis upstream’sReplayHost.traceEligible(it was onIStepCacheHost), andReplay.ReplayTracechecks it before each recorded action and stops withaction-failedonce it is false, as upstream’sreplayTracedoes;VerifyEndStateandPollSettledreturn false once it is false, as upstream’s do;IStepCacheHostinherits it. Tests: the threeitof an observation that loses semantic evidence are inStepCache/StepTraceSessionTests; the port reads no pixel-only screens, so the test host flipsStepHost.TraceEligiblewhere upstream’s look returns pixels.StepCache/RecordedVerdictOfTestsis partial (Partial_): the port’s entries record no verdict and its replay answersReplayed recorded actions., so the test passesStepTraceSession.RecordedVerdictOfthe summary upstream builds (replayed N recorded action(s) zero-turn from the trace cache; recorded verdict: ...) instead of reading it off a session (#1281). - Error details.
ErrorDetails(E2EException.Details, public) is upstream’sErrorDetailsofinternal/errors.ts, with the same fields in C# casing:Locator,Expected,Observed,Matches,Role,Name,TestId, andWaitedMs. A locator that matched nothing (LOCATOR_NOT_FOUND) carries the locator as written, what it asked for, and how long it waited. One that matched too much (LOCATOR_AMBIGUOUS) carries the same without the wait and withMatches. AwaitForthat timed out carries the wait. A locator matcher that failed carriesLocator,Expected(withnotwhen negated),Observed, andMatches, andToHaveScreenshotcarries the stored screenshot’s path asExpectedand what it observed.LocatorResolver.LocatorDetailsandLocatorExpression.ExpressionHintsare upstream’slocatorDetailsandexpressionHints.ErrorSerializer.Serializekeeps the details as upstream’sserializeErrordoes: text redacted, stripped of control characters, cut at 2 KiB, empty text dropped. The port has no report boundary, soErrorRedaction.Failurealso redacts the details text when it builds the error.Screen.ScrollUntilVisibleAsyncsets them too, on itsLOCATOR_NOT_FOUND. Upstream sets details in one more place the port has no feature for: a tap at a point. Not ported: the details of an error classified from another module copy (there is one copy of an assembly). - Failure evidence.
FailureEvidence.CaptureAsyncis upstream’scaptureFailureEvidence(run/failure-evidence.ts), with its options, its 5 s budget for the observation and the screenshot together, its limits, and its scoring of the nodes closest to what a locator asked for. A failed attempt that keeps a trace page looks at the app once more and keeps the screen asattempt-<n>/screen-at-failure.txt, one#id role "name" text="…" [states]line for each node (indented by depth, hidden nodes left out as the lines the model reads leave them out, a node with no role read astext), a masked screenshot asattempt-<n>/screenshots/failure.png, the location, and for a locator that matched nothing or too much, up to five candidates. The page shows them under## Screen at failure. The look is taken once per attempt, the moment the test body fails, ahead of the test’s own teardown (upstream’scaptureEvidence, called after the body, the late soft failures, and the settled callbacks, and again after the teardown for a failure that first landed there).E2ESession.CaptureFailureEvidenceAsyncis that look, and an adapter calls it: the NUnit adapter wraps the test method (IWrapTestMethod, sinceITestActionruns after[TearDown]) and looks when the body throws or anExpect.Softfailed; the xUnit adapter looks from aBeforeAfterTestAttributeafter the test method, when the result isFailed. A failure that first lands in the teardown is looked at when the session is released, as upstream does. Differences: an xUnitExpect.Softfailure is kept on the session until the test is disposed, so it is looked at then, after the test’s ownDisposeAsync(closing the soft failures early would move them out of the test’s result). An attempt whose trace page is not kept looks at nothing. The screenshot is dropped when the attempt knows a secret (as every pixel the port keeps; upstream keeps its masked failure screenshot), when the look at the screen failed, and when the engine does not report that it covered a region for each secure node. The viewport is the screenshot’s size in viewport pixels, since the port’s observation has none, so it is absent without a screenshot. When the look fails (a crashed page, a closed app) there is no evidence, not the last screen a step saw. The candidates are listed for the codesLOCATOR_NOT_FOUNDandLOCATOR_AMBIGUOUS. - The footer points at
report.json(“the whole run is inreport.json”), as upstream’s does, unlessTracePageOptions.Standaloneis set (upstream’sstandalone, forHostTrace.WriteHostTraceAsync’s page). Differences: the page has nosourceUrlorartifactsUrllink. An attempt that did not skip but carries a skip (a test that calledSkipand then failed on a soft failure) names it on its page afterLook at:, asAlso skipped: <reason>.lastTurnLinesandscreenLinesbelong to the run page and are not ported.HostTrace.WriteHostTraceAsync(internal,Run/HostTrace.cs) is upstream’swriteHostTrace(run/host-trace.ts): it writes one attempt’s standalone page atTracePath(redacted) and returns the typedReport. Its options (HostTraceOptions) take the attempt’s report (AttemptReport.Build’s document), the project root, the results directory, the attempt’s path segments, the trace path and the redactor, where upstream takes the config, target, run id, test id, title, agent and anAttemptRecord, which the port’s attempt report already holds. A hosted session (E2EHost, Hosted sessions) calls it when it closes, and returns its report fromReport(). A session of a test framework writes its page throughTracePages(every attempt of a test on one page) and buildsReport()fromReportFile.SingleAsync. - .NET-only names:
E2ESession.Evidence(what the session captured; upstream reads it from the report),E2ESession.CaptureFailureEvidenceAsyncandE2EFixture.CaptureFailureEvidenceAsync(upstream’s localcaptureEvidenceclosure; the fixture’s is for the adapters),LooksBeforeTeardownAttribute(NUnit and xUnit; internal), NUnitE2ETest.CaptureEvidenceOf(internal; reaches the protected fixture method), xUnitE2ETest.LookAtFailureand itsRunningmap (the attribute is handed the test, not the instance),FailureEvidence.ScreenFile,ScreenshotFile,ScreenArtifactId, andScreenshotArtifactId(upstream registers the files with its artifact sink),FailureEvidenceOptions.ObserveandCapture(upstream hands the open session),AttemptReport(and itsResultIdandResultSegmentOf, which give the result id and directory name; a .NET test has no one source file, so the test class stands for upstream’sfile: the fixture passes its full name asE2ESessionOptions.TestFile, it joins the title in the id hash as upstream’stestIddoes, and its simple name leads the segment; a session started with noTestFile, such asexploreor a directE2ESession.StartAsync, hashes the title alone),AttemptReport.TestIdandEncodeTitle(internal; upstream’stestIdandencodeTitleininternal/ids.ts, with a title path of one title; the title is percent-encoded so a::in it cannot pass for the separator; the hash input carries a NUL mark so a title-only session cannot share an id with a test id),E2ESessionOptions.TestFile(public, optional; the one new member of the public API, set byE2EFixture, so the NUnit and xUnit adapters change nothing),TraceOutput,WriteTracePagesOptions,ReportResult.Directory(an attempt writes underArtifactPaths.ResultSegmentof the result’s id and title, so two titles that slug alike keep apart; the segment leads with the test class’s name when the fixture started the session, and the page goes in that directory),StepRecorder.AddModelCall(upstream’susage.recordinStepAccounting),FileStepCache.CacheDirectory(internal), andCacheInfo.Entry(upstream’sentryofStepCacheInfo),OptionalTextConverter(upstream’sreadRecordedModeltolerates a malformedrecordedBy; the port’s is a string, which a converter reads leniently),PendingAct.Decided(upstream’sdecidedstaged entry), andCacheInfo.WithRecordedBy(upstream spreadsrecordedByinto the info). - Tests:
OpenHostTrace/OpenHostTraceTestsisopen-host-trace.test.ts’sdescribe('openHost: trace'), bothitpartial (Partial_names), throughE2EHost: the video one (it.each(['failed', 'passed'])) runs on the real web engine, and the safe-pages one has nogadget.dropFilecall, no config secret an engine resolves (the secret is the session’s own), and one results directory for its two same-titled sessions. .NET-only:Writes_a_standalone_page_and_returns_the_report_of_the_attempt(HostTrace.WriteHostTraceAsyncalone) andHosted_session_writes_a_standalone_page_even_when_the_trace_mode_is_off. - Tests:
Traces/holdsunit/traces.test.ts(all 11it:WriteTracePagesTests,TracePageNamesTests,TheStepsOnATracePageTests,TheAppLogOnATracePageTests, over hand-built records) andintegration/traces.test.ts(TracesTests, all 6it, in a session over a fake engine, with no runner). InTracesTests, “keeps each step’s events, files what the app logged …” is named for the part it checks,Keeps_each_steps_events_and_files_what_the_app_logged_under_the_step_it_happened_in_on_the_page(partial: it reads no run event, which the port has no run to emit); the two “names the step … on the page and in the summary” tests are partial (no summary reporter); “keeps the traces the mode asks for” runs sessions with the attempt number in place of a runner’s retries.ReportFailureText/holdsreport-failure-text.test.ts:detailLines,attemptsLine,failedStepOf,failureSource,evidenceOf, andrenderTracePage(15it; the footer of “tells the whole story” has noreport.jsonpointer). Not ported from that file: “lastTurnLines and screenLines” (the run page), and “a serial member on its page” (no serial groups)..NET-only:TracePageRedactionTests.FailureEvidence/holdsfailure-evidence.test.ts(FailureEvidenceTests, 6 of its 7itinE2E.Tests, in sessions over a fake engine; theit.eachis one theory). “looks at the screen before teardown runs …” isE2E.NUnit.Tests/FailureEvidence/FailureEvidenceTests(through NUnit, with a[TearDown]in place ofafterEach), so all 7itof the file are ported, with a .NET-only soft-failure variant beside it; the xUnit adapter’s look has no test project. “keeps the evidence of two tests whose ids sanitize to the same directory name apart, each report digest matching its file” isKeeps_the_evidence_of_two_tests_whose_titles_slug_alike_apart(partial: the port’s report artifacts carry no sha256 to compare).Keeps_the_evidence_of_two_tests_with_one_title_in_two_classes_apartandGives_a_title_with_a_separator_in_it_another_id_than_the_same_text_split_into_file_and_titleare .NET-only (upstream’s runner rejects a duplicate test id; the port keys on the class instead of the file).Errors/ErrorDetailsTestsholds theerror detailstests ofunit/errors.test.ts: two of three, the redaction one partial (the port keeps no stack text), and not “keeps the details of an error classified from another module copy”. The details of the failure are asserted inScriptedMatchers/,ScreenshotAssertions/, andAgentExecutorContext/where upstream asserts them, and the failure capture beside an assertion’s own screenshot inAssertEvidenceUnderACustomExecutorTests. - The markdown page.
MarkdownReport.RenderMarkdownReport(Report, MarkdownReportOptions)is upstream’srenderMarkdownReportandMarkdownReportOptions(report/markdown.ts, as of1d671f6). Both are public (E2E.Reports), as upstream exports them (tester-army/e2e#284,8811ba7), and the function takes the publicReporta reporter receives asFinishedRun.Report, as upstream’s takes itsReport; the GitHub reporter (#745) calls it: the headline with the counts, the spend line, the run-level errors, a block per failed test, the flaky tests folded, the--repeat-eachtally, the test filters’ lines and left-out table, every test folded as a table with a row per file, the footer, and the exploration record in place of the table. The renderer reads only the publicReporttree. It does not take the in-memoryReport1Document, soFailureText,Outcome, and the other helpers moved onto the public records (ReportStep,ReportResult,ReportAttempt,ArtifactRecord,StepCacheRecord) with them; the trace page is rendered from the same tree (TracePagesreads the document the run writes back into aReport, asHostTracedoes), so one reading of a report serves both. Its helpers are upstream’s:Repeats(report/repeats.ts:RepeatGroups,RepeatSummary,RepeatLine),FailureText.SourceText,LastTurnLines,ScreenLines,AppErrorsOf, andAppErrorLines(report/failure-text.ts;AppErrorsOfalso has a .NET-only overload over the run’s ownAppLogRecord, for the live list reporter), andReportFormat.FormatTokens,FormatCost,ShortCommit,StatusBucket, andTally(report/format.ts;Format.FormatTokensandFormatCostinE2E.Clinow call them).ReportResult.SkipandReportResult.TestIdare upstream’sskipandtestId: a test the selection left out has no attempt to carry its skip.FailureText,ExploreText, and the other helpers are internal. Differences: upstream’smarkdownReporter(thesummary.mdwriter) and its threeitare not ported, since the port has no reporter extension point; the port has no serial groups, so the page reads each result from its own attempts; a run with no finish time reads as instant. An exploration finding’s evidence is found among the run’s artifacts by itsArtifactId, which the exploration sets to the id of the screenshot artifact it registered (#958), so the finding links its screenshot when a result carries an artifact with that id;report.jsonwrites and readsartifactIdon a finding (the schema has it, and the page needs it from the publicReport). Tests:ReportMarkdown/holdsunit/report-markdown.test.ts(RenderMarkdownReportTests,RenderMarkdownReportForAnExplorationTests,RenderMarkdownReportEvidencePathsTests,AnInterruptedRunTests,ARunTestFiltersNarrowedTests;Partial_Leaves_a_result_the_selection_did_not_choose...andPartial_Tolerates_a_document_written_before_results_carried_repeat...check the half a typed record can hold; the tests build their input as the in-memory document and render the publicReportread back from its wire form,ReportBuilders.Public), andReportRepeats/holdsunit/report-repeats.test.ts(RepeatTallyTests, bothit). Not ported: the two serial-groupit(“reads a serial member from its group…” and theit.each“tells a serial member from its verdict when a %s retry was cut”) and the threemarkdownReporterit.
Test filters
Section titled “Test filters”Upstream #1206 (da13624, feat(runner): run only the tests a pull request can affect) adds filters to the config, --changed-since <ref> on e2e run and e2e list, and the “left out” part of the report. #1345 (47127f7) adds context.configFile. The port has no runner, no collect or select, no e2e run or e2e list, and no reporters other than the JSON report, so it takes the filter seam, the change detection, and the report fields, and wires them into the run fixtures. A test framework selects tests itself (dotnet test --filter), and the port keeps no list of every test before the first one runs, which a filter needs, so the run fixture of each adapter finds the tests by reflection and hands them to the filters (see Wiring).
Ported:
ITestFilter(upstream’sTestFilter:Name, andFilterAsyncforfilter),TestFilterCandidate,TestFilterChanges,TestFilterContext(withConfigFile, #1345), andTestFilterResult(Exclude,Note) are public (Run/TestFilter.cs, upstream’stypes.ts). A host calls the internalTestFilters.ApplyTestFilters(Run/TestFilters.cs, upstream’srun/test-filters.ts) with its candidates: filters run in order on the tests the ones before kept, a filter that throws, returns an invalid result, or runs past 5 minutes (FilterTimeout) leaves nothing out with a warning, and reasons, notes, and log lines are redacted and cut to one line of 1024 code points.context.Redactalso masks every run of 8 or more characters of a secret.TestFilters.RepoConfigFileis upstream’srepoConfigFile,TestFilters.FilterRecordsandFilterSummaryarefilterRecordsandfilterSummary, andLeftOut.LeftOutTestsisleftOutTests(Report/LeftOut.cs,report/left-out.ts).- Filter validation (
ResolvedConfig.ResolveTestFilters,Config/ResolvedConfig.cs, upstream’sresolveTestFiltersandMAX_FILTER_NAMEinconfig/resolve.ts;HostTestFilters.Resolvecalls it): the list in declaration order, empty when unset; a null item isfilters[i] must be a TestFilter: { name, filter(tests, context) }; a name outside the target name rules (E2EConfig.ValidName, upstream’sTARGET_NAME_PATTERN), over 256 characters (clipped to 31 characters and…in the message), or used twice isINVALID_CONFIGwith upstream’s wording. Differences: upstream’s refusals of a value that is not a list, of a function in the list (call it, such as filters: [decisionFilter({ model })]), and of an item without afilterfunction have no port, since the list andITestFilterare typed; upstream’s “leaves the config digest alone”itis ported throughHostTestFilters.Resolve, whoseConfigDigesta filter never changes. Tests:Config/FiltersTestsisdescribe('filters')ofconfig.test.ts(the item check isPartial_). --last-failed(tester-army/e2e50fa7af,run/last-run.ts,run/runner.ts): the run fixture’sprotected virtual bool LastFailed(false; else theE2E_LAST_FAILEDvariable set to1ortrue) islastFailedof the run options.HostTestFilters.ExcludeAsyncreads the previous run’sreport.jsonwhere this run writes its own (LastRun.ReadLastRunAsync, upstream’sreadLastRun; none isNO_LAST_RUN, with upstream’s wording), selects withLastRun.LastFailedIds(lastFailedIds: failed, timed out, interrupted, skipped by a setup, a predecessor, a hook, the worker or a limit, and the tests carried from an earlier run), and a test the previous run did not fail skips itself withdid not fail in the last run. As upstream, the filters run only when a base ref is also set, and then without asking (changes.skippedis--last-failed). The report this run writes carries what the previous run owed and this run did not run (run.carried,LastRun.CarryForward, upstream’scarryForward) until a session runs it, andFinishedRun.LastRunhands the previous report to the reporters. Differences, all .NET-only: a run with nothing owed skips every test instead of endingNO_TESTS, as the filters’ empty result does; a result’stestIdis the test’s class and method (AttemptReport.TestId(className, method), the same for every row of a parameterized test), so the host finds a test it discovered by reflection again;PreviousRunholds the typed report with the JSON it was read from, socarriedis written from the previous document’s own JSON;RerunCollection.UncollectedFilesis always empty (reflection collects every test); the port has no serial groups. Not ported:previousFileDurationsandfileDurationKey(they order the files of a parallel run, and the test framework owns that order), and--repeat-each. A rerun starts from the tree the report it reruns names, and files its attempts apart (#1003):HostTestFilters.ExcludeAsyncprunes the results directory down toLastRun.ReportArtifactPathsof the previous report (ArtifactPaths.PruneArtifactsAsync, upstream’spruneArtifacts, withreportArtifactPaths; the carried results’ files stay too) and takesArtifactPaths.NextRerunDirAsync(nextRerunDir):rerun-<n>, past every number any test’s directory holds.HostSelection.RerunDircarries it, the run fixtures hand it toHostRun.RerunDir(.NET-only: upstream’s runner passesrerunDirto its workers),E2EFixtureputs it onE2ESessionOptions.RerunDir, and the session files its attempt at<test>/rerun-<n>/attempt-<n>(ArtifactPaths.AttemptSegments, upstream’sattemptSegments), so a passing rerun no longer deletes the video of the failed attempt it reruns. The trace page stays in the test’s directory. Differences: a full run does not clear the results tree (the port has no runner to own the output, and the test framework may run several processes on one output), so only a rerun prunes; a failed prune fails the run’s start with the exception, where upstream records alaunchrun error. Tests:LastRun/ReadLastRunAndLastFailedIdsTests(the 6itof thatdescribeintests/unit/last-run.test.ts) andLastRun/CarryForwardTests(9 of its 10it, theitthat readscarriedback included;names every artifact file a report points at...isPartial_, without the serial group’s files; not ported:carries a serial member's group..., no serial groups), andRerunArtifacts/PruneArtifactsTestsandNextRerunDirTests(rerun-artifacts.test.ts), whole; not ported:describe('previousFileDurations').LastRun/LastFailedRunTestshas twoPartial_ports that ask the host’s selection where upstream runs the runner twice:runs only what the previous run did not pass under --last-failed, and needs a report to read(runner-lifecycle.test.ts) andreruns what --last-failed owes without asking the filters...(test-filters.test.ts); the rest of that file is .NET-only. Not ported fromrunner-lifecycle.test.ts(they need the runner):runs every selected test n times under --repeat-each...,stops at maxDuration...,an interrupt reports every test it never started...,a run-level model failure reports every queued test...,--last-failed runs a failed hook's scope again...(the port has no suite hooks), and--last-failed keeps owing what the failure limit or another filter left out...; fromoutput.test.ts: none of the artifact-tree cases is whole;Output/OutputTestshas them asPartial_(clears the artifact tree when a run starts...andkeeps the evidence a --last-failed rerun folds in...: the host’s selection stands for the runner, and no full run clears the tree).- Wiring (#913; NUnit and xUnit v3; .NET-only, since upstream’s host applies
filterSelectionto the collected files anddotnet testhas no collection step):E2ERunFixture(E2E.NUnit, andE2E.XUnit.V3, which is no longer sealed and is anIAsyncLifetime) gainsprotected virtual IReadOnlyList<ITestFilter> Filters(empty),ChangedSince(null; else theE2E_CHANGED_SINCEvariable, as upstream’s--changed-since), andConfig. Its[OneTimeSetUp](xUnit v3:InitializeAsync, so a derived fixture is registered with[assembly: AssemblyFixture]) finds the assembly’s tests by reflection (RunSelection.Discover), andHostTestFilters.ExcludeAsync(internal, inE2E, framework-neutral) collects them into aCollection, runsSelector.SelectandTestFilters.FilterSelectiononce, and returns aHostSelection: the left-out tests with their reasons, a skipped result for each,run.filters, andrun.changes.E2ETest’s[SetUp]ends a left-out test withAssert.Ignore(reason); the xUnit v3E2ETest.InitializeAsyncthrows xUnit’s dynamic-skip exception (a message that starts with$XunitDynamicSkip$) before its session starts. xUnit v3 tests are[Fact]and[Theory]methods (notExplicit; aSkipwithSkipUnlessorSkipWhenis conditional and still judged), andTagsare theTestCategorytrait values of the method, its class, its enclosing classes, and the assembly.HostTestFilters.WriteReportAsyncputs the outcome inreport.jsonthroughReportFile.WriteLeftOutAsync(.NET-only: upstream’s runner builds the report once, and a left-out test starts no session that would add its result): each left-out test is askipped,selected: falseresult withskip: { cause: "filtered", reason, filter }and no attempts, its id the hash of its test id, its file the layout guess, and its target the config’s until a session runs, whose target (a fixture can run on a target of another name) replaces it, so the report keeps one target. The report is written when a base ref is set and the filters had a say, also when every test is left out. The mobile and Windows adapters (MobileAppTestandWinAppTest, NUnit and xUnit v3) derive fromE2ETest, so discovery and the left-out skip apply to them unchanged (#965). The xUnit v3MobileAppTest.InitializeAsyncchecksRunSelection.SkipIfLeftOutbefore it leases a hosted device, because the base class skips the test only after that lease (E2E.XUnit.V3makes its internals visible toE2E.Mobile.XUnit.V3). The NUnitMobileAppTeststill leases the device in its[OneTimeSetUp], once per run, even when every test of the fixture is left out; its[SetUp]that installs the app runs after the base[SetUp], so a left-out test never installs. With no base ref, no filter runs. A one-targetResolvedConfigis built fromE2EConfig(HostTestFilters.Resolve; the port has no resolver). A test’sFileis a layout guess,<TypeName>.csin folders that follow the namespace, found under the project root, since reflection names no source file; it is wrong when a class lives in a file of another name. A test’s id isAttemptReport.TestId(file, "<Type> > <method>"), a parameterized method is one test, andTagsare[Category]values of the method, class, enclosing classes, and assembly. - The select layer (upstream’s
collect/select.tsandcollect/collect.ts), internal, called by the run fixtures throughHostTestFilters:Selector.Selectisselect(the class is .NET-only, since a C# member cannot share its type’s name) withSelectionFilters(tags,tagMode,excludeTags,grep,grepInvert,lastFailed,shard,excluded,targetIds),Selection,TargetSelection,TestTargetPair,SkipInfo,Shard,TagMode, andSelectTargets. It applies.only, tags,grep,lastFailed(withwithSetupConsumers), the serial closure,--shard, the filters’ exclusions, and session selection as upstream does, andTestFilters.FilterSelectionandFilterCandidatesarefilterSelectionandfilterCandidates(BuildReport.CompareTestsiscompareTests,Ids.ResultIdisresultId,Suggestions.SuggestionNoteissuggestionNote).CollectedTest,CollectedFile,Collection,UncollectedFile,GroupNode,TestMode,ResolvedTarget,ResolvedConfig, andResolvedTestOptionshold only what these read. Differences: nothing collects yet (a .NET test framework does the collecting, so a host would discover tests by reflection), so aCollectedTestcarries its resolved options (Options, .NET-only) where upstream’sresolveOptionsderives them from the group chain and the config;ResolvedEngine(.NET-only) is the slice of upstream’sEnginethat grading reads; aCollectionErroris aConfigurationExceptionwith the codeCOLLECTION_ERROR;describeNoTestskeeps the “collected but none is runnable” summary, and has no glob, near-miss, or positional branch (the collection holds none);repeatEachandresolveOptionsare not ported. Changes.FindChangesAsync(Run/Changes.cs, upstream’sfindChanges): every file that differs from the merge base of the ref and HEAD, staged, unstaged, deleted, and untracked files included, a rename as both paths, sorted by code point, with a 30 second budget. A ref git cannot measure from isINVALID_CHANGED_SINCE(aConfigurationException).Git.RunGitAsync,GitResult, andGitFailureare upstream’srunGit,GitResult, andGitFailure;Paths.OnDiskPathisonDiskPath;Time.BudgetTextisbudgetText;ReportFormat.FilterDecisionisfilterDecision.- The report:
run.changes(ReportChanges) andrun.filters(ReportFilter,FilterOutcome) onE2E.Reports.ReportRun,SkipInfo.Filter(afilteredskip names the filter),ErrorPhase.Filter, and thefilterphase in the wire form.schema/report-v1.schema.jsonand both fixtures are upstream’s at #1345.
Differences:
- An interrupt surfaces as an
OperationCanceledException, where upstream rejects withINTERRUPTED. The context’sSignalfollows the interrupt only while the call runs. The work a timed-out or interrupted call leaves behind is not recorded (upstream’sleaveWorkBehindkeeps the CLI from waiting for it; the port has no CLI process to keep). - A result is typed, so the refusals of a result that is not
{ exclude, note? }(an array, a string, an unknown key, a map, a numeric note, a value that cannot be shown as text, and a reason that is not a string) cannot happen. A null result, a nullExclude, an empty reason, and an id no collected test has are refused, with the port’s wording for the first two.
Not ported:
filtersine2e.config.json(a filter is code, and the JSON config holds none),--changed-since,--no-filter,INVALID_CHANGED_SINCEas a CLI exit 2, thelistandrunoutput of a left-out pair, the left-out lines of the list and JUnit reporters (there are none in the port; the markdown reporter prints its left-out lines from the report), telemetry, thefiltersetup step of a run,pull_request_targetguidance, and the CI recipe. They need the runner, the collector, and the reporters. Thedotnet testhost (the run fixture) takes the filters and the base ref in code (see Wiring above).@e2e-dev/decision’sdecisionFilterand its tests, including #1345’sleaves nothing out, making no call, when the config the run loaded changed, whatever its name, and goes by name for any other: the package is not ported (see Upstream packages).- Tests:
Changes/FindChangesWithChangedSinceTestshas all 10itofchanges.test.ts(theINTERRUPTEDone isPartial_rejects_once_the_run_is_interrupted; the--no-relativeone runs apart from Windows, as upstream’s does).Time/BudgetTextTestsisbudgetText.SchemaFixtures/ReportV1SchemaTestshas the filteritofschema-fixtures.test.ts.TestFilters/ApplyTestFiltersTests,AFilterPastTheDeadlineTests, andFilterRecordsAndFilterSummaryTestsporttest-filters.test.tsover candidates built by hand, since the port has nocollectorselect; the ones that differ arePartial_.TestFilters/FilterSelectionTestsandFilterCandidatesTestsport the twofilterSelectionand the threefilterCandidatesit, allPartial_: they build the collection and the config by hand where upstream callscollectModule,test.describe, andresolveConfig.Select/SelectWithWhatTheTestFiltersLeftOutTestsports the fiveitofselect with what the test filters left out(select.test.ts) the same way,Partial_. Not ported fromtest-filters.test.ts: therefuses a resultcases above, andleaves nothing out when a filter throws a value that cannot be shown as text.TestFilters/WhatAFilterIsToldTestsis #1345’snames the config file the run loadedoverRepoConfigFile, partial. Not ported: the rest ofintegration/test-filters.test.ts,select.test.ts’s cases forexcluded,config.test.ts’sfilterscases,cli*.test.ts,report-list,report-markdown,report-junit,telemetry-events, andpackages/decision’s tests.
Report document
Section titled “Report document”Upstream writes report.json, a report-1 document of the whole run (report/build.ts), checked by schema/report-v1.schema.json. The port writes it too (#496), with the differences below.
- When and where. Upstream builds the document once, when its runner ends the run, and writes it to
<output>/report.json. A test framework runs the port’s attempts as sessions with no run around them, so each session adds its attempt to the process’s run (ReportFile.WriteAsync, .NET-only) and the whole document is written again, atomically, toreport.jsonbeside the results directory (.e2e/report.jsonby default, asai-trace.jsonis). The file is complete after every attempt.run.finishedAtandrun.statusare those of the attempts so far, not final, andrun.exitCodeis the worst exit code of the results, as upstream’sverdictExitCodesderives it: a failed or timed-out result exits 1, or 2, 3, or 4 when the category of an attempt error isconfiguration,infrastructure, orinternal(an agent code’s category comes fromAgentError.CategoryByCode, upstream’sCATEGORY_BY_CODE, so a blockedAUTH_CREDENTIAL_UNAVAILABLEexits 2), and an interruption exits 130, which outweighs the rest. An attempt whosecleanupisfailedadds the categories of itscleanup-phase secondary errors (ReportRecords.CleanupErrorsOf, upstream’scleanupErrorsOf, tester-army/e2e#1233), so a passed or skipped test whose cleanup failed exits 3 (a session marks its attempt’s cleanup failed, with acleanup-phase secondary error, when the engine session does not close or a required video is not finalized, as upstream’scloseSessiondoes, and the test’s own verdict stays;DisposeAsyncstill throws the failure, unless the session’s own commit failure is thrown instead (the report holds both); a best-effort video that fails is not a cleanup failure; the port has no list reporter, so thecleanup failedline and theCleanupsummary row have no port).run.statusfollows the code (passed,failed,interrupted, elseerror), andblockedis derived from the results afterwards. A result keeps its wire form until it gains an attempt, so a large suite does not serialize every result again after each attempt. A result id is the test’s file and title, so a test that runs twice in one process (another target, a repeat) is one result that its last run replaces, asRunReportalready treats it. Test processes that share an output directory overwrite one another’s file, and a file from an earlier run is replaced by the first attempt. It is written whatever thetracemode, for passing tests too. A write that fails (disk, permission) prints one line to stderr and does not fail the test. - A retry the run interrupted (
retryVerdict,run/retry.ts).Retry.RetryVerdict(Run/Retry.cs) is upstream’sretryVerdict, andRetryAttemptis its type of that name.RunReport.StatusOf(.NET-only, it collects the attempts of a test) derives a result’s status from it: a pass after an attempt isflaky, a skip decides, and an interrupt during a retry keeps the failed or timed-out verdict before it, soOutcome.Verdict(upstream’soutcome().verdict) picks the attempt that failed and not the interrupted retry. An interrupt of the first attempt isinterrupted, and no attempts read asfailed, as upstream does. The run-level interrupt flag isRunState.InterruptedinReportFile(.NET-only, it is the process’s run), where upstream’s runner keepsinterruptController(run/runner.ts): it is set when a session adds an attempt that a user cancel ended (AttemptStatus.Interrupted; a test timeout istimed-out, not an interrupt).E2ESession.Completetakes the user’s cancel from the caller’scancellationToken(the runner’s token that the xUnit and NUnit adapters pass): anOperationCanceledExceptionwith it not cancelled (an HTTP timeout in the test) is a failure, or a timeout when the session’s ownTestTimeoutfired (its error is recorded asTEST_FAILEDorTEST_TIMEOUTwrapping the cancellation, since aCANCELLEDerror would read as the interrupt category and exit 130), and a failure is never upgraded to an interrupt, so a timeout a framework reports as a failure stays one. The flag is read from the results the run holds (a rerun that replaces an interrupted result clears it; the retries of a test stay in its result), andReportFile.StatusOf(results, interrupted)adds 130 to the verdict exit codes when it is set, as upstream’scurrentExitCodedoes. So a run whose retry was interrupted after a failure readsinterruptedwith exit code 130 inreport.json, while that test keeps itsfailedverdict. The xUnit adapter’sErrorForCache(.NET-only) hands a test that xUnit recorded as failed with anOperationCanceledExceptionorTaskCanceledExceptionto the session as anOperationCanceledException(xUnit keeps only the type name and message), so the session tells the user’s cancel by the runner’s token as it does for any test; the NUnit adapter already passes the recorded exception. Known gaps (#837): the flag is derived from attempts, where upstream’s comes from the interrupt signal itself, so a cancelled signal that ends no attempt (a session that never starts) sets nothing;Report()(ReportFile.SingleAsync, .NET-only: it is the report of one session, a run of one result, as upstream’swriteHostTracebuilds it) applies the flag to its own result only, since it sees no other result of the process. Upstream drops the 130 when the run stopped itself (runAborted,stoppedEarly); the port has no scheduler or run-level errors, so it has neither. Upstream’s tests for this are CLI signal tests (interrupt-signals.test.ts, theflowretries case) that spawn the CLI and send Ctrl-C; the port has no runner, so they are not ported, andReportFileTests(.NET-only) covers the flag. Ported: the seven cases of theretryVerdictit.each, asRetry/RetryVerdictTests. Not ported:isRetryEligible,runWithRetries, andisCutSerialRetry, with their tests (a test framework runs each retry in the port, and it has no serial groups). - A closed session’s report (
feat(runner): expose the closed hosted session report,b750125).E2ESession.Report()is upstream’ssession.report(): once the session is disposed and its trace page, when the mode keeps one, is written, it returns the attempt’s report-1 document as a single-result run (ReportFile.SingleAsync, .NET-only; a hosted session returns theReportthatHostTrace.WriteHostTraceAsyncbuilds, as upstream’swriteHostTracedoes). It returns null before that and when the page cannot be written. The return type is the publicE2E.Reports.Report, upstream’sReport(an alias ofReport1Document) with its nested types in C# casing and the names ofreport/build.tsandrun/steps.ts(ReportRun,ReportTarget,ReportResult,ReportAttempt,ReportStep,ReportError,ArtifactRecord,StepEvent,StepMetrics,StepModelInfo,StepCacheRecord,FailureEvidence,SkipInfo,VcsInfo, and the rest). They live in theE2E.Reportsnamespace because the port’s own internal records for the same parts keep upstream’s names inE2E(ReportRunStatusandReportExploreare shared and stay inE2E). The typed report is read from the document thatreport.jsonholds, so the two tell one attempt alike;ReportSerializeris .NET-only and the only place that reads it; the library never writes the typed form. Differences: the typed report has noserialGroupsand nocarried(the port has none), noextensionsand nostack; enum members stand for upstream’s string unions (ResultStatus.TimedOutfortimed-out); durations stayDurationMsas upstream, butReportExplorekeeps itsTimeSpanmembers; a session that keeps no trace (the mode keeps none for the attempt’s verdict) still returns its report, where upstream’s hosted session always writes a trace; a trace page that cannot be written is reported on stderr and the session releases without a failure, so upstream’sclose()failure for it has no port.E2ESession.AttemptId(internal) is upstream’sattemptId. Tests:OpenHostReport/OpenHostReportTestshas bothitofopen-host-report.test.ts; the first is partial and renamedReturns_independent_closed_reports_that_remain_stable_across_a_second_session(nogadget.dropFile()fixture, and the soft failure isCloseSoftFailures’ result rather than an entry ofclose()’s failures), the second is partial and renamedReturns_null_when_the_trace_write_fails_and_the_session_still_releases(noclose()failure check). .NET-only:Tells_the_same_result_as_report_json_for_the_same_sessionchecks thatReport()andreport.jsontell one attempt alike, which upstream’s hosted session (noreport.json) has no counterpart for.TypedReport/TypedReportTests(.NET-only) reads the valid report-1 fixture into aReportand writes it back, and checks that the document is the same bar the serial groups,carried,extensions, andstack. The document’srun.idis the session’s own, so it is not compared.ReportFile.DetectVcs(.NET-only) asks version control once per process and project root for bothreport.jsonandReport(); a failed lookup is asked again, andAsks_for_the_commit_once_per_project_root_however_many_sessions_ask_and_asks_again_after_a_failurecovers both. schema/report-v1.schema.jsonis upstream’s schema, apart from theserialAttempt.cutRetryproperty (upstreamdc8f56d, #1056), added by hand because the vendored copy is older than upstream’s (it lacks thevisionDegradeddescription). The valid fixture is upstream’s at #1056.schema/fixtures/report-v1.valid.jsonandreport-v1.invalid.jsonare upstream’s fixtures. The E2E package packsschema/*.schema.jsonunderschema/(not the fixtures), as upstream’sfilesdoes.schema/session-v1.schema.jsonand its two fixtures are upstream’s, unchanged.schema/agent-judgment-v1.schema.json,agent-judgment-v2.schema.jsonand their four fixtures are upstream’s, unchanged.AgentProtocol.JudgmentSchemaandAgentProtocol.ValidateJudgmentResponse(Agent/AgentProtocol.cs, internal) are upstream’sJUDGMENT_SCHEMAandvalidateJudgmentResponse; see Agents for the judge that uses them.- Session store (
run/sessions.ts,SessionStore).SessionStore(internal) is upstream’s: one AES-256-GCM envelope file per session, authenticated over the whole envelope (identity, expiry, and the secret names in the clear), the learned secret values only inside the ciphertext, a memoized decrypt that still checks expiry on every load, and file names that are percent-escaped, cut, and hashed.SessionIdentity,SavedSession, andEngineStateare the records of upstream’s interfaces.SavedSession.Secretsis upstream’sSavedSecrets(a list of name and value pairs, with no alias of its own), and the envelope’ssecrecycarries only thenames: thetaintedflag went with the pixel taint (#1437), andschema/session-v1.schema.jsonno longer has it. Methods areSaveAsyncandLoadAsync(save,load);CreateandForWorkertake an optionalTimeProvider(.NET-only, a test’s clock).ForWorkertakes the key asbyte[]. A key of the wrong length isE2EExceptionwithSESSION_KEY_INVALID, since the port has no infrastructure error class. A file is written0600and the directory0700on Unix (AtomicWrite.WriteFileAtomicAsynctakes the mode; Windows has none). A payload or envelope field of the wrong type isSESSION_INVALID, where upstream’sTypeErrorescapes.Sessions.TargetIdentityis upstream’stargetIdentity(it takes the target’s name, platform, engine, and resolved app, where upstream’s takes aResolvedTarget).SessionStagingis upstream’s:Stage,Missing, andEntries(stage,missing,entries); a name saved twice or not declared isSESSION_CONTRACT.IEngineSession.CaptureStateAsyncandRestoreStateAsyncare upstream’s optionalcaptureStateandrestoreState; a session that does not override them fails withUNSUPPORTED_CAPABILITY, as upstream’ssession.save()does for an engine withoutstate.EngineStateis public for them. The web engine implements both as upstream’s does (playwright-storage-state, version 1, with IndexedDB); restoring replaces the browser context and is unavailable on a persistent context. The runner that uses them is ported for NUnit and xUnit v3 (#927), without upstream’s collector.test.setup(title, { sessions }, fn)is[E2ESetup(title, Saves = [...])]on a test method (E2E.NUnit.E2ESetupAttribute, which derives from[Test], andE2E.XUnit.V3.E2ESetupAttribute, which derives from[Fact]and showsTitleas the display name;ISessionSetupis the framework-neutral seam),session: nameontestordescribeis[E2ESession(name)]on a method or class, andsession.save(name)isE2EFixture.SaveSessionAsync(these names are .NET-only: the port has notest()options object or fixtures object). Each attempt of a setup test stages its saves throughSessionStaging.Stagewith the secrets its session learned (upstream’scarriedSecretsleaves out static config values, because every upstream session registers those itself; the port’s session registers a config secret when the test reads it, so it keeps them), and the passed attempt writes them withSessionStore.SaveAsync(a name left unsaved isSESSION_CONTRACT, as upstream’s). A test that restores one loads it before the video starts, adds its secrets to the session’s ledger (upstream’sadoptSecrets, without the process ledger), and restores the state; a restore failure ends the attempt like any launch failure. The store is one per process (SessionRun, .NET-only: upstream’s runner makes it for the run), under.e2e/sessions/<run id>, with its key in memory only;E2ERunFixture(both adapters) deletes it when the run ends (upstream’scleanup).EngineCapabilities.State(.NET-only; upstream’s optionalengine.state) is what the report’sstateCapabilityrecords, andcapabilitiesleaves it out;WebEnginedeclares it. Differences, all from the test framework owning the test order and the selection: setup tests do not get a later test’s dependency (NUnit gives a setup test an early[Order], which orders it inside its own fixture only; xUnit v3’sE2ETestcarries[TestMethodOrderer(typeof(SetupTestMethodOrderer))](.NET-only), which puts the setup tests of a class first and is replaced by a class’s own orderer, and xUnit runs classes of different collections in parallel: put the tests that restore its session in that fixture or class, or order the fixtures yourself; a session no setup saved yet isSESSION_UNAVAILABLE; a class-level[E2ESession]does not apply to the setup tests of the class); a setup test runs although no selected test needs its session; a setup inside adescribe, two setups declaring one name, and a setup failure skipping its dependents withsetup-failedare not checked (NUnit and xUnit have nodescribe; a dependent of a failed setup fails withSESSION_UNAVAILABLE); and the state capability is checked when a session is saved or consumed, withUNSUPPORTED_CAPABILITY, not as aCOLLECTION_ERRORbefore any test.openSessionis ported: see Hosted sessions. Upstream’s one engine-level test of the hooks,round-trips persisted state through capture and restore, and reset drops it(web/tests/integration/lifecycle.test.ts), is ported asLifecycle/WebEngineLifecycleTests.Round_trips_persisted_state_through_capture_and_restore_and_reset_drops_it(the blank page readsRouteblank, where upstream readsabout:blank). Upstream’s tests of the runner areEngineContract/RunnerEngineContractTestsandSessionSecrets/SessionSecrecyAcrossSaveAndRestoreTests(the NUnit test project, through nested NUnit runs):Partial_A_session_consumed_on_a_target_without_a_state_capability_fails_before_its_setup_test_saves(the run does not fail before the setup runs: the setup fails atSaveSessionAsyncand the consumer when it restores),Partial_Round_trips_captured_state_into_the_dependent_attempt_via_state_restore(the real web engine behind a wrapper that records the state, and a cookie the dependent reads, where upstream checks a fake state’s data), andEnds_the_attempt_when_session_restore_fails_after_it_started(whole except its check of concurrent attempts: it reads the failure’s code and counts the engine sessions started and disposed) areengine-contract.test.ts’s; the twosession-secrets.test.tscases are partial (the provider case uses aSecret.Createsecret, as the port has no provider-resolved secrets; both read the failure message only, with no report, failure screen, or probing executor).SessionStaginghas no upstream test of its own. The port’s tests (SessionStaging/,WebEngineState/) are .NET-only. The xUnit v3 test project (tests/E2E.XUnit.V3.Tests, new with #927) has the sameEngineContract/andSessionSecrets/classes, same names; each test runs its explicit fixture class in a test process of its own (xUnit has no in-process runner to nest), reads the XML result by method name, and the failing-restore test reads the started and ended engine session counts the child prints. The failure code is read as the exception type and message (xUnit keeps noCodein the message).A_setup_test_breaks_the_session_contract_when_it_saves_wronglyis .NET-only, as in NUnit. The xUnit adapter’s setup attribute needsxunit.v3.extensibility.core4.0.1 (the package floor rose from 1.0.1:FactAttributetakes its source location from 3.0, andITestMethodOrdereris new in 4.0). - Web engine lifecycle (
web/tests/integration/lifecycle.test.ts, tester-army/e2e#1169’s audit):Lifecycle/WebEngineLifecycleTestsandLifecycle/OnOneSharedBrowserAFreshAttemptPerTestTests(describe('on one shared browser, a fresh attempt per test')) port the file’sit, as far as the port has the surface. Whole: the videoit(records a video per page at the viewport size...,records a video started mid-attempt...,opens the attempt page when the video starts; the port cannot spy onpage.screencast.startand the recorder exposes no frame signal, so the paint wait is on the page: loaded, two animation frames, and a screenshot to force the repaint, after which the recorder waits for the first frame withinVideoRecorder.FirstFrameWait),masks secure fields in artifact screenshots and restarts the counter per attempt,applies visible before an index, filter, or scope...(thehasfilters useBrowser.Locator),refuses to swipe a node with no box..., andreports a drag whose drop target turns ambiguous after the press as possibly committed(the port has no strict locator target, soWebEngine.DragAsyncchecks a located drop target for a new twin after the press, as upstream’slocator.dragToresolves its target then: the twin isACTION_MAY_HAVE_COMMITTED,retryable: false, a twin already there too; #1226).Partial_:declares the full deterministic tier plus the browser fixture(the port’s capabilities are flags with no pointer, artifacts, or browser member),keeps tree attributes bounded while node reads expose every attribute(the port’s observed tree carries every attribute, so only the node-read half is ported),mints one root id...(the port has no root node),treats endAttempt before startAttempt and dispose on a cold engine as no-ops(noendAttempt: a session is the attempt, a deliberate .NET design, so there is no issue), andrejects a video that cannot start...(the start fails because a screencast already runs on the page, where upstream rejects a mocked one). Not ported:refuses a second startAttempt while one is running and keeps the first intact(an engine hands out independent sessions, concurrent ones allowed), andstops waiting on cleanup once its budget is aborted, and recovers on the next attempt(a session’sDisposeAsynctakes no cleanup context, becauseIAsyncDisposablecannot; the session bounds its teardown withE2EDefaults.CleanupTimeoutitself, a deliberate .NET design). - Tests:
SessionEnvelope/isunit/session-envelope.test.ts(all 10it:SessionEnvelopeTests,SessionLoadTests,SessionFileNamesTests), andSchemaFixtures/SessionV1SchemaTests,AgentJudgmentV1SchemaTestsandAgentJudgmentV2SchemaTestsare the twoitofdescribe.each(schemas)for each of those schemas.AgentJudgmentSchema/AgentJudgment2Testsisagent-judgment-schema.test.ts(all 21 cases of its oneit.each). WriteReport(Report/WriteReport.cs, internal) is upstream’sreport/write.ts:WriteTextReportAsync,WriteJsonReportAsync(two-space indent, a trailing newline), andToPosixPath.AtomicWrite.WriteFileAtomicAsyncis upstream’swriteFileAtomic(internal/atomic-write.ts): a sibling temporary file with random bytes in its name, moved over the target;AtomicWrite.WriteFileAtomicis the synchronous twin (writeFileAtomicSync), whichFileStepCache.Writeuses becauseIStepCache.Writeis synchronous. On Windows both retry a move the file system refused while another move was replacing the target or a reader held it open (see Replay cache). The trace page and the failure screen file are written throughWriteTextReportAsync, as upstream’straces.tsdoes (it replaces the port’s ownTracePages.WriteTextAsync). The writer serializes with the port’s JSON defaults (camel case, null omitted), so a caller redacts the text and shapes the document. Difference: a string with a lone UTF-16 surrogate makesWriteJsonReportAsyncthrow, whereJSON.stringifywrites an escape; the builder that cuts text to the schema’s limits must not split a surrogate pair. Not ported: the filemodeoption, andfileReporter, since the port has no reporters.- The schema is checked in tests only. The tests use JsonSchema.Net 8.0.5 (MIT; version 9 and later use another license), in the test helper project
tests/E2E.Tests.Schema. The shipped package validates nothing and has no new dependency.ReportSchema.AssertValidReportis upstream’sassertValidReport, withformatasserted as Ajv does. - Run-level blocks (
Report/BuildReport.cs, upstream’sreport/build.ts):DescribeTarget,ProjectSource,ComputeSummary,DeriveRunStatus,ComputeUsage,SerializeTarget, andBuild, which assemblesReport1DocumentwithReportRun’s new members (Status,ExitCode,StartedAt,FinishedAt,Project,Environment,Vcs,Errors,Summary,Limits,Usage).ReportRun.TargetsareReportTargets now, not names.ReportResultgainedDeclarationIndex,Tags, andSelected;ReportArtifactgainedSize;StepMetricsgainedObservationBytes(the largest observation the step read, in bytes of the text a model reads; a judgment that sends pixels alone counts none, as upstream’s does not; sousage.maxObservationBytesis the largest of them).AttemptReport.Buildfills each kept file’sSize, sousage.artifactBytesadds them up. The engine version of a per-attempt target isIEngine.Version, which the session carries inAttemptScope.EngineVersion; a blank version readsunversioned.Git.RunAsyncremoves the variables that point git at a repository (GIT_DIR,GIT_WORK_TREE, and the like) before it starts git, so a hook or wrapper cannot move the repository it reads; upstream passes the parent’s environment through. A target’sbaseOriginis the scheme, host, and non-default port of the app URL, without credentials, and only for http and https, asnew URL(...).originis for a web URL. Differences: the port has no serial groups and no runner to act onfailOnSkippedFailure, soDeriveRunStatusreads results only. A--last-failedrerun’srun.carriedis written byReportFile, not byBuild(see Test filters).DescribeTargettakes the engine’sIEngine.Name, which defaults to its platform; its flag capabilities are spelled in camel case (tapModifiers);stateCapabilityis whether the engine declaresEngineCapabilities.State(see Session store). A target’s environment is alwaystest(the report does not read the app’s resolved environment yet), the project isunknownwith a zero digest (no project id or config digest, as upstream reports without a config),limitsare the largestmaxObservationBytesandmaxInputTokensof the attempt’s agents, merged across the tests of a run (the defaults without agents), andenvironment.runtimereads.NET <version>where upstream’s readsnode <version>. - .NET-only names in this part:
ReportEngine,ReportProject,ReportEnvironment(upstream writes these as inline object shapes),ReportRunStatus(upstream’s status string union),BuildReportOptions.TargetProvenanceis upstream’s own,Git.RunAsync’sbudgetparameter (for tests), andDescribeTarget(platform, version, capabilities)(the session knows its engine by those three, not as anIEngine). Vcs.DetectAsyncandGit.RunAsync(Internal/Vcs.cs,Internal/Git.cs) are upstream’sdetectVcsandgit(internal/vcs.ts,internal/git.ts): git is asked with a one-second budget, and a checkout without git falls back toGITHUB_SHAandGITHUB_HEAD_REForGITHUB_REF_NAME. Difference: a cancelled token surfaces as a cancellation, where upstream has no token.- Wire form (
Report/ReportWire.cs, internal; upstream’sserialize*functions and the report-1 shapes ofreport/build.ts). Upstream types the shapes and letsJSON.stringifydrop what is absent; the port buildsJsonObjects, which omit what is absent the same way. Text is cut to the schema’s bounds without splitting a UTF-16 surrogate pair, and a lone surrogate reads as U+FFFD (JSON.stringifyescapes it; the port’s writer refuses it). A result’s text goes through the redactors of that test’s attempts, as its trace page does.ReportErrorgainedCategoryandRetryable; the stack never enters (SerializedErrorhas none).ReportAttemptgainedId(a UUID version 7,AttemptScope.AttemptId, now minted with the dashes),StartedAt,Cleanup(alwayscomplete: the port does not tell a failed or forced cleanup from the attempt), andSkip;ReportResultgainedPlatform;ReportSkipandAttemptCleanupare .NET-only. The run id is a UUID version 7, one per process. A result id is the full 64-hex SHA-256 that its directory name is the head of (the port’s digest, not upstream’s).testIdisfile::titleasAttemptReport.TestIdspells it. - Fields the port cannot fill, and what the wire says: a judgment step that failed before it read a screen has
observationRevisionunrecorded(upstream requires one; the revision,b1,b2, and so on, is minted for each capture of the attempt byAttemptScope.ObserveAsyncand kept asObservation.Revision) and itsexplanationreads empty when the judge gave none;model.endpointisprovider-default,adapterVersionthe package version,policyVersionunversioned,tokenAccountingprovider,peakTokensPerCall0, andproviderandmodelare split at the first slash ofIAgentModel.Name,unknownwhen the name has none;cache.recordedByis dropped when the name has no slash;cache.entryis dropped unless it is a SHA-256; a skip is alwaysexplicit(aSkipcall);visionInput,visionDegraded,visionOnly, and the tool-proposal event kind have no port; an artifact iscompleteonly for a log whose file was read, and every video and screenshot isincomplete(pixels cannot be proven free of a secret); thesizeandsha256come from the file under the results directory when the report is written;serialGroupsis[]andcarriedis absent; a target’sindexis the order its first attempt reached the report. Results sort by file, declaration index, target index, then, since the port declares no index, by source line, title, and id, so the order does not depend on which attempt finished first. - Tests:
ReportStatus/holdsreport-status.test.ts:ResultTagsTests,ResultSourceTests,RunStatusDerivationTests(the three non-serial cases), andRunLimitsTests(the default-limits case), each asserting the document is valid report-1 as upstream’sbuilddoes, andErrorStacksTests(partial: no serial member; the port’s error keeps no stack, so the test throws a real exception and checks that neither its stack nor its path reaches the document). Not ported: the three serial-group cases (“is blocked when the failing member of the last attempt carries a blockable code”, “stays failed when the failing member of the last attempt failed on the product”, “reads the last attempt, not an earlier blocked one”; the port has no serial groups), and “fills the block from the largest per-agent values” (the config rejects those keys).Vcs/DetectVcsTestshas all threeitofvcs.test.ts. .NET-only:ReportParts/ReportPartsTests(upstream reaches these blocks only through whole runs),ReportJson/ReportFileTests(the file as sessions write it, the artifact digest, redaction, the surrogate cut), and the helperGitRepo(upstream’stests/helpers/git-repo.ts). - Tests:
SchemaFixtures/ReportV1SchemaTestshas everyitof upstream’sdescribe.each(schemas)forreport-v1;SchemaFixtures/SchemaFixturesTestshas the first top-levelit(a schema for every fixture pair); the second (it publishes every schema) is partial: it reads the project file’s packed items and the glob, notpackage.json, anddotnet packwas checked by hand to hold the schema and no fixture.ReportWrite/WriteJsonReportTestshas bothitofreport-write.test.ts. .NET-only: the two-space/newline test and theToPosixPathtest. - Serial verdict (upstream
dc8f56d, #1056: a serial attempt that was interrupted, or a retry that never reached its members, is acutRetryand no longer supplies a result’s verdict, duration, or failure text). Ported: the schema property and fixture,SchemaFixtures/ReportV1SchemaTests.Accepts_optional_runner_cut_retry_decisions_and_rejects_other_types,Outcome.Verdict(upstreamoutcome().verdict, withreachedVerdict),Outcome.DurationMsread from it, andFailureText.ToldAttemptreturning it. TheOutcomeof a result answers from its own attempts, so a failed test whose retry the run interrupted now reports the failed attempt’s duration. Not ported, since the port has no serial groups, no JUnit or Markdown reporter, and norun/retry.ts:isCutSerialRetry,SerialAttemptRecord.cutRetry,serializeSerialAttempt, the serial branch ofattemptViews, and the testsreport-outcome(bothit),serial-record,retry(isCutSerialRetry),report-status(serializes the runner cut-retry decision),report-junit(both newit),report-markdown(the serialit.each),interrupt-signals(a serial member keeps its failed attempt time), and thesdk-typescheck. observationTruncated(upstream82039ad, #1301) isReportStep.ObservationTruncated, written byReportWire.Stepwhen true and absent otherwise.ObservationFeedmarks it for any look of the step that a capture or byte limit cut, including one a settled look took before its last, andObservationFeed.ReportDetails()is upstream’sreportDetails. A judgment records it inAgent.LookAsync, where upstream does it inInvocation.observe. Tests:AgentObservationReport/AgentObservationReportFieldsTestsportsagent-observation-report.test.ts, both partial (Partial_prefix): the port has no fixture-enginerunProject, so each test runs its own session over an engine wrapper that marks every observation truncated and validates its ownreport.json, where upstream runs one project of both tests and validates its report.SchemaFixtures/ReportV1SchemaTestshas the boolean/string/absentit. Not ported: thesdk-types.tscheck (the C# type makes it).- Tests that read the report: a test whose upstream
itreadsoutcome.reportgives its session a results directory (ReportDirectory, .NET-only, inReportJson/) and readsreport.jsonafter the session is disposed, checked against the schema. They areAgentAct/(the hand-rolled executor, the default tool loop, and the blocked verdict),EngineTargets/,CacheModelProvenance/,ScriptedActions/,TruncatedSecrets/,TransformedSecrets/, andAgentPolicy/ASecretTheObservedScreenShowsTests. What the report still lacks keeps a test partial:app.restartandapp.clearStaterecord the reopen as a step of its own; a step whose executor reports no model readsunknownwhere upstream names the executor.Traces/TracesTestsstays partial: the lead it reads is in upstream’ssummary.md, and the port has no summary reporter.
App and browser fixtures
Section titled “App and browser fixtures”Text downloads are rescanned through the final secrecy ledger before their report records are read, including values filled after attachment. Fragment scans also recognize ASCII secrets written with JSON Unicode escapes, once or twice quoted. These safeguards extend upstream’s attachment-time scan and ASCII spelling shortcut; stream redaction keeps its existing buffering. The .NET-only regressions are DownloadRedactionSessionTests.Rescans_downloads_with_values_registered_after_attachment, Reports_a_previously_complete_download_incomplete_when_the_final_scan_fails, and Redacts_JSON_Unicode_escaped_ASCII_secrets_before_reporting_complete. The rescan changes the file after the store was handed the bytes of the first scan, so a store holds what the ledger knew at registration, as upstream’s does.
App.RestartAsync closes the tab and opens a new one in the same browser context, so cookies and storage survive. App.ClearStateAsync replaces the context with a clean one. Both then reopen the app at its base URL, as upstream, and keep a viewport set with Browser.SetViewportAsync. Without a base URL they leave a blank page.
App.ScreenshotAsync(label) is upstream’s app.screenshot (upstream #1326 and the commit that added it): a redacted evidence screenshot, saved as an attempt artifact under screenshots/ and returned as an absolute path; the report records the path relative to the artifact root. Upstream’s engine surface artifacts.screenshot(label, operation) is IEngineSession.ScreenshotArtifactAsync(label, cancellationToken) (a different name from the existing ScreenshotAsync, which returns the PNG ToHaveScreenshotAsync compares). The port redacts the label before the engine names the file (upstream passes it as given, so a secret of filename-safe characters would show in the file name: reported on #797). It returns the artifact-relative path, and the default fails with UNSUPPORTED_CAPABILITY as upstream’s guard does. WebEngine (secure fields masked in every frame, the file moved into place from a unique temporary name) and MobileEngine (secure nodes painted over, status bar left as the device shows it; an image that cannot be redacted is not written) and WinAppEngine (the window with secure fields painted over, as toHaveScreenshot takes it; .NET-only engine) implement it. DocumentEngine does not, so ScreenshotAsync there is UNSUPPORTED_CAPABILITY. Tests: FixtureRuntime/ExplicitScreenshotSecrecyTests is fixture-runtime.test.ts’s describe('explicit screenshot secrecy') (all it, with the provider set by E2EConfig.WithCredential; the captures before and after a %s secret fill one is partial, since the artifact is read from the step’s record where upstream reads the arguments of register). OpenSession/HostOpenSessionTests is open-session.test.ts’s describe('host.openSession'): its first it is partial (the app.screenshot lines, through an E2ESession); the other four need the hosted openHost and a config file. .NET-only: FixtureRuntime/WebAppScreenshotTests (the real web engine), and WindowScreenshotsTests in E2E.WinApp.Tests (the Windows engine). The mobile it “numbers screenshots per attempt, masks secure fields in them, and refuses an unmaskable one” (engine.test.ts) now runs through ScreenshotArtifactAsync, as upstream’s does. The mobile-benchmark controls.e2e.ts it “screenshot, restart, and clearState reopen the app on its home list” is WinAppBenchmark.E2ETests/Controls/ControlInventoryTests.Screenshot_restart_and_clearState_reopen_the_app_on_its_home_list (it needs an unlocked Windows desktop, so it was built but not run here).
App.OpenAsync names a navigation the network refused APP_UNREACHABLE (infrastructure), as upstream’s unreachableApp and openAt do (run/fixtures.ts): when the engine’s error message names ERR_CONNECTION_REFUSED, ECONNREFUSED, ERR_NAME_NOT_RESOLVED, ENOTFOUND, ERR_ADDRESS_UNREACHABLE, EHOSTUNREACH, ERR_CONNECTION_TIMED_OUT, or ETIMEDOUT (upstream’s NOTHING_LISTENING), the error reads nothing answered at <url> (<match>); start the app there, point the target's app.url at where it runs, or give the target an app.command so the runner starts it, with the engine’s error as InnerException. The reopen after App.RestartAsync and App.ClearStateAsync goes through the same path. Any other failed navigation stays ENGINE_FAILURE. EngineException.Mapped (internal, .NET-only) marks an error the runner already named, which ErrorSerializer.TranslateEngineError keeps as it is: upstream’s runner throws these as InfrastructureError, which its translateEngineError does not touch, where the port’s EngineException is both that class and the engine’s EngineError. A plain exception an engine throws (no E2EException) is a non-retryable ENGINE_FAILURE (navigation failed: <message>), as upstream’s engine-to-session adapter (engine/session.ts) makes it: the port’s EngineSession (Engine/EngineSession.cs, upstream’s createEngineSession) wraps each attempt’s engine session in E2ESession.StartAsync and normalizes every member’s throw with upstream’s guard labels (normalize). A cancellation passes through as a cancellation, and so does any other throw once the caller’s token is cancelled (.NET-only). The Browser fixture’s browser.* calls reach the engine’s own IBrowserSession through EngineSession.Unwrap, so they are not normalized by the adapter (the adapter cannot expose IBrowserSession without implementing it for every engine); WebSession has its own guard. The adapter also checks a press key against the key grammar before the engine sees it (Keys.RequireKey, upstream’s requireKey), as the dispatcher and the replay host already did. Upstream’s capability gate in the same seam is not moved: the port keeps it in IEngineSession.ActionKinds and PointerActionKinds (read by Screen and the dispatcher) and in the UNSUPPORTED_CAPABILITY default members. The adapter’s own class, the Unwrap helper (the Browser fixture and the web engine’s test hooks read the engine’s own type through it), and the adapter’s IEngineFixtureHost forwarding are .NET-only. DisposeAsync is not normalized (upstream’s dispose() belongs to the worker). Tests: EngineContract/RunnerEngineContractTests, the plain Error case of ‘classifies EngineErrors from fixture surfaces (app.open) with the canonical mapping, and a plain Error as ENGINE_FAILURE’ (still partial: a session stands for the run), and the .NET-only ‘A_cancellation_an_engine_throws_stays_a_cancellation_and_is_not_normalized_to_ENGINE_FAILURE’.
Differences from upstream:
app.open,back,forward, andreloadwait forloadwithin the action timeout. Upstream waits within the test timeout.Browser.GotoAsync(url, GotoOptions?)resolves the URL against the base URL likeApp.OpenAsync, with the same scheme rule.GotoOptions.WaitUntilisLoad(the default),DomContentLoaded, orNetworkIdle, andTimeoutdefaults to the action timeout. Upstream’s default is the test timeout.Browser.WaitForURLAsyncisToHaveURLAsyncas a wait, as upstream, so it verifies the previousactand fails withexpect.toHaveURL failed. It takes a string, resolved against the base URL, or aRegex, and polls until the assertion timeout or the given timeout.ToHaveURLAsynctakes a string or aRegexinstead of upstream’sstring | RegExp. A string is compared after both sides go throughSystem.Uri(not WHATWG), which agrees with Chromium on the default port, the trailing slash, dot segments, and percent-encoding. ARegexis tested against the URL as Chromium serializes it.Browser.WaitForResponseAsynctakes upstream’s glob string or a .NETRegex(upstream an ECMAScriptRegExp), and the timeout as aTimeSpan?. As upstream, the timeout bounds the match only;WebResponse.BodyAsync(upstream’sbody(), a copy of the bytes on every call),TextAsync, andJsonAsync<T>wait for the body up to the action timeout, which is fixed for the session (upstream reads the budget when the body is read). A failed match isOPERATION_TIMEOUTwith the port’s message form (waitForResponse: <Playwright message>).Browser.EvaluateAsync<T>takes the script as a string (an expression, or a function source that is called with the optional argument) and deserializes the JSON result toT. A throwing script fails withEVALUATE_FAILEDand the message it threw, a result that is not plain JSON (such asInfinity, aDate, or a class instance like aDOMRector an element; returnrect.toJSON()instead) withINVALID_ARGUMENT, and nothing returned asnull. As upstream (tester-army/e2e#1553,9267248), the page-side boundary encodes the result itself and Playwright takes it back as a string from a handle, so a page that deletedArrayorJSON, or replacedMaporObjectafter the call began, still returns its result. A page that replaced a built-in the engine’s in-page code needs, such asMap, fails a later evaluate and a locator read withEVALUATE_FAILED, notENGINE_FAILURE, when Playwright’s utility world still reads the document (WebErrors.PageScriptFailureAsync, upstream’spageScriptFailure; the port probes the top frame and runs it for evaluate andLocateAsync). Not ported: upstream’s__namekeep-names helper, which the TypeScript loader needs and the port does not, and a browser that closes under it withENGINE_FAILURE.Browser.RouteAsynctakes the same glob string orRegexasWaitForResponseAsync, and a handler that returns aTask.WebRoutehasRequest,FetchAsync(WebResponse:Url,Status,Headers,BodyAsync,TextAsync,JsonAsync; takes no options, adds the configured site headers, runs under the action timeout, never follows a redirect, and does not decide the route; a body the browser could not read failsBodyAsync,TextAsync, andJsonAsyncwithACTION_FAILEDnamingroute.fetch),FulfillAsync(RouteFulfillResponse:Status,Headers,ContentType,Json,Body,BodyBytes,Path),ContinueAsync(RouteContinueOverrides:Url,Method,Headers,DropHeaders,PostData),FallbackAsync, andAbortAsync, with upstream’s checks, codes, and messages.UnrouteAsyncremoves the routes added with an equal glob, or aRegexwith the same source and options.UnrouteAllAsyncremoves every route added through the browser and keeps the configured site headers.Pathresolves against the project root (E2ESessionOptions.ProjectRoot, whichE2ETestsets to the config’s directory, else the working directory). Binary bodies, header deletes, and severalset-cookie(tester-army/e2e#154840826e4): a fulfill body of bytes isRouteFulfillResponse.BodyBytesand is sent unchanged, a request header dropped byContinueAsyncis named inRouteContinueOverrides.DropHeaders(also on a redirect), and aset-cookieheader ofRouteFulfillResponse.Headersmay join several cookies with\n, each line checked as its own value, soroute.fetch()headers pass straight back; any other line break isINVALID_ARGUMENT.BodyBytesandDropHeadersare .NET-only names: upstream’sbodyis a string or aBuffer/Uint8Arrayand itsheaderstakeundefined, which C# has no union for, and astring?header value would warn every caller that passes aDictionary<string, string>. GivingBodyandBodyBytestogether isINVALID_ARGUMENT(.NET-only).BrowserResponse.BodyBytesis the engine-facing twin. Tests:Routes/BrowserRouteDecisionsTestsadds theitofroutes.test.tsfor the bytes, the header drop, theset-cookiejoin, and the new refusals (the undefined fulfill header and the number body are left out, as the C# types refuse them), andRouteOptions/RouteDecisionHeadersTestsisroute-options.test.ts. Differences: options are typed, so an unknown key, a non-string header value, and anaborterror code do not compile instead of failing withINVALID_ARGUMENT;Jsonis serialized withSystem.Text.Jsonweb defaults, andnullmeans no JSON body; a handler error raised after the test’s last browser call is collected byE2ESession.SettleAttemptAsync(as upstream’ssettleAttempt) and fails the attempt at its end, as for a dialog handler (see theOnDialogAsyncentry): the settle waits within the cleanup timeout for a handler still running, and one that outlives it fails the attempt withCLEANUP_TIMEOUTnaming it, after which what it throws is dropped.Browser.AddInitScriptAsynctakes source or aWebInitScript, and a JSON argument only withWebInitScript.FromFunction, the function’s JavaScript source.- Each async
Browsercall is a harness step of kindresource, as upstream’sFixtureRecorderrecords it, with the api namebrowser.goto,reload,back,forward,url,title,waitForURL,evaluate,addInitScript,route,unroute,unrouteAll,waitForResponse,cookies,setCookies,clearCookies,setViewport,emulateMedia,onDialog,waitForDownload,waitForDownloads, andkeyboard.*andmouse.*, and upstream’s labels (a URL or pattern, the key,<n> charsfor typed text, the init script’s path or kind, the media features).browser.waitForURLverifies, andexpect(browser)matchers areassertionsteps nested in it. A pattern label (upstream’spatternLabel) writes a glob string quoted, asJSON.stringifydoes, and a regex as/source/flags, since .NET has noString(RegExp).Browser.LocatorandFrameLocatorare not async and record nothing, as upstream. Argument checks the type system makes upstream’s (a predicate pattern, an unknown option key) do not exist, so upstream’sfails with INVALID_ARGUMENT at %sandan option waitForURL does not take is refusedtests have no port. The port does not wrap each call in the action timeout, asFixtureRecorder.rundoes: a call keeps the bound it had.Browser.ClearCookiesAsync(CookieFilter?)is upstream’sclearCookies(options): a filter field is aTextMatch(a string matches exactly, aRegexmatches the text, run by Playwright as JavaScript), andContext.ClearCookiesAsyncdoes the removal. Upstream’srefuses an unknown filter and a value that is not a string or RegExp, clearing nothingtest andtests/types/clear-cookies.tshave no port:CookieFilterhas nourlmember and the compiler refuses a field that is neither, so there is noINVALID_ARGUMENTpath. - Navigation URLs resolve with
System.Uri, not WHATWG. As upstream, onlyhttp:,https:, and the exactabout:blankare admitted. But a tab or newline inside a URL is escaped, not stripped, soview-\tsource:file:opens as an http path under the base URL (or fails withAPP_URL_REQUIREDwithout one) instead ofPOLICY_DENIED. A percent-encoded unreserved character in the path is decoded (%66ile:becomesfile:). Neither opens a scheme other than http(s).
DocumentEngine supports app.back (it rebuilds the previous route), app.restart, and app.clearState (both drop the history and reopen the base URL). It has no viewport: DocumentPage.OnScroll and DocumentElement.OnScroll let a page load more rows when it is scrolled. It has no browser, so every Browser member fails with UNSUPPORTED_CAPABILITY. A custom engine opts in by implementing IBrowserSession, and by overriding the default BackAsync, RestartAsync, and ClearStateAsync on IEngineSession, which otherwise fail with UNSUPPORTED_CAPABILITY.
Models
Section titled “Models”Upstream takes any AI SDK model instance. JSON cannot hold one, so agents.<name>.provider names the client, and code builds one with ModelProviders, Subscriptions, or a client’s options. Each client speaks its vendor’s wire protocol directly:
| Upstream | provider |
.NET |
|---|---|---|
@ai-sdk/openai chat, @ai-sdk/openai-compatible, Ollama |
openai, openai-compatible |
OpenAiCompatibleModel |
@ai-sdk/openai Responses, @ai-sdk/azure |
openai-responses, azure |
OpenAiResponsesModel (ModelProviders.AzureOpenAi) |
@ai-sdk/anthropic |
anthropic |
AnthropicModel |
@ai-sdk/google |
google |
GoogleModel |
@ai-sdk/amazon-bedrock |
bedrock |
BedrockModel, signed with SigV4 or a Bedrock API key |
@ai-sdk/xai |
xai |
OpenAiCompatibleModel at api.x.ai |
@openrouter/ai-sdk-provider |
openrouter |
OpenAiCompatibleModel at openrouter.ai |
gateway() from ai |
gateway |
OpenAiCompatibleModel at ai-gateway.vercel.sh |
chatgpt() |
chatgpt |
Subscriptions.ChatGpt |
copilot() |
copilot |
Subscriptions.Copilot (CopilotModel) |
grok() |
grok |
Subscriptions.Grok |
opencodeConsole() |
opencode-console |
Subscriptions.OpenCodeConsole (OpenCodeConsoleModel) |
Keys come from the environment variable the AI SDK reads (OPENAI_API_KEY, ANTHROPIC_API_KEY, GOOGLE_GENERATIVE_AI_API_KEY, AZURE_API_KEY, XAI_API_KEY, OPENROUTER_API_KEY, AI_GATEWAY_API_KEY, AWS_*), or the one apiKeyEnv names.
Subscriptions follow upstream: the same four logins (openai PKCE on port 1455 or --device, github-copilot from gh or an OAuth App’s device flow with enterprise hosts, opencode-console and spacexai device flows), the same credentials file ($XDG_CONFIG_HOME/e2e/oauth.json, mode 0600, locked and replaced atomically, unknown entries kept), E2E_OAUTH_CREDENTIALS, refresh two minutes ahead of expiry with one refresh shared per file (a cancelled call stops waiting for it, and the refresh finishes for the others), a retry after a 401, Copilot’s chat-or-Responses choice from the plan’s listing, OpenCode Console’s per-model protocol from the workspace config, and OPENCODE_API_KEY, which replaces the login for the model and for e2e models opencode-console; bare e2e models also lists OpenCode Console when only the key is set, and a missing login’s message names the key. The OpenCode Console model always asks the Anthropic route for 8192 output tokens, as upstream does when a call sets no cap. A missing or rejected login fails the step with MODEL_PROVIDER_FAILED, blocked, naming the OAuthException code (NOT_LOGGED_IN, LOGIN_REQUIRED). Tests: oauth/errors.test.ts is OauthErrors/ (DescribeResponseTests: both it of describeResponse; ReadJsonBodyTests: the it of readJsonBody, which is TokenEndpoint.ReadJsonBodyAsync) and oauth/token-endpoint.test.ts is OauthTokenEndpoint/RequestTokensTests (all 3 it).
Differences:
- Requests are not streamed. The Codex backend only streams, so its event stream is folded back into the final response, as upstream folds it
- The Vercel AI Gateway and OpenRouter are reached over their OpenAI-compatible chat API, so a gateway model gets no Anthropic cache breakpoints or OpenAI cache key. The gateway reads
VERCEL_OIDC_TOKENfrom the environment but does not runvercel env pullitself - Gemini tool schemas go as
parametersJsonSchema, unconverted, and the judgment schema asresponseJsonSchema, as the AI SDK does:@ai-sdk/google4.0.105 (the version upstream locks) sendsparametersJsonSchema: tool.inputSchemaand no longer runsconvertJSONSchemaToOpenAPISchema(vercel/ai #20757, “preserve JSON Schema instead of converting to OpenAPI schema”). ForresponseJsonSchemait only rewritesconstto a one-valueenum(sanitizeResponseJsonSchema); the port’s tool,explore, and judgment schemas use noconst, so there is nothing to rewrite. Gemini’s docs list only some JSON Schema keywords; the port’s schemas also use unlisted ones such asmaxLength, which were not verified against a live Gemini call. A Gemini 3 thought signature rides the call it signed, asModelToolCall.ProviderMetadata["google"].thoughtSignature(the AI SDK’sproviderMetadata.google.thoughtSignature), andGoogleModelsends it back with that call on the next turn; a call with none gets the documented placeholder - A Responses model (OpenAI, Azure, and the subscription backends) replays its reasoning on the next turn as upstream does: nothing is stored, so the request asks for
reasoning.encrypted_contentand sends each encrypted reasoning item back inline, ahead of the turn’s text and tool calls (all reasoning items first, not interleaved as returned). The request asks for it from every model except those namedgpt-3*,gpt-4*,chatgpt-4o*, andgpt-5-chat*, as the AI SDK does. Anthropic replays its thinking blocks, signature and redacted data included, ahead of the turn’s text and tool calls, and chat completions replayreasoning_content(read fromreasoning_contentorreasoning) on the assistant message, as the AI SDK does. Google replays its thought parts (thought: true, with theirthoughtSignature) and Bedrock itsreasoningContentblocks (reasoningTextwith its signature, or the redacted content) the same way, ahead of the turn’s text and tool calls. A Gemini text part with athoughtSignatureand nothought: truekeeps its signature and sends it back on that same text part on the next turn. A Bedrock request is signed again for every attempt (ModelHttp.SendAsynctakes asigncallback), as the AI SDK signs inside each fetch, so a retry after a long wait carries a freshx-amz-date - On Anthropic, the tool loop stops replaying the thinking from a message it rewrote since the last request (an executor’s
PrepareMessageschanged it, or the history was shrunk after a context overflow) on, as upstream does, since Anthropic binds each thinking block to the prefix before it. The loop compares each message by value with what the last request sent (MessageShape), drops the reasoning withProviderHints.AfterEdit(upstream’safterEdit, taking the model, since the port has noproviderHints(model)factory; itsSpeaksAnthropiccheck reads the model object where upstream’s reads a provider and model id), and notes it on the turn. The drop is permanent for the step, and reasoning produced after the rewrite stays. OnlyAnthropicModeland such aBedrockModeldo this: a Bedrock model whose id names Anthropic behind an optional region prefix (eu.anthropic.claude-…) does it too, as upstream’sspeaksAnthropicrecognizes it (the id is read off theBedrockModel; a Bedrock application inference profile ARN is not recognized, as upstream). The port has no Vertex or OpenRouter client that replays Anthropic thinking, so a rewrite is one of three: the per-turn elision of stale screens and screenshots (TranscriptCompaction, #677), a history shrunk after a context overflow, or an executor’sPrepareMessages. Elision starts once the stale screens passKeepStaleScreenBytes(32 KB). The port prints a full screen on every look, so the next look then elides the previous one too, where upstream’s later screens are diffs and leave the thinking after them replayed. The part of the change that keeps the system prompt fixed across a switch toauto(the instructions hold the tool-calls-only rule from the first turn) is in place; the switch itself arrives with the tool-choice retry of #1157 azureuses the Responses API at/openai/v1withapi-version=v1, as the AI SDK’sazure()does. Bedrock signs withAWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEY(andAWS_SESSION_TOKEN) when both are set and otherwise resolves the AWS credential chain (shared profile viaAWS_PROFILEor the default profile, SSO, container and instance roles) with the AWS SDK for .NET (AWSSDK.Core), as the AI SDK’s amazon-bedrock provider does with the AWS SDK for JavaScript. Upstream has no symbol for it, since the AI SDK owns the chain, soAwsCredentialChainandBedrockModelOptions.CredentialChain(internal, a test seam) are .NET-only. A chain that finds nothing ends the step withMODEL_PROVIDER_FAILED; the chain’s own message is redacted- A model request the provider refuses as too large ends with
CONTEXT_OVERFLOW, blocked, and names the same status and body. The port uses upstream’s patterns for the refusal (every provider’s wording, any HTTP 413, a throttling text vetoed) on the message and the body. As upstream does,agent.actthen shrinks the step’s history once and sends the request again: every superseded screen is elided, and any text past 16,384 characters is cut to its head with a notice. The refused request spends no model call, and the retry runs through the turn’s preparation again, so an executor’sPrepareMessagessees the shrunk history, as upstream’sprepareMessagesdoes. A second refusal, or a first one with nothing to shrink, ends the step and says which. The built-in agent also elides stale screens and screenshots before each turn (TranscriptCompaction), so an overflow shrink finds fewer to elide. - A model that refuses a request (finish reason
content-filter) ends the step withMODEL_REFUSEDinstead ofMODEL_PROVIDER_FAILED, as upstream does, and the step cache reads it as a failed flow likeMODEL_OUTPUT_INVALID. The port has no AI SDK to map each provider’s stop word, so its providers do:refusal(Anthropic),content_filter(chat completions, and Responsesincomplete_details),SAFETY,RECITATION,BLOCKLIST,PROHIBITED_CONTENT,SPII, andIMAGE_SAFETY(Gemini, and a prompt it blocks with no candidate, bypromptFeedback.blockReason),guardrail_intervenedandcontent_filtered(Bedrock). A refused turn that still called a tool is kept, as upstream keeps a usable answer. The message names the model without a provider, because anIAgentModelhas only a name, and quotes the provider’s word redacted and cut at 128 characters - A model GitHub Copilot does not serve to the account (
model_not_supported, a 4xx answer) ends the step withMODEL_UNAVAILABLE, blocked, naming the model and the causes (the plan, the Copilot settings, an unknown id), as upstream’scopilot()does. Upstream also marks the failure so its runner reports it once and stops the run; the port has no run-level error list and no workers, so every step that calls the model fails the same way. A model on the wrong endpoint (unsupported_api_for_model) stays aMODEL_PROVIDER_FAILED - A model request answered with an error status ends with
MODEL_PROVIDER_FAILEDand names the HTTP status and the response body, secrets redacted, cut at 1 KB. The port never parses a provider’s error body, so it quotes every one. Before it fails, the request is sent again up to 5 times (upstream’sTRANSPORT_RETRIES,ModelHttp.TransportRetries) after a network failure or a status the AI SDK treats as retryable (408, 409, 429, and every 5xx), waiting the provider’sretry-after-msorretry-afterwhen it is under a minute (or under the backoff) and otherwise 2 seconds doubled each time; the failure is the last attempt’s. A request that got no response in 120 seconds is not sent again, and the step’s deadline or a cancel ends the wait. The act loop sends a forcedtool_choiceand, when a 400 refuses it, sends the request again withauto(see the tool loop bullet) - Every model request sends upstream’s identity headers, replacing the same headers set on the client, but names this port so its traffic is not counted as upstream’s:
User-Agent: e2e-dotnet/<version> (<platform>; <arch>)(the NuGet version; the platform and arch by Node’s names),HTTP-Referer: https://github.com/hardkoded/e2e-dotnet, andX-Title: e2e-dotnet. Model requests appendruntime/dotnet/<version>after it, where upstream has the AI SDK’s user agent. Login requests send the same user agent, as upstream’s do, and still name thee2eoriginator and referrer that upstream registered e2e loginwith no provider shows a numbered list instead of upstream’s picker.e2e modelsprints the same columns.e2e loginprints the sign-in URL on a line of its own, as upstream does, with plain lines where upstream uses clack log steps- A
ModelMessageof theuserrole can carryImages(ModelImage: the bytes, a media type, and the size), and every provider sends them after the turn’s text: animage_urlpart with a data URL for chat completions,input_imagefor Responses, a base64imageblock for Anthropic,inlineDatafor Google, and animageblock with its format for Bedrock. The AI SDK builds these parts upstream, so the port writes each provider’s shape itself. A model that cannot read images answers with the provider’s error, which ends the step withMODEL_PROVIDER_FAILED. A judgment sends one when it asks for vision (see Agents); vision onactis not ported.Pixels.SizeForModel(internal) caps a screenshot’s long side at 768 pixels with upstream’s box filter and keeps the scale (image pixels per CSS pixel) in step EngineScreenshot.MaskedRegionCountcounts the regions the engine covered, which upstream carries asmaskedRegionCounton observed pixels: the web engine counts the secure fields of every frame, and the mobile engine the secure nodes it painted. It is null for an engine that cannot say. A secret fill no longer withholds pixels from a model (upstream #1437 dropped the exposure levels with the pixel taint); the screenshot masks secure fields only.e2e initwrites the model config as aproviderandmodel(see Coding agents), not a constructed model
Model usage
Section titled “Model usage”Upstream’s ModelUsage (agent/usage.ts) is ModelUsage in Agent/Usage.cs (internal), the per-step accumulator behind StepRecorder.AddModelCall (upstream’s StepAccounting.usage). Record returns the call’s tokens, which the model event carries as Count; Report fills StepModelInfo, whose TokenAccounting and PeakTokensPerCall are now real: a call with no usage, or without both token counts, makes the step adapter-upper-bound, a negative or oversize count is dropped, a sum past 2^53-1 (ModelUsage.MaxSafeInteger) is capped and also marks the step adapter-upper-bound, and a cost that is negative, not finite, or whose total overflows is omitted (an overflowed total stays omitted). BuildReport.ComputeUsage caps modelTokens and modelCachedTokens the same way. ModelUsage.Usage is upstream’s non-exported Usage interface; TokenFields is upstream’s tokenFields. Differences: model-usage.test.ts is ModelUsage/ModelUsageAccountingTests and ModelUsage/ReportedModelUsageTests. The third accounting it is partial (a C# token count is a long?, so Infinity cannot be sent). Both integration it are partial: the port has no runExisting harness or report schema check, the cost is ModelCallUsage.EstimatedCostUsd where upstream reads the AI Gateway metadata, the first test sets the step tokens to the maximum directly (a ModelCallUsage count is an int), and the second sends -1 only (not 0.5 or NaN). The agent’s session totals (E2ESession.InputTokens) stay int.