diff --git a/CHANGELOG.md b/CHANGELOG.md index 706c239..9fb97ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ ### Changes +- [Tester] A test now opens its start URL before it reads the page, so its first action is chosen from the + page the scenario actually starts on. Previously the opening step was planned from whatever page the previous + test left open — a test starting on a create form could spend its whole run on the list page behind it, + never filling the form. + - [Pilot] When the app reports an action succeeded but the record is not visible on the page, Pilot now asks the API whether it was stored instead of failing on what the screenshot shows. A record the API cannot find is still a failure. Needs API access configured; without it, Pilot judges from the page as before. diff --git a/src/ai/tester.ts b/src/ai/tester.ts index 2fcdd03..5d9f14a 100644 --- a/src/ai/tester.ts +++ b/src/ai/tester.ts @@ -136,8 +136,8 @@ export class Tester extends TaskAgent implements Agent { let initialState = ActionResult.fromState(state); const currentUrl = state.fullUrl || state.url; let startOnCurrentPage = opts.startOnCurrentPage; - if (isErrorPage(initialState) && !startOnCurrentPage && task.startUrl && normalizeUrl(currentUrl) !== normalizeUrl(task.startUrl)) { - debugLog(`Recovering from error page at ${currentUrl} by navigating to ${task.startUrl}`); + if (!startOnCurrentPage && task.startUrl && normalizeUrl(currentUrl) !== normalizeUrl(task.startUrl)) { + debugLog(`Opening test start URL ${task.startUrl} before building context (was at ${currentUrl})`); try { await this.explorer.visit(task.startUrl); state = this.stateManager.getCurrentState(); @@ -145,7 +145,7 @@ export class Tester extends TaskAgent implements Agent { initialState = ActionResult.fromState(state); startOnCurrentPage = true; } catch (error) { - debugLog(`Could not recover from error page: ${compactErrorMessage(error)}`); + debugLog(`Could not open test start URL: ${compactErrorMessage(error)}`); } } if (isErrorPage(initialState)) {