Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[deliver] Add Watch Ultra screen size #21106

Merged
merged 1 commit into from Oct 17, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions deliver/lib/deliver/app_screenshot.rb
Expand Up @@ -69,6 +69,8 @@ module ScreenSize
IOS_APPLE_WATCH_SERIES4 = "iOS-Apple-Watch-Series4"
# Apple Watch Series 7
IOS_APPLE_WATCH_SERIES7 = "iOS-Apple-Watch-Series7"
# Apple Watch Ultra
IOS_APPLE_WATCH_ULTRA = "iOS-Apple-Watch-Ultra"

# Apple TV
APPLE_TV = "Apple-TV"
Expand Down Expand Up @@ -126,6 +128,7 @@ def device_type
ScreenSize::IOS_APPLE_WATCH => Spaceship::ConnectAPI::AppScreenshotSet::DisplayType::APP_WATCH_SERIES_3,
ScreenSize::IOS_APPLE_WATCH_SERIES4 => Spaceship::ConnectAPI::AppScreenshotSet::DisplayType::APP_WATCH_SERIES_4,
ScreenSize::IOS_APPLE_WATCH_SERIES7 => Spaceship::ConnectAPI::AppScreenshotSet::DisplayType::APP_WATCH_SERIES_7,
ScreenSize::IOS_APPLE_WATCH_ULTRA => Spaceship::ConnectAPI::AppScreenshotSet::DisplayType::APP_WATCH_ULTRA,
ScreenSize::APPLE_TV => Spaceship::ConnectAPI::AppScreenshotSet::DisplayType::APP_APPLE_TV
}
return matching[self.screen_size]
Expand Down Expand Up @@ -163,6 +166,7 @@ def formatted_name
ScreenSize::IOS_APPLE_WATCH => "Watch",
ScreenSize::IOS_APPLE_WATCH_SERIES4 => "Watch Series4",
ScreenSize::IOS_APPLE_WATCH_SERIES7 => "Watch Series7",
ScreenSize::IOS_APPLE_WATCH_ULTRA => "Watch Ultra",
ScreenSize::APPLE_TV => "Apple TV"
}
return matching[self.screen_size]
Expand Down Expand Up @@ -337,6 +341,9 @@ def self.devices
ScreenSize::IOS_APPLE_WATCH_SERIES7 => [
[396, 484]
],
ScreenSize::IOS_APPLE_WATCH_ULTRA => [
[410, 502]
],
ScreenSize::APPLE_TV => [
[1920, 1080],
[3840, 2160]
Expand Down
5 changes: 5 additions & 0 deletions deliver/spec/app_screenshot_spec.rb
Expand Up @@ -149,6 +149,7 @@ def expect_screen_size_from_file(file)
expect_screen_size_from_file("AppleWatch-Series3{312x390}.jpg").to eq(ScreenSize::IOS_APPLE_WATCH)
expect_screen_size_from_file("AppleWatch-Series4{368x448}.jpg").to eq(ScreenSize::IOS_APPLE_WATCH_SERIES4)
expect_screen_size_from_file("AppleWatch-Series7{396x484}.jpg").to eq(ScreenSize::IOS_APPLE_WATCH_SERIES7)
expect_screen_size_from_file("AppleWatch-Ultra{410x502}.jpg").to eq(ScreenSize::IOS_APPLE_WATCH_ULTRA)
end
end

Expand Down Expand Up @@ -360,6 +361,10 @@ def app_screenshot_with(screen_size, path = '', language = 'en-US')
expect(app_screenshot_with(ScreenSize::IOS_APPLE_WATCH_SERIES7).device_type).to eq("APP_WATCH_SERIES_7")
end

it "should return watchUltra for Apple Watch Ultra" do
expect(app_screenshot_with(ScreenSize::IOS_APPLE_WATCH_ULTRA).device_type).to eq("APP_WATCH_ULTRA")
end

it "should return appleTV for Apple TV" do
expect(app_screenshot_with(ScreenSize::APPLE_TV).device_type).to eq("APP_APPLE_TV")
end
Expand Down
Expand Up @@ -41,6 +41,7 @@ module DisplayType
APP_WATCH_SERIES_3 = "APP_WATCH_SERIES_3"
APP_WATCH_SERIES_4 = "APP_WATCH_SERIES_4"
APP_WATCH_SERIES_7 = "APP_WATCH_SERIES_7"
APP_WATCH_ULTRA = "APP_WATCH_ULTRA"

APP_APPLE_TV = "APP_APPLE_TV"

Expand Down Expand Up @@ -92,6 +93,7 @@ module DisplayType
APP_WATCH_SERIES_3,
APP_WATCH_SERIES_4,
APP_WATCH_SERIES_7,
APP_WATCH_ULTRA,

APP_DESKTOP
]
Expand Down