GithubHelp home page GithubHelp logo

made-apps / legerity Goto Github PK

View Code? Open in Web Editor NEW
68.0 9.0 13.0 36.34 MB

A framework for speeding up the development of automated UI tests for Windows, Android, iOS, and Web with Appium/Selenium on .NET

Home Page: https://made-apps.github.io/legerity/

License: MIT License

C# 99.88% PowerShell 0.12%
appium winappdriver pageobject-pattern uwp xamarin selenium ui-testing ios android testing

legerity's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar jamesmcroft avatar tom-made avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

legerity's Issues

[Feature] Documentation re-write

Describe the feature

To improve the quality of the documentation and structure, the content needs an overhaul.

Rationale for the feature

The documentation for Legerity, while providing a lot of information, is difficult to follow based on the current structure. It's not entirely clear how to get started, and how to take advantage of the features.

Scope of the feature

  • Introduction to Legerity
  • Getting started guide
  • Quick starts
    • Windows
    • Android
    • iOS
    • Web
    • Cross Platform
  • Using Legerity guide
    • Installation
    • Legerity test framework usages
    • Legerity test class usage
    • App manager usage
    • Element wrapper usage
    • Page object usage
    • By locator usages
    • Wait condition usages

Open questions

No response

Other information

The evolution of the docs is being tracked in the feature/docs branch.

[Feature] Android Button element

Description

Button is a commonly used core Android control that supports the ability to cause an action when clicked.

The implementation should provide the following functionality:

  • Get enabled state
  • Click

[Feature] Page object generation for Vue.js files

Describe the feature

Based on the available HTML element wrappers, there should be capabilities to generate page objects based on a set of Vue files provided.

Rationale for the feature

To improve the usability of the page object generation tool to support Vue files

Scope of the feature

  • Ability to generate page objects from Vue files based on the currently available web element wrappers

Open questions

No response

Other information

No response

[Bug] Chrome browser maximise function can cause tests to fail indefinitely

Describe the bug

In a UI test project using NUnit and Legerity, it's possible to get the test runner to continue to run forever (or pipeline timeout when run in CI) if the maximise function fails in the StartApp method.

This occurs due to the app driver having been started but it can't be disposed of as it isn't returned if it fails.

What is the expected behavior?

If the driver launches but fails to correctly configure, it should be disposed of and an exception thrown up to the calling method.

Package

Core

Other information

No response

[Feature] WinUI TabView element

Description

Add support for the WinUI TabView element.

Support available for:

  • TabListView (ListView)
    • ListViewItem incl. CloseButton
  • AddButton
  • Selected item

[Feature] Android CheckBox element

Description

CheckBox is a commonly used core Android control that supports the ability to make one or multiple selections.

The implementation should provide the following functionality:

  • Get checked state
  • Check on/off

[Feature] Android DatePicker element

Description

DatePicker is a commonly used core Android control that supports the ability to select a date value.

The implementation should provide the following functionality:

  • Get selected date
  • Set selected date

[Feature] Upgrade to Selenium 4

Describe the feature

Simply, upgrading the current support for Selenium from 3 to 4.

Rationale for the feature

Noticed in the latest PR build (aab3633#annotation_7550536556)

Selenium NuGet packages are now a major version up with 4.7.0 and appears that this has been available since late 2021.

Adoption appears relatively high so we should look to upgrade and support the latest version.

Scope of the feature

  • Must upgrade to support Selenium 4.x

Open questions

No response

Other information

No response

[Feature] Web - Ability to interact with file type input elements

Describe the feature and how it will be used

Should provide the capability to interact with a <input type="file" /> element.

Example

As the file input takes advantage of a button that activates a native OS experience for uploading a file, this would need to be handled in a different way.

The suggestion is to allow an automated test to input an absolute file path using the SendKeys method.

Would suggest the naming convention follows other web elements, FileInput

[Bug] Improve speed of retrieving web Table data rows

Describe the bug

Retrieving web table data rows using the DataRows property takes a long time to resolve as it requires a check on every row to determine whether it has header elements in it.

What is the expected behavior?

Should data rows in a reasonable amount of time for the size of table data.

Should expect sub 10 seconds (current baseline is 24 seconds for a table of 6 data rows)

Package

Web

Other information

No response

[Feature] Web Table element

Describe the feature and how it will be used

Based on the <table> element and the supporting table row, header, and cell tags, create an element wrappers for this web component.

The element wrapper would expose the columns and rows of the table in an easy to query format.

[Bug] Cross-platform tests are not consistent

Describe the bug

Hi, first thanks for your effort with this project it really seems like I can optimize my UI tests with it. Second, I'm trying to test sample MAUI app and unfortunately my basic test is failing on Windows, but running fine on Android and I'm yet to try iOS.

image

 Message: 
OpenQA.Selenium.WebDriverException : An element could not be located on the page using the given search parameters.

  Stack Trace: 
RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
AppiumDriver`1.Execute(String driverCommandToExecute, Dictionary`2 parameters)
RemoteWebDriver.FindElement(String mechanism, String value)
RemoteWebDriver.FindElementByXPath(String xpath)
<>c__DisplayClass19_0.<XPath>b__0(ISearchContext context)
By.FindElement(ISearchContext context)
RemoteWebDriver.FindElement(By by)
<>c__DisplayClass32_0.<AttemptWaitForDriverElement>b__0(IWebDriver driver)
DefaultWait`1.Until[TResult](Func`2 condition)
BasePage.AttemptWaitForDriverElement(By locator, TimeSpan timeout, IWebDriver appDriver)
BasePage.VerifyPageShown(Nullable`1 timeout)
BasePage.ctor(RemoteWebDriver app, Nullable`1 traitTimeout)
BasePage.ctor()
MainPageBase.ctor()
WinMainPage.ctor()
MainPageTest.ctor(UiTestFixture fixtureBase) line 9

I've looked at the samples and figured I have to use different methods for constructing the test page depending on a platform, so I did this

public class MainPage : MainPageBase
{
    protected override By GetBy(string id) => By.Id(id);

    protected override IWebElement GetElement(string id) => FindElement(By.Id(id));
}

public class WinMainPage : MainPageBase
{
    
    protected override By GetBy(string id) => WindowsByExtras.AutomationId(id);
    protected override IWebElement GetElement(string id) => this.WindowsApp.FindElement(GetBy(id));
}

public abstract class MainPageBase : BasePage
{

    protected override By Trait => GetBy("MainPage");
    public IWebElement Button => GetElement("button");
    protected abstract By GetBy(string id);
    protected abstract IWebElement GetElement(string id) ;
}

What is the expected behavior?

Test is able to discover an element using its AutomationId across multiple platforms using a single method e.g. By.Id(automationId)

Package

No response

Other information

You can find repro here https://github.com/anpin/maui_ui_tests

[Feature] WCT BladeView element

Description

Add support for the Windows Community Toolkit BladeView element.

The implementation should support the collection of BladeItem children with the ability to close them or expand/collapse them depending on the features.

[Feature] WinUI: InfoBar control

Description

InfoBar is currently moving towards preview as indicated by this PR.

How will this benefit you and others?

This will make it easier to deal with the PagerControl in testing.

[Feature] WCT OrbitView element

Description

Add support for the Windows Community Toolkit OrbitView element.

The implementation should support the collection of child items with the ability to click them.

The OrbitView is based on an ItemsControl so the implementation for this may be similar to GridView or ListView which currently exist in this framework.

[Feature] WinUI: PagerControl

Description

PagerControl is currently moving towards preview as indicated by this PR.

How will this benefit you and others?

This will make it easier to deal with the PagerControl in testing.

[Feature] `WindowsAppManagerOptions` to have option to "Wait/retry" for applicaiton to start/attach

As can be seen by searching the web,
There is a need to "Wait For" a windows application to start (Especially in CPU resource limited CI build machines)

I have found the ms:waitForAppLaunch but that is more like a Pause and not a wait / retry for app start.

What I need is either a way to use WindowsAppManagerOptions to attach to an already running instance (So thread wait / repeat until style code) can be done

Or for the WindowsAppManagerOptions to take a parameter, so when it is performing the attach, it is waiting for the app window to become available

[Feature] Update existing web elements with constructor for IWebElement

Describe the feature and how it will be used

The element returned by a Find query in the RemoteWebDriver is an IWebElement. There should be a default constructor for all web elements that allow this element as a parameter.

This will allow the element wrappers to be constructed as follows:

TextInput text = new TextInput(AppManager.WebApp.FindElementByTagName("input"));

[Feature] Visual Studio extension for creating UI test page object for Windows XAML

Describe the feature and how it will be used

An aspirational feature that would allow a developer to right-click on a Windows XAML file within Visual Studio and generate a UI test page object using Legerity wrapper elements.

This extension would scan the file, pulling out relevant detail to build up the C# class for the page including queries and potential interactions.

[Feature] Decouple AppManager from page object and elements

Describe the feature

To improve the use of the setup for running an application under a UI test, changes need to be made to decouple the static AppManager.App instance usage across the Legerity page objects and elements.

For elements, the WrappedDriver property should instead be used for referencing to get additional sub-UI elements.

The AppManager will need updating to provide capabilities to retrieve an instance of the driver that is initialized. This implementation needs to reduce the impact of breaking changes to existing test projects using Legerity while providing the capability to be expanded on in the future.

Rationale for the feature

To improve maintenance, scalability, and overall testability of UI test projects using Legerity.

Scope of the feature

Must - Decouple the AppManager.App instance from core Legerity code

Open questions

No response

Other information

No response

[Feature] Android ToggleButton element

Description

ToggleButton is a commonly used core Android control which supports the ability to toggle the on/off state, similar to a Switch.

The implementation should provide the following functionality:

  • Get whether the toggle is on
  • Set on/off state

[Feature] Android TimePicker element

Description

TimePicker is a commonly used core Android control that supports the ability to select a time.

The implementation should provide the following functionality:

  • Get selected time
  • Set selected time

[Feature] UWP MediaPlayerElement element

Description

Add support for the UWP MediaPlayerElement element.

The implementation should support the transport controls:

  • MediaElement
  • ProgressSlider (Slider)
    • DownloadProgressIndicator (ProgressBar)
  • MediaControlsCommandBar
    • Volume
      • Mute (AppBarButton)
      • Volume (Slider)
    • Play/Pause
    • Aspect Ratio
    • Cast to Device
    • Full Screen

[Feature] Migrate to GitHub Actions

Describe the feature and how it will be used

This change would move the CI/CD pipeline away from using Azure Pipelines in favor of GitHub actions.

CI changes could be deployed to packages in the project, releases could be automated, and publishes to NuGet could be controlled using release branches/tags.

[Feature] WCT RadialGauge element

Description

Add support for the Windows Community Toolkit RadialGauge element.

The implementation should support the ability to interact with the gauge if in the interactive state.

[Feature] Google login page object

Describe the feature

To introduce a Legerity page object to interact with the authentication flow for Google accounts.

image

Rationale for the feature

In Legerity 0.12, a new Legerity.Web.Authentication library was introduced to make it easier to interact with login pages across common identity platforms.

The Azure AD login page was introduced as part of the release. Let's expand that to include others too!

Scope of the feature

Capability Priority
Ability to login with Google username and password Must

Open questions

  • Is it possible to explore the best cases for managing authentication where 2FA is enabled? Obviously 2FA cannot be bypassed but is there any requirement needed to handle the screens for 2FA

Other information

No response

[Feature] Web - Ability to interact with img elements

Describe the feature and how it will be used

Should provide the capability to interact with a <img /> element.

Example

The solution should provide the capability of retrieving the image source, the element's size, and alt text.

Would suggest the naming of the element be Image

[Feature] Web - Ability to interact with select elements

Describe the feature and how it will be used

Should provide the capability to interact with a <select /> element.

Example

This addition will include 2 new elements, one for the <select /> element and another for the child <option /> element.

The element should have the ability to select an item by value, get whether the select is in a multi state, and get the selected value(s).

Would suggest the naming Select and Option to match the web element name.

[Feature] WinUI NavigationView improvements

Description

Add improvements to the current NavigationView implementation from the WinUI components.

Add support for:

  • NavigationViewBackButton
  • TogglePaneButton (Open Navigation)
  • SettingsNavPaneItem (Settings Option)
  • ChildrenFlyout (Menu option with sub-options)

[Feature] Split out core & platform components

Describe the feature and how it will be used

Currently, if you want to get started with Legerity, you would install the main NuGet package.

This package contains all of the core Legerity functionality, plus the additional per platform core elements for Windows, Android, iOS, and Web.

When writing tests, this can make it confusing to know which elements are for which platform without knowing the element or knowing what namespace they are in.

The proposal is to split out the core into a Core package and then split out each individual platform core into their own package. This will allow developers to pick and choose the components they need for their applications.

The Legerity package will become a meta-package that installs all of the core components as the package currently exists today.

[Feature] UWP ContentDialog element

Describe the feature and how it will be used

Add support for the UWP ContentDialog element.

The implementation should support the Primary, Secondary, and Close buttons.

  • Create element wrapper
  • Add tests
  • Update documentation

[Feature] .NET templates for creating new Legerity UI test projects

Describe the feature

A user would have the ability to create a new Legerity UI test project for a specific platform which would scaffold the required components to start building out UI tests quickly for their applications.

Rationale for the feature

This feature is designed to improve the speed of adoption for creating UI tests by reducing the barrier to entry setting up and configuring a .NET test project and the boilerplate logic required for Legerity.

Scope of the feature

  • A mechanism for running dotnet new <template> that will scaffold, initially, an NUnit configured test project with:
    • Latest Legerity packages installed for the specific platform associated with the template
    • Legerity root level folder structure (Elements, Pages, Tests)
    • Abstract BaseTestClass created implementing the LegerityTestClass with default configuration setup for running against the platform associated with the template (e.g. configurations for Windows, Android, iOS, Web, Cross Platform)
  • Templates for:
    • Windows
    • Android
    • iOS
    • Web
    • Cross Platform

Open questions

No response

Other information

No response

[Feature] Page object generation for HTML files

Describe the feature

Based on the available HTML element wrappers, there should be capabilities to generate page objects based on a set of HTML files provided.

Rationale for the feature

To improve the usability of the page object generation tool to support HTML files

Scope of the feature

  • Ability to generate page objects from HTML files based on the currently available web element wrappers

Open questions

No response

Other information

No response

[Feature] Android EditText element

Description

EditText is a commonly used core Android control which supports the input of text.

The implementation should provide the following functionality:

  • Get text value
  • Get read-only value
  • Set text
  • Append text
  • Clear text

[Feature] WinUI DropDownButton element

Describe the feature and how it will be used

Add support for the WinUI DropDownButton element.

The implementation should support the collection of MenuFlyoutItem children with the ability to click them.

[Feature] Android Switch element

Description

Switch is a commonly used core Android control that supports the ability to toggle a state on or off.

The implementation should provide the following functionality:

  • Get on/off state
  • Check on/off

[Feature] WinUI NumberBox element

Description

Add support for the WinUI NumberBox element.

Should provide support for:

  • IsReadOnly
  • Maximum
  • Minimum
  • Step
  • Value
  • UpSpinButton (Increment button)
  • DownSpinButton (Decrement button)

[Feature] Android ProgressBar element

Description

ProgressBar is a commonly used core Android control that supports the ability to track the progress of actions as a percentage.

The implementation should provide the following functionality:

  • Get percentage
  • Get whether is indeterminate

[Feature] Android Slider element

Description

Slider is a commonly used core Android control that supports the ability to select a value from a range slider.

The implementation should provide the following functionality:

  • Get minimum value
  • Get maximum value
  • Get selected value
  • Get whether is readonly
  • Set selected value

[Feature] Android RadioButton element

Description

RadioButton is a commonly used core Android control that supports the ability to make a single selection from multiple.

The implementation should provide the following functionality:

  • Get selected state
  • Select a button

[Feature] Facebook login page object

Describe the feature

To introduce a Legerity page object to interact with the authentication flow for Facebook accounts.

Rationale for the feature

In Legerity 0.12, a new Legerity.Web.Authentication library was introduced to make it easier to interact with login pages across common identity platforms.

The Azure AD login page was introduced as part of the release. Let's expand that to include others too!

Scope of the feature

Capability Priority
Ability to login with Facebook username and password Must

Open questions

No response

Other information

No response

[Feature] WinUI MenuBar element

Description

Add support for the WinUI MenuBar element.

The implementation should support the collection of MenuBarItem children with the ability to click them.

Support should also be available for MenuFlyoutItem and MenuFlyoutSubItem child elements.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.