mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-17 23:56:56 +00:00
test(BRIDGE-220): Add Bridge E2E UI login/logout tests for Windows
This commit is contained in:
@ -1,5 +1,8 @@
|
||||
using FlaUI.Core.AutomationElements;
|
||||
using FlaUI.Core.Definitions;
|
||||
using FlaUI.Core.Conditions;
|
||||
using FlaUI.Core.Input;
|
||||
using ProtonMailBridge.UI.Tests.TestsHelper;
|
||||
using System;
|
||||
|
||||
|
||||
@ -8,10 +11,14 @@ namespace ProtonMailBridge.UI.Tests.Windows
|
||||
public class HomeWindow : UIActions
|
||||
{
|
||||
private AutomationElement[] AccountViewButtons => AccountView.FindAllChildren(cf => cf.ByControlType(ControlType.Button));
|
||||
private AutomationElement[] HomeButtons => Window.FindAllDescendants(cf => cf.ByControlType(ControlType.Button));
|
||||
private Button AddNewAccountButton => HomeButtons[6].AsButton();
|
||||
private Button RemoveAccountButton => AccountViewButtons[1].AsButton();
|
||||
private AutomationElement RemoveAccountConfirmModal => Window.FindFirstDescendant(cf => cf.ByControlType(ControlType.Window));
|
||||
private Button ConfirmRemoveAccountButton => RemoveAccountConfirmModal.FindFirstDescendant(cf => cf.ByControlType(ControlType.Button).And(cf.ByName("Remove this account"))).AsButton();
|
||||
private Button SignOutButton => AccountView.FindFirstDescendant(cf => cf.ByControlType(ControlType.Button).And(cf.ByName("Sign out"))).AsButton();
|
||||
private Button SignInButton => AccountView.FindFirstDescendant(cf => cf.ByControlType(ControlType.Button).And(cf.ByName("Sign in"))).AsButton();
|
||||
|
||||
public HomeWindow RemoveAccount()
|
||||
{
|
||||
try
|
||||
@ -25,10 +32,23 @@ namespace ProtonMailBridge.UI.Tests.Windows
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public HomeWindow AddNewAccount ()
|
||||
{
|
||||
AddNewAccountButton.Click();
|
||||
return this;
|
||||
}
|
||||
|
||||
public HomeWindow SignOutAccount()
|
||||
{
|
||||
SignOutButton.Click();
|
||||
return this;
|
||||
}
|
||||
public HomeWindow ClickSignInMainWindow()
|
||||
{
|
||||
SignInButton.Click();
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user