Skip to content

Automate browser based workflows with AI

test(SKY-11187): cover text/SMS OTP credentials in Copilot (#6745)

Andrew Neilsonf5d83aa22211
diff --git a/tests/unit/test_copilot_fill_credential_field.py b/tests/unit/test_copilot_fill_credential_field.py
index b6edb80e6..6413ac5a6 100644
--- a/tests/unit/test_copilot_fill_credential_field.py
+++ b/tests/unit/test_copilot_fill_credential_field.py
@@ -194,6 +194,25 @@ class TestResolveCredentialFillValue:
assert "workflow run" in error
assert "[email protected]" not in error
+ @pytest.mark.asyncio
+ async def test_text_otp_credential_returns_runtime_otp_steer(self, monkeypatch: pytest.MonkeyPatch) -> None:
+ self._wire_vault(
+ monkeypatch,
+ PasswordCredential(
+ username=_FAKE_USERNAME,
+ password=_FAKE_PASSWORD,
+ totp=None,
+ totp_type=TotpType.TEXT,
+ totp_identifier="+15550101111",
+ ),
+ )
+ value, _, error = await tools_module._resolve_credential_fill_value(_ctx(), "cred_123", "totp")
+ assert value is None
+ assert error is not None
+ assert "await <credential_parameter>.otp()" in error
+ assert "workflow run" in error
+ assert "+15550101111" not in error
+
@pytest.mark.asyncio
async def test_missing_credential_errors(self, monkeypatch: pytest.MonkeyPatch) -> None:
monkeypatch.setattr(