d9c4abe0df
* minor modifications in README * Added launcher project and changed references to common * Added the code to launch another process * added shellapi header * Added launcher to runner * added functions to remove the abstract class error * added the wox launcher dll * Readded the reference to common * modified the additional include directories for the release version * changed the name to be displayed from Wox.Launcher to Launcher * Localized the strings of Launcher * Added a SearchResult Helper class * Created a helper class to use indexer and return search results * Added the main and settings file which declare most of the plugin interfaces * Added references and renamed a class * Added the images folder which contains the windows indexer icon * Added the image * Added the plugin.json file * Minor changes in project files * Added plugin.json to the project * Modified the output paths to create the dll for the plugin in the correct location * Refactored the code to make it unit testable * Made the code unit testable and added unit tests for the indexer plugin * Removed commented out code * Code to terminate wox when we exit PowerToys * Copy from Jeremy's fork PR * Removed unnecessary plugins from source tree * add missing files * Fix postbuild event * Added x64 for all Wox project - Debug mode * Removed the AnyCPU config - Debug * Added the build paths for release x64 (removed AnyCPU) * Set warning level to 4 : Release * Set warning level 4 : Debug * set optimize code to false * Removed notify icon component * Removed setting UI XAML file and references * Readded necessary callback functions * Removed python path and python plugin functions * Removed UI related to python path and the bindings related to that * Remove python bindings * Removed the localized string translations from pythonDirectory and SelectPythonDirectory * Manually resolving conflicts * Fix Wox build in project settings * deleting unused project files * Undo change internal * Fix internal variable * All wox exceptions in debug are getting rethrown, and thus causing the app to crash. This change removes the debug specific code and allows exceptions to be handled the same was as release. * Ported Indexer plugin to .net core 3 * Added the test project back * Removed the .net framework indexer folder * readding the plugin.json file * Changed the anyCPU config to x64 for windows indexer plugin * Adding dependency to wox project on the runner. This should make sure the wox.exe can be build and launched by the runner so wox can run as a background process. * Updating build dependencies. Wox.Launcher wasn't built as part of the F5 Experience, and nor were the plugins * removing locks from the ResultListBox code behind file. All callbacks are accessed from the Main/UI thread. * Remove anyCPU config and changed it to x64 * Removed anycpu of test proj * Adding dependency * Renaming executable to PowerLauncher. Replaceing icons with placeholder. Deleting Docs folder * Renaming AppData directory from 'Wox' to 'PowerLauncher'. Also replacing issue link with powertoys github. * adding support for xaml islands * Added Neils UI code * Replace Niels Code references * Added assets and behaviours * Add missing reference * Add main view model binding * Using proper executable name when closing 'PowerLauncher' process * changed x:bind to Binding to avoid reference * Updated bindings for launcher * Added binding on searchBox * Adding Directory.Build.targets file to kill the PowerLauncher pprocess on Build or Clean operations of all 'Launcher' projects. * Fixed exception preventing result display * Fixed issue with wpf marshalling events to a non UI thread * Optimised result binding by inserting search result from multiple plugin in parallel * copy resource files to output folder * Corrected the output path for the indexer plugin * windows indexer plugin is working * Remove console print statement * Added callback function for mouse click on search result * Working App execution * Cherry picked pinyin performance changes from jjw24's master branch * change nuget package to msft for winrt compat * Working up/down arrow key * updating references and removing a few that seem uneeded for how stuff is referenced * adding two back in * Removing Squirrel dll. unsure on updating so i kept that logic in * Updated functionality on suggestion chosen in autosuggestbox * Added the <useWPF> tag to remove the warning * Removed an unnecessary <useWindowsForms> tag * Removed the item group for properties from calculator plugin * Removed the item group for properties from folder plugin * Removed the item group for properties from indexer, program and shell plugin * Removed itemgrp from wox.core and wox.test csprojs * Removed the unnecessary wox files to clean up codebase * Renamed Wox.Plugin.Indexer to Microsoft.Plugin.Indexer * Renamed Wox.Launcher to Microsoft.Launcher * To avoid DBNull to String typecast exception * Added query submitted event to handle default action on clicking a list view item * Merge pull request #42 from microsoft/AddPinyinPerformance Cherry picked pinyin performance changes from jjw24's master branch (cherry picked from commit |
||
---|---|---|
.. | ||
FancyZonesTests | ||
Properties | ||
packages.config | ||
PowerToysSession.cs | ||
PowerToysTrayTests.cs | ||
README.md | ||
TestShortcutHelper.cs | ||
win-app-driver.csproj |
PowerToys Tests
The PowerToys tests are implemented using Appium and use the Windows Application Driver as an Appium compatible server for Windows applications.
Prerequisites
- Install the latest stable version of Windows Application Driver in the test machine: v1.1 Release
- Install the ".Net desktop development" components in Visual Studio 2019. It should have support for "C#" and ".Net Framework 4.7.2".
- Install PowerToys v0.15.2
- Set Windows to "Developer Mode", by selecting
Developer mode
inSettings > For developers > Use developer features
in Windows 10.
If you have PowerToys v0.15.2 (MSIX)
installed, it can be launched automatically. Otherwise you should start PowerToys
before running tests.
Preparing the test machine
-
Start
PowerToys
if it is necessary. -
Run the "Windows Application Driver" in Administrator mode in the test machine. By default you can find it in
C:\Program Files (x86)\Windows Application Driver
-
Notice that notifications or other application windows that are shown above PowerToys settings window or tray can disrupt testing process.
When testing on a remote machine, Firewall exceptions must be added and the IP and port must be passed when starting "Windows Application Driver". Here's how to do it from the Windows Application Driver FAQ:
Running on a Remote Machine
Windows Application Driver can run remotely on any Windows 10 machine with WinAppDriver.exe
installed and running. This test machine can then serve any JSON wire protocol commands coming from the test runner remotely through the network. Below are the steps to the one-time setup for the test machine to receive inbound requests:
-
On the test machine you want to run the test application on, open up Windows Firewall with Advanced Security
- Select Inbound Rules -> New Rule...
- Rule Type -> Port
- Select TCP
- Choose specific local port (4723 is WinAppDriver standard)
- Action -> Allow the connection
- Profile -> select all
- Name -> optional, choose name for rule (e.g. WinAppDriver remote).
Below command when run in admin command prompt gives same result
netsh advfirewall firewall add rule name="WinAppDriver remote" dir=in action=allow protocol=TCP localport=4723
-
Run
ipconfig.exe
to determine your machine's local IP addressNote
: Setting
*
as the IP address command line option will cause it to bind to all bound IP addresses on the machine -
Run
WinAppDriver.exe 10.X.X.10 4723/wd/hub
as administrator with command line arguments as seen above specifying local IP and port -
On the test runner machine where the runner and scripts are, update the test script to point to the IP of the remote test machine
Starting the tests in the Development Machine
- Open
powertoys.sln
in Visual Studio 2017. - Build the
PowerToysTests
project. - Select
Test > Windows > Test Explorer
. - Select
Test > Run > All
tests in the menu bar.
Once the project is successfully built, you can use the TestExplorer to pick and choose the test scenario(s) to run
If Visual Studio fail to discover and run the test scenarios:
- Select Tools > Options... > Test
- Under Active Solution, uncheck For improved performance, only use test adapters in test assembly folder or as specified in runsettings file
If a remote test machine is being used, the IP of the test machine must be used to replace the WindowsApplicationDriverUrl
value in PowerToysSession.cs.
Extra tools and information
For tests creation you will need a tool that enables you select any UI element and view the element's accessibility data. For this purpose you could use AccessibilityInsights or Inspect.
inspect.exe
you can find installed atC:\Program Files (x86)\Windows Kits\10\bin\<version>\<platform>\inspect.exe
AccessibilityInsights
you can download here
How to use Inspect
Open Inspect, find element you need to investigate (by clicking on element or finding it in a tree) and in the right part of inspector window you will see info about this element.
Examples for searching elements with values of Name
, AutomationId
and ControlType
:
//use FindElementByAccessibilityId with AutomationId value
session.FindElementByAccessibilityId("40001");
session.FindElementByAccessibilityId("decrementZones");
session.FindElementByName("PowerToys Settings");
//with XPath you can search elements with more specific information
session.FindElementByXPath("//Pane[@Name=\"PowerToys Settings\"]");
session.FindElementByXPath("//Edit[contains(@Name, \"hotkey\")]");
session.FindElementByXPath("//Pane[@Name=\"PowerToys Settings\"]/*[@LocalizedControlType=\"toggleswitch\"]");
One more thing to notice: close helper tools while running tests. Overlapping windows can affect test results.