Skip to content

test: run image comparison tests with the Appium images plugin - #268

Open
Dor-bl wants to merge 4 commits into
mainfrom
test/images-plugin-opt-in
Open

Dor-bl wants to merge 4 commits into
mainfrom
test/images-plugin-opt-in

Conversation

@Dor-bl

@Dor-bl Dor-bl commented Sep 22, 2026

Copy link
Copy Markdown
Owner

ImagesComparisonTests has been failing with NotImplementedException ("The
requested resource could not be found") since Appium 2 moved the
compare_images endpoint out of the server and into the images plugin. The
plugin only serves that route when it is activated at server start, and
AppiumServers started the local service with --relaxed-security alone, so
the route was never mounted.

Pass --use-plugins=images when the new useImagesPlugin setting (env.json)
or the APPIUM_USE_IMAGES_PLUGIN environment variable is set. The flag is
opt-in rather than unconditional because Appium exits with "Could not load
the plugin 'images' because it is not installed" when the plugin is
missing, which would break every local-service run, including
AppiumLocalServerLaunchingTest. Default-off keeps the current CI behaviour
unchanged.

Verified locally on Windows against Appium 3.7.0 with
appium-windows-driver 6.3.0 and images@5.0.0: the three
ImagesComparisonTests tests pass with the flag enabled, and the Windows
suite goes from 7/13 to 10/13.

Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_011ioB36iPHdGs87Nx5A8HHe

IsTrue dereferenced its value after a null-conditional chain, so
ServerIsLocal() threw NullReferenceException whenever env.json had
DEV=false and the DEV environment variable was unset, failing
OneTimeSetUp for every fixture that calls it.
…tests (appium#1135)

These fixtures picked the Appium server URI with ServerIsLocal(), which
reflects the DEV flag rather than isRemoteAppiumServer. In CI DEV is
false, so they always resolved to RemoteServerUri (localhost:4723) with
nothing listening there, only "passing" by luck of test order when
another fixture had already started a local Appium service on the same
default port. Switch to ServerIsRemote(), matching the pattern already
used by the rest of the suite (e.g. ClipboardTest.cs), so these
fixtures reliably start/use the local Appium service in CI.
Copilot AI lite review requested due to automatic review settings September 22, 2026 17:38
@github-actions github-actions Bot added the Test label Sep 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Add automated coverage for enabled and default-off plugin configurations.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Enables Appium’s images plugin for local integration tests through opt-in configuration.

Changes:

  • Reads configuration from env.json or APPIUM_USE_IMAGES_PLUGIN.
  • Conditionally activates the images plugin.
  • Documents the setting in the sample configuration.
File Summary
test/​integration/​helpers/​Env.cs Resolves images-plugin configuration.
test/​integration/​helpers/​AppiumServers.cs Conditionally activates the plugin.
test/​integration/​env.json.sample Documents the opt-in setting.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +25 to +27
if (Env.UseImagesPlugin())
{
args.AddArguments(new KeyValuePair<string, string>("--use-plugins", "images"));
ImagesComparisonTests has been failing with NotImplementedException ("The
requested resource could not be found") since Appium 2 moved the
compare_images endpoint out of the server and into the images plugin. The
plugin only serves that route when it is activated at server start, and
AppiumServers started the local service with --relaxed-security alone, so
the route was never mounted.

Pass --use-plugins=images when the new useImagesPlugin setting (env.json)
or the APPIUM_USE_IMAGES_PLUGIN environment variable is set. The flag is
opt-in rather than unconditional because Appium exits with "Could not load
the plugin 'images' because it is not installed" when the plugin is
missing, which would break every local-service run, including
AppiumLocalServerLaunchingTest. Default-off keeps the current CI behaviour
unchanged.

Verified locally on Windows against Appium 3.7.0 with
appium-windows-driver 6.3.0 and images@5.0.0: the three
ImagesComparisonTests tests pass with the flag enabled, the 21
AppiumLocalServerLaunchingTest tests still pass with it unset, and the
Windows suite goes from 7/13 to 10/13.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011ioB36iPHdGs87Nx5A8HHe
@Dor-bl
Dor-bl force-pushed the test/images-plugin-opt-in branch from bcf2802 to 7b6874c Compare September 24, 2026 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants