Skip to content

Commit

Permalink
fix: robin upload url / app binary id (mobile-dev-inc#2094)
Browse files Browse the repository at this point in the history
  • Loading branch information
axelniklasson authored Oct 16, 2024
1 parent c024a8b commit e957c5e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import maestro.cli.util.WorkspaceUtils
import maestro.cli.view.ProgressBar
import maestro.cli.view.TestSuiteStatusView
import maestro.cli.view.TestSuiteStatusView.TestSuiteViewModel.Companion.toViewModel
import maestro.cli.view.TestSuiteStatusView.robinUploadUrl
import maestro.cli.view.TestSuiteStatusView.uploadUrl
import maestro.cli.view.box
import maestro.utils.TemporaryDirectory
Expand Down Expand Up @@ -135,9 +136,8 @@ class CloudInteractor(
println()
val project = requireNotNull(projectId)
val appId = response.appId
val uploadUrl = uploadUrl(project, appId, client.domain)
val uploadUrl = robinUploadUrl(project, appId, response.uploadId, client.domain)
val deviceMessage = if (response.deviceConfiguration != null) printDeviceInfo(response.deviceConfiguration) else ""
val appBinaryIdResponseId = if (appBinaryId != null) response.appBinaryId else null
return printMaestroCloudResponse(
async,
authToken,
Expand All @@ -148,7 +148,7 @@ class CloudInteractor(
uploadUrl,
deviceMessage,
appId,
appBinaryIdResponseId,
response.appBinaryId,
response.uploadId,
projectId,
)
Expand Down Expand Up @@ -252,7 +252,7 @@ class CloudInteractor(
private fun printDeviceInfo(deviceConfiguration: DeviceConfiguration): String {
val platform = Platform.fromString(deviceConfiguration.platform)

val line1 = "Maestro Cloud device specs:\n* ${deviceConfiguration.displayInfo} - ${deviceConfiguration.deviceLocale}"
val line1 = "Robin device specs:\n* ${deviceConfiguration.displayInfo} - ${deviceConfiguration.deviceLocale}"
val line2 = "To change OS version use this option: ${if (platform == Platform.IOS) "--ios-version=<version>" else "--android-api-level=<version>"}"
val line3 = "To change device locale use this option: --device-locale=<device_locale>"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,16 @@ object TestSuiteStatusView {
domain: String = "mobile.dev",
) = "https://console.$domain/uploads/$uploadId?teamId=$teamId&appId=$appId"

fun uploadUrl(
fun robinUploadUrl(
projectId: String,
appId: String,
uploadId: String,
domain: String = ""
): String {
return if (domain.contains("localhost")) {
"http://localhost:3000/project/$projectId/maestro-tests/app/$appId"
"http://localhost:3000/project/$projectId/maestro-test/app/$appId/upload/$uploadId"
} else {
"https://copilot.mobile.dev/project/$projectId/maestro-tests/app/$appId"
"https://app.robintest.com/project/$projectId/maestro-test/app/$appId/upload/$uploadId"
}
}

Expand Down

0 comments on commit e957c5e

Please sign in to comment.