Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to make the sanity (Playwright-based) UI tests more reliable and debuggable by replacing fixed delays with state-based waits and by capturing/publishing screenshots on failures in CI.
Changes:
- Replace brittle
waitForTimeoutusage in UI flows with more deterministic waits (e.g., waiting for the command palette to close, waiting for search results/buttons). - Add failure screenshot capture support in
TestContext, plus a CLI option (--screenshots-dir) to control where screenshots are written. - Update the Azure Pipelines sanity job to create a screenshots directory, pass it into the test run, and publish it as a pipeline artifact.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/sanity/src/uiTest.ts | Improves UI interaction stability by using typed input and state-based waits instead of fixed sleeps. |
| test/sanity/src/main.ts | Wires screenshotsDir into TestContext from CLI options (but currently misses -s alias support). |
| test/sanity/src/index.ts | Adds --screenshots-dir, -s to the CLI help/options for the sanity test runner. |
| test/sanity/src/context.ts | Captures a screenshot of the active Playwright page when a test fails. |
| build/azure-pipelines/common/sanity-tests.yml | Creates/publishes a screenshots artifact and passes a screenshots directory to sanity test runs. |
Comments suppressed due to low confidence (1)
test/sanity/src/main.ts:20
-s/--screenshots-diris documented and used by the pipeline, butmain.tsdoesn't define an alias for-s. With the current minimist config,-s <path>will populateoptions.sinstead ofoptions['screenshots-dir'], soscreenshotsDirwill always beundefinedwhen the short flag is used. Add{'screenshots-dir': 's'}to thealiasmap here (or switch callers to use--screenshots-dir).
const options = minimist(process.argv.slice(2), {
string: ['commit', 'quality', 'screenshots-dir'],
boolean: ['cleanup', 'verbose', 'signing-check', 'headless', 'detection'],
alias: { commit: 'c', quality: 'q', verbose: 'v' },
default: { cleanup: true, verbose: false, 'signing-check': true, headless: true, 'detection': true },
});
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @lszomoruMatched files:
|
bpasero
approved these changes
Feb 27, 2026
DonJayamanne
pushed a commit
that referenced
this pull request
Mar 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Capture and upload screenshots when errors occur.
Close app and browser even if test fails.
Improve waiting logic and add retries in flaky places (such as Extensions view).