Skip to content

Commit

Permalink
Add watch ultra in deliver
Browse files Browse the repository at this point in the history
  • Loading branch information
xiii111 committed Mar 7, 2023
1 parent 3b937c0 commit 0b02285
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
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

0 comments on commit 0b02285

Please sign in to comment.