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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: robin upload url / app binary id #2094

Merged
merged 3 commits into from
Oct 16, 2024
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
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
Loading