Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,26 @@ let package = Package(
.library(
name: "Vizzly",
targets: ["Vizzly"]),
.library(
name: "VizzlyXCTest",
targets: ["VizzlyXCTest"]),
],
targets: [
.target(
name: "Vizzly",
dependencies: [],
path: "clients/swift/Sources/Vizzly"),
.target(
name: "VizzlyXCTest",
dependencies: ["Vizzly"],
path: "clients/swift/Sources/VizzlyXCTest"),
.testTarget(
name: "VizzlyTests",
dependencies: ["Vizzly"],
dependencies: ["Vizzly", "VizzlyXCTest"],
path: "clients/swift/Tests/VizzlyTests"),
.testTarget(
name: "VizzlyE2ETests",
dependencies: ["Vizzly"],
path: "clients/swift/Tests/VizzlyE2ETests"),
]
)
19 changes: 8 additions & 11 deletions clients/ruby/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,15 @@

## [0.2.1] - 2026-02-04

## What's Changed

Release v0.2.1

See the full diff for detailed changes.
### Changed
- Improved packaging and release metadata.


## [0.2.0] - 2026-01-07

## What's Changed

Release v0.2.0

See the full diff for detailed changes.
### Added
- Support for `min_cluster_size` and `full_page` screenshot options.
- Browser E2E coverage for Ruby screenshot capture.


All notable changes to the Vizzly Ruby client will be documented in this file.
Expand Down Expand Up @@ -44,5 +39,7 @@ This changelog is automatically generated when releasing new versions.
- Graceful error handling and auto-disable on failure
- TDD mode visual diff warnings with dashboard links

[Unreleased]: https://github.com/vizzly-testing/cli/compare/ruby/v0.1.0...HEAD
[Unreleased]: https://github.com/vizzly-testing/cli/compare/ruby/v0.2.1...HEAD
[0.2.1]: https://github.com/vizzly-testing/cli/releases/tag/ruby/v0.2.1
[0.2.0]: https://github.com/vizzly-testing/cli/releases/tag/ruby/v0.2.0
[0.1.0]: https://github.com/vizzly-testing/cli/releases/tag/ruby/v0.1.0
26 changes: 24 additions & 2 deletions clients/ruby/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,40 @@ Vizzly.screenshot('checkout-page', image_data,
browser: 'chrome',
viewport: { width: 1920, height: 1080 }
},
threshold: 5
threshold: 5,
min_cluster_size: 3,
full_page: true,
build_id: 'build_123',
request_timeout: 60_000
)
```

Ruby option names use snake_case. The client also accepts camelCase aliases for
parity with the JavaScript API: `minClusterSize`, `fullPage`, `buildId`, and
`requestTimeout`. `request_timeout` is measured in milliseconds, so
`60_000` means one minute.

### Using a Client Instance

```ruby
client = Vizzly::Client.new
client.screenshot('login-form', image_data)

# Override local TDD visual diff behavior for this client
strict_client = Vizzly::Client.new(fail_on_diff: true)

# Attach screenshots to a known build and tune request timeout in milliseconds
client.screenshot(
'checkout',
image_data,
build_id: 'build_123',
request_timeout: 60_000
)

# Check if client is ready
puts "Ready: #{client.ready?}"

# Get client info
# Get client info, including the effective fail_on_diff setting
puts client.info
```

Expand Down Expand Up @@ -100,6 +120,8 @@ You can also configure via environment variables:

- `VIZZLY_SERVER_URL` - Server URL (e.g., `http://localhost:47392`)
- `VIZZLY_BUILD_ID` - Build identifier for grouping screenshots
- `VIZZLY_FAIL_ON_DIFF` - Set to `true` or `1` to raise when a local TDD
comparison returns a visual diff

## Development

Expand Down
8 changes: 4 additions & 4 deletions clients/ruby/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ task default: %i[rubocop test]

desc 'Run integration tests (starts TDD server internally)'
task 'test:integration' do
ENV['VIZZLY_INTEGRATION'] = '1'
sh 'ruby -I lib test/integration_test.rb'
ENV['VIZZLY_E2E'] = '1'
sh 'ruby -I lib test/e2e_test.rb'
end

# =============================================================================
Expand All @@ -43,7 +43,7 @@ end

desc 'Run integration tests in TDD mode (one-shot, generates static report)'
task 'test:tdd:run' do
sh "node #{VIZZLY_CLI} tdd run 'VIZZLY_INTEGRATION=1 ruby -I lib test/integration_test.rb'"
sh "node #{VIZZLY_CLI} tdd run 'VIZZLY_E2E=1 ruby -I lib test/e2e_test.rb'"
end

desc 'Run E2E tests in TDD mode (one-shot, generates static report)'
Expand All @@ -58,7 +58,7 @@ end
desc 'Run integration tests in cloud mode (uploads to Vizzly)'
task 'test:cloud' do
abort 'VIZZLY_TOKEN required for cloud mode' unless ENV['VIZZLY_TOKEN']
sh "node #{VIZZLY_CLI} run 'VIZZLY_INTEGRATION=1 ruby -I lib test/integration_test.rb'"
sh "node #{VIZZLY_CLI} run 'VIZZLY_E2E=1 ruby -I lib test/e2e_test.rb'"
end

desc 'Run E2E tests in cloud mode (uploads to Vizzly)'
Expand Down
5 changes: 2 additions & 3 deletions clients/ruby/example/test_screenshot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class ScreenshotTest < Minitest::Test
def setup
options = Selenium::WebDriver::Chrome::Options.new
options.add_argument('--headless')
options.add_argument('--disable-gpu')
options.add_argument('--window-size=1920,1080')

@driver = Selenium::WebDriver.for :chrome, options: options
Expand All @@ -23,8 +22,8 @@ def test_captures_vizzly_homepage
# Navigate to vizzly.dev
@driver.navigate.to 'https://vizzly.dev'

# Wait for page to load
sleep 1
wait = Selenium::WebDriver::Wait.new(timeout: 10)
wait.until { @driver.find_element(tag_name: 'body').displayed? }

# Capture screenshot as PNG binary data
image_data = @driver.screenshot_as(:png)
Expand Down
Loading