mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 04:07:40 +02:00
Tests updates (#1793)
* updated tests for v0.16.0 Co-Authored-By: Yevhenii Holovachov <55396981+yevhenii44@users.noreply.github.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using OpenQA.Selenium.Appium;
|
||||
using OpenQA.Selenium.Appium.Windows;
|
||||
using OpenQA.Selenium.Interactions;
|
||||
|
||||
@@ -55,10 +56,12 @@ namespace PowerToysTests
|
||||
trayButton.Click();
|
||||
isTrayOpened = true;
|
||||
|
||||
WindowsElement pt = session.FindElementByName("PowerToys");
|
||||
Assert.IsNotNull(pt);
|
||||
WindowsElement notificationOverflow = session.FindElementByName("Notification Overflow");
|
||||
AppiumWebElement overflowArea = notificationOverflow.FindElementByName("Overflow Notification Area");
|
||||
AppiumWebElement powerToys = overflowArea.FindElementByName("PowerToys");
|
||||
Assert.IsNotNull(powerToys);
|
||||
|
||||
new Actions(session).MoveToElement(pt).ContextClick().Perform();
|
||||
new Actions(session).MoveToElement(powerToys).ContextClick().Perform();
|
||||
ShortWait();
|
||||
|
||||
//exit
|
||||
@@ -66,10 +69,12 @@ namespace PowerToysTests
|
||||
ShortWait();
|
||||
|
||||
//check PowerToys exited
|
||||
pt = null;
|
||||
powerToys = null;
|
||||
try
|
||||
{
|
||||
pt = session.FindElementByName("PowerToys");
|
||||
notificationOverflow = session.FindElementByName("Notification Overflow");
|
||||
overflowArea = notificationOverflow.FindElementByName("Overflow Notification Area");
|
||||
powerToys = overflowArea.FindElementByName("PowerToys");
|
||||
}
|
||||
catch (OpenQA.Selenium.WebDriverException)
|
||||
{
|
||||
@@ -79,7 +84,7 @@ namespace PowerToysTests
|
||||
LaunchPowerToys();
|
||||
ShortWait();
|
||||
|
||||
Assert.IsNull(pt);
|
||||
Assert.IsNull(powerToys);
|
||||
}
|
||||
|
||||
[ClassInitialize]
|
||||
|
||||
Reference in New Issue
Block a user