diff --git a/clients/ruby/lib/vizzly.rb b/clients/ruby/lib/vizzly.rb index e095f6fc..363f067f 100644 --- a/clients/ruby/lib/vizzly.rb +++ b/clients/ruby/lib/vizzly.rb @@ -55,6 +55,7 @@ def screenshot(name, image_data, options = {}) payload = { name: name, image: image_base64, + type: 'base64', buildId: ENV.fetch('VIZZLY_BUILD_ID', nil), threshold: options[:threshold] || 0, fullPage: options[:full_page] || false, diff --git a/clients/ruby/test/integration_test.rb b/clients/ruby/test/integration_test.rb index ecac330a..6c2bf6e1 100644 --- a/clients/ruby/test/integration_test.rb +++ b/clients/ruby/test/integration_test.rb @@ -39,8 +39,9 @@ def test_screenshot_with_running_server result = Vizzly.screenshot('test-screenshot', image_data, properties: { browser: 'chrome', viewport: { width: 1920, height: 1080 } }) - assert result - assert_equal true, result['success'] + assert result, 'Expected result to be non-nil' + # TDD mode returns status: 'new' for first screenshot, 'match' for subsequent + assert %w[new match].include?(result['status']), "Expected status 'new' or 'match', got: #{result['status']}" end def test_screenshot_with_auto_discovery @@ -57,8 +58,9 @@ def test_screenshot_with_auto_discovery image_data = create_test_png result = client.screenshot('auto-discovered', image_data) - assert result - assert_equal true, result['success'] + assert result, 'Expected result to be non-nil' + # TDD mode returns status: 'new' for first screenshot, 'match' for subsequent + assert %w[new match].include?(result['status']), "Expected status 'new' or 'match', got: #{result['status']}" end private diff --git a/clients/swift/Sources/Vizzly/VizzlyClient.swift b/clients/swift/Sources/Vizzly/VizzlyClient.swift index 588fca50..8483a39b 100644 --- a/clients/swift/Sources/Vizzly/VizzlyClient.swift +++ b/clients/swift/Sources/Vizzly/VizzlyClient.swift @@ -79,6 +79,7 @@ public final class VizzlyClient { var payload: [String: Any] = [ "name": name, "image": imageBase64, + "type": "base64", "threshold": threshold, "fullPage": fullPage ] diff --git a/clients/vitest/src/setup.js b/clients/vitest/src/setup.js index 7ba14d1b..ac455082 100644 --- a/clients/vitest/src/setup.js +++ b/clients/vitest/src/setup.js @@ -60,6 +60,7 @@ async function toMatchScreenshot(element, name, options = {}) { body: JSON.stringify({ name: screenshotName, image: screenshotPath, // Send file path directly + type: 'file-path', buildId: buildId || null, threshold, fullPage, diff --git a/src/sdk/index.js b/src/sdk/index.js index 08f30805..2b46e90a 100644 --- a/src/sdk/index.js +++ b/src/sdk/index.js @@ -252,6 +252,7 @@ export class VizzlySDK extends EventEmitter { buildId, name, image: imageBase64, + type: 'base64', properties: options.properties || {}, };