My colleague who is a QA is running some automated tests using Selenium in Visual Studio against a Microsoft Bot that is being run in Microsoft Teams. Now he needs to be able to target a "Signin Card" (https://learn.microsoft.com/en-us/microsoftteams/platform/task-modules-and-cards/cards/cards-reference), which shows like this,
This Signin card is constructed in my C# code by creating an instance of "SigninCard", which takes 2 parameters, one, which is "Text" and the other, which is "Buttons". The constructor only takes 2 parameters.
var signinCard = new SigninCard
{
Text = "Test Sign-in Card",
Buttons = new List<CardAction> { new CardAction(ActionTypes.OpenUrl, "This way to Sign-in",
value: endPoint, text: $"Copy {loginUrl} into browser if it does not open") },
};
Basically he needs to target the button by using an identifier to do so, hence why he has requested a class or id be put on it. However, the construction of this element is supposedly done by the bot framework. Im not aware of any properties I can set to put a class or id on this button unless anyone knows how this can be achieved or if I can go about this in a different way?
As it is, without modification to the SDK, no.
However, as the SDK is open source, you could create your own class, copying the Microsoft.Bot.Schema.SigninCard class, adding the properties you need / want to it. Then, modify the Microsoft.Bot.Builder.ActivityFactory class to include the custom signin card. Lastly, you would build your own assembly of it that would then be used in place of the assembly available from the SDK.