Skip to content

Conversation

@teo-nikolov
Copy link
Collaborator

No description provided.

teo-nikolov and others added 26 commits November 19, 2023 23:09
…top-module-update

# Conflicts:
#	src/Bellatrix.Desktop/components/Core/Component.DefaultActions.cs
#	src/Bellatrix.Desktop/settings/ExecutionSettings.cs
…experimental-desktop-driver

# Conflicts:
#	src/Bellatrix.Core/Bellatrix.Core.csproj
#	src/Bellatrix.Desktop/Bellatrix.Desktop.csproj
#	src/Bellatrix.Desktop/components/Core/Component.cs
#	src/Bellatrix.Desktop/infrastructure/App.cs
#	src/Bellatrix.KeyVault/Bellatrix.KeyVault.csproj
#	src/Bellatrix.Web/Bellatrix.Web.csproj
#	src/Bellatrix.Web/plugins/execution/BrowserLifecyclePlugin.cs
#	src/Bellatrix.Web/services/DevToolsService.cs
#	templates/Bellatrix.API.GettingStarted/Models/Albums.cs
#	templates/Bellatrix.API.Tests/Models/Albums.cs
#	templates/Bellatrix.Desktop.Tests/TestsInitialize.cs
#	tests/Bellatrix.API.Tests/Models/Albums.cs
Copy link
Member

@angelovstanton angelovstanton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please check comments

private static readonly string _serviceUrl;
private static readonly string ServiceUrl;

private const string CloseButtonXPath = "//Button[contains(translate(@AutomationId, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'), 'close') or contains(translate(@Name, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'), 'close')]";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks a bit strange is it correct?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is the way to lowercase in XPath expression, it works in the example tests. Checks for 'close' automation id or name, case-insensitive

// TODO: Change to be ThreadLocal.
private static bool _shouldStartLocalService;
private static Process _winAppDriverProcess;
// private static Process _appiumProcess;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we delete it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I'm using _appiumServerProcess below so this one is not needed

throw new ArgumentException("Appium version 3.1.0 or higher is required. Please update Appium by running: npm install -g appium@latest");
}

const string latestVersion = "1.2.0-preview.2";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this versionm the correct one? should we move it somewhere in the config?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this will be needed only before we release the full 1.2.0 version, after that it will not be needed and will be automatically updated by appium

Attached?.Invoke(this, new ComponentActionEventArgs(this));
}

// public virtual void Detach()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we delete this one?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can delete it, I changed the Attach logic so that we won't need to detach the windows to attach another one

Checking?.Invoke(this, new ComponentActionEventArgs(this));
try
{
WrappedDriver.ExecuteScript("windows: toggle", WrappedElement);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will all of these JavaScript commands work across all desktop applications?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are appium platform-specific extensions and are implemented in NovaWindows driver.

Whether they should work or not depends on if the component implements the correct Pattern (e.g. TogglePattern). If it does not, there's a fallback to the previous method.

{
if (ConfigurationService.GetSection<LargeLanguageModelsSettings>() == null)
{
throw new ArgumentException("Could not load LargeLanguageModelsSettings section from testFrameworkSettings.json");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe in all of the places we need to at least use the logger instead of just calling return?

if (ConfigurationService.GetSection<LargeLanguageModelsSettings>() == null)
{
throw new ArgumentException("Could not load LargeLanguageModelsSettings section from testFrameworkSettings.json");
return;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

if (ConfigurationService.GetSection<LargeLanguageModelsSettings>() == null)
{
throw new ArgumentException("Could not load LargeLanguageModelsSettings section from testFrameworkSettings.json");
return;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants