Skip to content
This repository has been archived by the owner on Oct 4, 2021. It is now read-only.

Test framework #875

Merged
merged 12 commits into from Apr 15, 2015
Merged

Test framework #875

merged 12 commits into from Apr 15, 2015

Conversation

iainx
Copy link
Contributor

@iainx iainx commented Apr 14, 2015

The basics of the test framework:

Currently supports
Operations: Type, Property, Model, Marked, Text, NextSiblings, Index
Actions: Select, Click, TypeKey, Toggle

Moved waiting for timers/counters into the MD process, rather than creating a proxy MarshalByRef remote object for the counter.

Added an attribute that can be used to add metadata about GtkTreeModels. It can either be added to a class, or to an instance.

Still needs done:

  • Cocoa support
  • Need a better solution for AutoTestSession.IsBuildSuccessful. It seems too specific to be in the AutoTestSession. Maybe a more generic way to check the error count?
  • The use of GetGlobalValue seems wrong. We need to work out a less generic "access anything you want" way.

iain holmes added 9 commits April 14, 2015 14:39
Updated the test framework to support the current set of UI Tests
The order of results matters for some operations and actions (for example NextSiblings,
Index) so we need to store results in an ordered collection. As we insert in order and
iterate the collection completely in order anyway, there shouldn't be a performance hit
NextSiblings operation can return any siblings that come after the current result
Add an index operation to get a specific index from a result set
Put RunAndWaitForTimer into the AutoTestClientSession, and use it instead of
Thread.Sleep to know when the solution has been loaded
Instead of passing the TimerCounters across the wire as MarshalByRefObjects and
accessing them directly by properties, wrap operations that need to be waited on
in a timer context, and do all the waiting on the MonoDevelop side
}

public bool SelectTemplateType (string type, string category)
{
return Session.SelectTreeviewItem ("templateCategoriesTreeView", type, category);
return Session.SelectElement (c => c.TreeView ().Marked ("templateCategoriesTreeView").Model ("templateCategoriesListStore__Name").Text (type));
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This would not work for non-MD templates.

Can you update this to use category too such that if we have

  • Cross-platform
    • App
    • Tests
  • Mac
    • App
    • Tests

and type is "App" and category is "Mac", then this would select "App" under "Cross-platform" instead of under "Mac"

If you have

[Test]
public void TestAndroidUITest ()
{
    CreateBuildProject ("DroidApp", "Android App", "App", "Android", EmptyAction);
}

then it fails at the line 103 of SelectTemplate

Assert.IsTrue (newProject.SelectTemplate (kind));

since newProject.SelectTemplateType (category, categoryRoot) selected App under different category

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed this, although I'm not entirely happy with the method.

The problem is that in the model the category name is marked up as Mac, so simply doing a Text operation with "Mac" fails and I don't want to require the test writer to know how the markup is written.

I've added a Contains operation, which is similar to Text but does not require an exact match.

We'll need to revisit this after I get back, but this should be enough to get it working in the meantime.

@monojenkins
Copy link
Contributor

Hello! I'm the build bot for the Mono project. I need approval from a Mono team member to build this pull request. A team member should reply with "approve" to approve a build of this pull request, "whitelist" to whitelist this and all future pull requests from this contributor, or "build" to explicitly request a build, even if one has already been done. Contributors can ignore this message.

1 similar comment
@monojenkins
Copy link
Contributor

Hello! I'm the build bot for the Mono project. I need approval from a Mono team member to build this pull request. A team member should reply with "approve" to approve a build of this pull request, "whitelist" to whitelist this and all future pull requests from this contributor, or "build" to explicitly request a build, even if one has already been done. Contributors can ignore this message.

@Therzok
Copy link
Contributor

Therzok commented Apr 14, 2015

whitelist

@slluis
Copy link
Member

slluis commented Apr 14, 2015

Operation classes are placed in the wrong directory. Instead of:

MonoDevelop.Components.AutoTest\MonoDevelop.Components.AutoTest.Operations\Operation.cs

It should be:

MonoDevelop.Components.AutoTest.Operations\Operation.cs

iain holmes added 2 commits April 15, 2015 11:24
Contains is like Text but doesn't have to match exactly.
@iainx
Copy link
Contributor Author

iainx commented Apr 15, 2015

@slluis I've moved the Operations and Results subdirectories.

@slluis
Copy link
Member

slluis commented Apr 15, 2015

Looks good.

slluis added a commit that referenced this pull request Apr 15, 2015
@slluis slluis merged commit d570d03 into master Apr 15, 2015
@Therzok Therzok deleted the test-framework branch July 13, 2015 11:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants