Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Page Object pattern #44

Merged
merged 47 commits into from
Oct 21, 2015
Merged

The Page Object pattern #44

merged 47 commits into from
Oct 21, 2015

Conversation

FantasticFiasco
Copy link
Collaborator

Introduction

This PR re-implements the Page Object pattern in CUITe.

The support for the pattern was previously implemented by the classes BrowserDialogUnderTest, BrowserWindowUnderTest and DynamicBrowserWindowUnderTest, but some features where lacking and no corresponding support existed for desktop applications.

Meet the CUITe.ObjectRepository Namespace

A new namespace called CUITe.ObjectRepository has been added that directly focuses on the Page Object pattern.

The following classes support tests written for the browser:

  • Page
  • PageComponent
  • PageComponent<T>

The corresponding classes for desktop are called:

  • Screen
  • ScreenComponent
  • ScreenComponent<T>

A page or screen component is a composite part of a page or a screen. If a page or screen is complex to model in a UI test, the page or screen can be divided into separate composite components, each representing a part of the UI.

E.g. a header or footer in a web application can exist on numerous pages, and by representing it as a component within the page the DRY principle can be respected. It also means that if the e.g. header change in the web application, updating the page component should be sufficient in order to pass all failing tests, since all test share the same header component.

Changes in the PR

Most of the changes in the PR are refactoring of existing UI tests to use the new classes instead of the old. Only a few classes have been added to the CUITe project, most other additions are new test projects that exercise the new Page Object classes.

Final Thoughts

This feature was one of my main goals when joining the project. I think the support for writing robust UI tests has increased with this PR. I will continue to work on a final feature called Workflows that combines common tasks spanning multiple pages or screens into unique test classes. After that I will focus on getting us ready for a official 2.0 version, but will require your help for that.

…ity of 'ScreenComponent' when it comes to HTML applications.
…ity of 'ScreenComponent' when it comes to HTML applications.
…tests for rebased page components, mainly because Silverlight not nativly supports group boxes.
/// <summary>
/// Represents a audio control for web page user interface (UI) testing.
/// </summary>
public class HtmlAudio : HtmlControl<CUITControls.HtmlAudio>
Copy link
Owner

Choose a reason for hiding this comment

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

Unfortunately, HtmlAudio is not available in Microsoft.VisualStudio.TestTools.UITesting.HtmlControls for Visual Studio 2010. Neither is HtmlMedia and HtmlSlider.

@FantasticFiasco
Copy link
Collaborator Author

I'm on it. I went to bed right after creating the PR last night.

@FantasticFiasco
Copy link
Collaborator Author

And the build is finally green. I'll continue to merge the PR as soon as you say so.

@icnocop
Copy link
Owner

icnocop commented Oct 20, 2015

Yes, you can go ahead and merge. We should try to keep the new CHANGELOG.md up to date as well. Thank you.

@FantasticFiasco
Copy link
Collaborator Author

I'll update the CHANGELOG.md before I merge. Do you wan't me to follow any specific syntax or format when I write new entries in the file? E.g. this article specifies numerous guidelines when it comes to changes, do we wish to embrace any of them?

@icnocop
Copy link
Owner

icnocop commented Oct 21, 2015

That article has some good points.

I'm flexible and open to change, but I agree there should be some consistency, and especially readability.

Thank you.

FantasticFiasco added a commit that referenced this pull request Oct 21, 2015
Merged implementation of the Page Object pattern.
@FantasticFiasco FantasticFiasco merged commit 8952b41 into icnocop:master Oct 21, 2015
@FantasticFiasco FantasticFiasco deleted the page-and-screen-objects branch October 21, 2015 21:15
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.

2 participants