mohawk 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +24 -17
- data/.travis.yml +2 -0
- data/Changelog +36 -20
- data/Gemfile +3 -3
- data/Guardfile +16 -0
- data/LICENSE.txt +21 -21
- data/README.md +60 -56
- data/Rakefile +18 -18
- data/features/control.feature +5 -0
- data/features/label.feature +4 -4
- data/features/link.feature +9 -0
- data/features/mohawk.feature +4 -1
- data/features/navigation.feature +9 -0
- data/features/step_definitions/control_steps.rb +3 -0
- data/features/step_definitions/label_steps.rb +3 -3
- data/features/step_definitions/link_steps.rb +3 -0
- data/features/step_definitions/mohawk_steps.rb +4 -0
- data/features/step_definitions/navigation_steps.rb +15 -0
- data/features/step_definitions/table_steps.rb +19 -3
- data/features/step_definitions/tree_view_steps.rb +4 -0
- data/features/support/WindowsForms.exe +0 -0
- data/features/support/app/WindowsForms/WindowsForms/AboutBox.Designer.cs +80 -0
- data/features/support/app/WindowsForms/WindowsForms/AboutBox.cs +103 -0
- data/features/support/app/WindowsForms/WindowsForms/AboutBox.resx +120 -0
- data/features/support/app/WindowsForms/WindowsForms/AutomatableMonthCalendar.cs +59 -0
- data/features/support/app/WindowsForms/WindowsForms/AutomationHelpers/AutomationProvider.cs +91 -0
- data/features/support/app/WindowsForms/WindowsForms/DataEntryForm.Designer.cs +187 -0
- data/features/support/app/WindowsForms/WindowsForms/DataEntryForm.cs +46 -0
- data/features/support/app/WindowsForms/WindowsForms/DataEntryForm.resx +120 -0
- data/features/support/app/WindowsForms/WindowsForms/MainFormWindow.Designer.cs +526 -0
- data/features/support/app/WindowsForms/WindowsForms/MainFormWindow.cs +93 -0
- data/features/support/app/WindowsForms/WindowsForms/MainFormWindow.resx +123 -0
- data/features/support/app/WindowsForms/WindowsForms/PersonForm.Designer.cs +119 -0
- data/features/support/app/WindowsForms/WindowsForms/PersonForm.cs +34 -0
- data/features/support/app/WindowsForms/WindowsForms/PersonForm.resx +120 -0
- data/features/support/app/WindowsForms/WindowsForms/Program.cs +21 -0
- data/features/support/app/WindowsForms/WindowsForms/Properties/AssemblyInfo.cs +36 -0
- data/features/support/app/WindowsForms/WindowsForms/Properties/Resources.Designer.cs +71 -0
- data/features/support/app/WindowsForms/WindowsForms/Properties/Resources.resx +117 -0
- data/features/support/app/WindowsForms/WindowsForms/Properties/Settings.Designer.cs +30 -0
- data/features/support/app/WindowsForms/WindowsForms/Properties/Settings.settings +7 -0
- data/features/support/app/WindowsForms/WindowsForms/SimpleElementsForm.Designer.cs +93 -0
- data/features/support/app/WindowsForms/WindowsForms/SimpleElementsForm.cs +19 -0
- data/features/support/app/WindowsForms/WindowsForms/SimpleElementsForm.resx +120 -0
- data/features/support/app/WindowsForms/WindowsForms/WindowsForms.csproj +132 -0
- data/features/support/app/WindowsForms/WindowsForms.sln +30 -0
- data/features/support/env.rb +28 -17
- data/features/support/screens/about_screen.rb +7 -0
- data/features/support/screens/data_entry_form.rb +5 -0
- data/features/support/screens/main_screen.rb +3 -0
- data/features/table.feature +14 -0
- data/features/tree_view.feature +3 -0
- data/lib/mohawk/accessors/button.rb +6 -4
- data/lib/mohawk/accessors/checkbox.rb +7 -5
- data/lib/mohawk/accessors/combo.rb +7 -5
- data/lib/mohawk/accessors/control.rb +23 -0
- data/lib/mohawk/accessors/label.rb +15 -13
- data/lib/mohawk/accessors/link.rb +9 -0
- data/lib/mohawk/accessors/radio.rb +5 -3
- data/lib/mohawk/accessors/table.rb +12 -31
- data/lib/mohawk/accessors/table_row.rb +43 -0
- data/lib/mohawk/accessors/text.rb +7 -5
- data/lib/mohawk/accessors/tree_view.rb +9 -7
- data/lib/mohawk/accessors.rb +66 -7
- data/lib/mohawk/adapters/uia_adapter.rb +8 -0
- data/lib/mohawk/core_ext/string.rb +5 -0
- data/lib/mohawk/navigation.rb +6 -2
- data/lib/mohawk/version.rb +3 -3
- data/lib/mohawk.rb +76 -69
- data/mohawk.gemspec +32 -26
- data/spec/lib/mohawk/accessors/button_spec.rb +4 -0
- data/spec/lib/mohawk/accessors/checkbox_spec.rb +4 -1
- data/spec/lib/mohawk/accessors/combo_spec.rb +3 -0
- data/spec/lib/mohawk/accessors/control_spec.rb +38 -0
- data/spec/lib/mohawk/accessors/label_spec.rb +29 -25
- data/spec/lib/mohawk/accessors/link_spec.rb +34 -0
- data/spec/lib/mohawk/accessors/radio_spec.rb +4 -0
- data/spec/lib/mohawk/accessors/table_spec.rb +52 -7
- data/spec/lib/mohawk/accessors/text_spec.rb +4 -0
- data/spec/lib/mohawk/accessors/tree_view_spec.rb +5 -0
- data/spec/lib/mohawk_spec.rb +19 -0
- data/spec/lib/navigation_spec.rb +5 -0
- metadata +175 -6
@@ -0,0 +1,30 @@
|
|
1
|
+
//------------------------------------------------------------------------------
|
2
|
+
// <auto-generated>
|
3
|
+
// This code was generated by a tool.
|
4
|
+
// Runtime Version:4.0.30319.1
|
5
|
+
//
|
6
|
+
// Changes to this file may cause incorrect behavior and will be lost if
|
7
|
+
// the code is regenerated.
|
8
|
+
// </auto-generated>
|
9
|
+
//------------------------------------------------------------------------------
|
10
|
+
|
11
|
+
namespace WindowsForms.Properties
|
12
|
+
{
|
13
|
+
|
14
|
+
|
15
|
+
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
16
|
+
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
|
17
|
+
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
18
|
+
{
|
19
|
+
|
20
|
+
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
21
|
+
|
22
|
+
public static Settings Default
|
23
|
+
{
|
24
|
+
get
|
25
|
+
{
|
26
|
+
return defaultInstance;
|
27
|
+
}
|
28
|
+
}
|
29
|
+
}
|
30
|
+
}
|
@@ -0,0 +1,93 @@
|
|
1
|
+
namespace WindowsForms
|
2
|
+
{
|
3
|
+
partial class SimpleElementsForm
|
4
|
+
{
|
5
|
+
/// <summary>
|
6
|
+
/// Required designer variable.
|
7
|
+
/// </summary>
|
8
|
+
private System.ComponentModel.IContainer components = null;
|
9
|
+
|
10
|
+
/// <summary>
|
11
|
+
/// Clean up any resources being used.
|
12
|
+
/// </summary>
|
13
|
+
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
14
|
+
protected override void Dispose(bool disposing)
|
15
|
+
{
|
16
|
+
if (disposing && (components != null))
|
17
|
+
{
|
18
|
+
components.Dispose();
|
19
|
+
}
|
20
|
+
base.Dispose(disposing);
|
21
|
+
}
|
22
|
+
|
23
|
+
#region Windows Form Designer generated code
|
24
|
+
|
25
|
+
/// <summary>
|
26
|
+
/// Required method for Designer support - do not modify
|
27
|
+
/// the contents of this method with the code editor.
|
28
|
+
/// </summary>
|
29
|
+
private void InitializeComponent()
|
30
|
+
{
|
31
|
+
this.button1 = new System.Windows.Forms.Button();
|
32
|
+
this.button2 = new System.Windows.Forms.Button();
|
33
|
+
this.textBox1 = new System.Windows.Forms.TextBox();
|
34
|
+
this.textBox2 = new System.Windows.Forms.TextBox();
|
35
|
+
this.SuspendLayout();
|
36
|
+
//
|
37
|
+
// button1
|
38
|
+
//
|
39
|
+
this.button1.Location = new System.Drawing.Point(12, 12);
|
40
|
+
this.button1.Name = "button1";
|
41
|
+
this.button1.Size = new System.Drawing.Size(75, 23);
|
42
|
+
this.button1.TabIndex = 0;
|
43
|
+
this.button1.Text = "button1";
|
44
|
+
this.button1.UseVisualStyleBackColor = true;
|
45
|
+
//
|
46
|
+
// button2
|
47
|
+
//
|
48
|
+
this.button2.Location = new System.Drawing.Point(12, 41);
|
49
|
+
this.button2.Name = "button2";
|
50
|
+
this.button2.Size = new System.Drawing.Size(75, 23);
|
51
|
+
this.button2.TabIndex = 1;
|
52
|
+
this.button2.Text = "button2";
|
53
|
+
this.button2.UseVisualStyleBackColor = true;
|
54
|
+
//
|
55
|
+
// textBox1
|
56
|
+
//
|
57
|
+
this.textBox1.Location = new System.Drawing.Point(12, 96);
|
58
|
+
this.textBox1.Name = "textBox1";
|
59
|
+
this.textBox1.Size = new System.Drawing.Size(100, 20);
|
60
|
+
this.textBox1.TabIndex = 2;
|
61
|
+
//
|
62
|
+
// textBox2
|
63
|
+
//
|
64
|
+
this.textBox2.Location = new System.Drawing.Point(12, 70);
|
65
|
+
this.textBox2.Name = "textBox2";
|
66
|
+
this.textBox2.Size = new System.Drawing.Size(100, 20);
|
67
|
+
this.textBox2.TabIndex = 3;
|
68
|
+
this.textBox2.Text = "Enter some text";
|
69
|
+
//
|
70
|
+
// SimpleElementsForm
|
71
|
+
//
|
72
|
+
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
73
|
+
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
74
|
+
this.ClientSize = new System.Drawing.Size(184, 273);
|
75
|
+
this.Controls.Add(this.textBox2);
|
76
|
+
this.Controls.Add(this.textBox1);
|
77
|
+
this.Controls.Add(this.button2);
|
78
|
+
this.Controls.Add(this.button1);
|
79
|
+
this.Name = "SimpleElementsForm";
|
80
|
+
this.Text = "SimpleElementsForm";
|
81
|
+
this.ResumeLayout(false);
|
82
|
+
this.PerformLayout();
|
83
|
+
|
84
|
+
}
|
85
|
+
|
86
|
+
#endregion
|
87
|
+
|
88
|
+
private System.Windows.Forms.Button button1;
|
89
|
+
private System.Windows.Forms.Button button2;
|
90
|
+
private System.Windows.Forms.TextBox textBox1;
|
91
|
+
private System.Windows.Forms.TextBox textBox2;
|
92
|
+
}
|
93
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
using System;
|
2
|
+
using System.Collections.Generic;
|
3
|
+
using System.ComponentModel;
|
4
|
+
using System.Data;
|
5
|
+
using System.Drawing;
|
6
|
+
using System.Linq;
|
7
|
+
using System.Text;
|
8
|
+
using System.Windows.Forms;
|
9
|
+
|
10
|
+
namespace WindowsForms
|
11
|
+
{
|
12
|
+
public partial class SimpleElementsForm : Form
|
13
|
+
{
|
14
|
+
public SimpleElementsForm()
|
15
|
+
{
|
16
|
+
InitializeComponent();
|
17
|
+
}
|
18
|
+
}
|
19
|
+
}
|
@@ -0,0 +1,120 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<root>
|
3
|
+
<!--
|
4
|
+
Microsoft ResX Schema
|
5
|
+
|
6
|
+
Version 2.0
|
7
|
+
|
8
|
+
The primary goals of this format is to allow a simple XML format
|
9
|
+
that is mostly human readable. The generation and parsing of the
|
10
|
+
various data types are done through the TypeConverter classes
|
11
|
+
associated with the data types.
|
12
|
+
|
13
|
+
Example:
|
14
|
+
|
15
|
+
... ado.net/XML headers & schema ...
|
16
|
+
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
17
|
+
<resheader name="version">2.0</resheader>
|
18
|
+
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
19
|
+
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
20
|
+
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
21
|
+
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
22
|
+
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
23
|
+
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
24
|
+
</data>
|
25
|
+
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
26
|
+
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
27
|
+
<comment>This is a comment</comment>
|
28
|
+
</data>
|
29
|
+
|
30
|
+
There are any number of "resheader" rows that contain simple
|
31
|
+
name/value pairs.
|
32
|
+
|
33
|
+
Each data row contains a name, and value. The row also contains a
|
34
|
+
type or mimetype. Type corresponds to a .NET class that support
|
35
|
+
text/value conversion through the TypeConverter architecture.
|
36
|
+
Classes that don't support this are serialized and stored with the
|
37
|
+
mimetype set.
|
38
|
+
|
39
|
+
The mimetype is used for serialized objects, and tells the
|
40
|
+
ResXResourceReader how to depersist the object. This is currently not
|
41
|
+
extensible. For a given mimetype the value must be set accordingly:
|
42
|
+
|
43
|
+
Note - application/x-microsoft.net.object.binary.base64 is the format
|
44
|
+
that the ResXResourceWriter will generate, however the reader can
|
45
|
+
read any of the formats listed below.
|
46
|
+
|
47
|
+
mimetype: application/x-microsoft.net.object.binary.base64
|
48
|
+
value : The object must be serialized with
|
49
|
+
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
50
|
+
: and then encoded with base64 encoding.
|
51
|
+
|
52
|
+
mimetype: application/x-microsoft.net.object.soap.base64
|
53
|
+
value : The object must be serialized with
|
54
|
+
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
55
|
+
: and then encoded with base64 encoding.
|
56
|
+
|
57
|
+
mimetype: application/x-microsoft.net.object.bytearray.base64
|
58
|
+
value : The object must be serialized into a byte array
|
59
|
+
: using a System.ComponentModel.TypeConverter
|
60
|
+
: and then encoded with base64 encoding.
|
61
|
+
-->
|
62
|
+
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
63
|
+
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
64
|
+
<xsd:element name="root" msdata:IsDataSet="true">
|
65
|
+
<xsd:complexType>
|
66
|
+
<xsd:choice maxOccurs="unbounded">
|
67
|
+
<xsd:element name="metadata">
|
68
|
+
<xsd:complexType>
|
69
|
+
<xsd:sequence>
|
70
|
+
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
71
|
+
</xsd:sequence>
|
72
|
+
<xsd:attribute name="name" use="required" type="xsd:string" />
|
73
|
+
<xsd:attribute name="type" type="xsd:string" />
|
74
|
+
<xsd:attribute name="mimetype" type="xsd:string" />
|
75
|
+
<xsd:attribute ref="xml:space" />
|
76
|
+
</xsd:complexType>
|
77
|
+
</xsd:element>
|
78
|
+
<xsd:element name="assembly">
|
79
|
+
<xsd:complexType>
|
80
|
+
<xsd:attribute name="alias" type="xsd:string" />
|
81
|
+
<xsd:attribute name="name" type="xsd:string" />
|
82
|
+
</xsd:complexType>
|
83
|
+
</xsd:element>
|
84
|
+
<xsd:element name="data">
|
85
|
+
<xsd:complexType>
|
86
|
+
<xsd:sequence>
|
87
|
+
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
88
|
+
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
89
|
+
</xsd:sequence>
|
90
|
+
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
91
|
+
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
92
|
+
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
93
|
+
<xsd:attribute ref="xml:space" />
|
94
|
+
</xsd:complexType>
|
95
|
+
</xsd:element>
|
96
|
+
<xsd:element name="resheader">
|
97
|
+
<xsd:complexType>
|
98
|
+
<xsd:sequence>
|
99
|
+
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
100
|
+
</xsd:sequence>
|
101
|
+
<xsd:attribute name="name" type="xsd:string" use="required" />
|
102
|
+
</xsd:complexType>
|
103
|
+
</xsd:element>
|
104
|
+
</xsd:choice>
|
105
|
+
</xsd:complexType>
|
106
|
+
</xsd:element>
|
107
|
+
</xsd:schema>
|
108
|
+
<resheader name="resmimetype">
|
109
|
+
<value>text/microsoft-resx</value>
|
110
|
+
</resheader>
|
111
|
+
<resheader name="version">
|
112
|
+
<value>2.0</value>
|
113
|
+
</resheader>
|
114
|
+
<resheader name="reader">
|
115
|
+
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
116
|
+
</resheader>
|
117
|
+
<resheader name="writer">
|
118
|
+
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
119
|
+
</resheader>
|
120
|
+
</root>
|
@@ -0,0 +1,132 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
3
|
+
<PropertyGroup>
|
4
|
+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
5
|
+
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
6
|
+
<ProductVersion>8.0.30703</ProductVersion>
|
7
|
+
<SchemaVersion>2.0</SchemaVersion>
|
8
|
+
<ProjectGuid>{79C33EDA-58C4-41EF-93DC-BA679895BD43}</ProjectGuid>
|
9
|
+
<OutputType>WinExe</OutputType>
|
10
|
+
<AppDesignerFolder>Properties</AppDesignerFolder>
|
11
|
+
<RootNamespace>WindowsForms</RootNamespace>
|
12
|
+
<AssemblyName>WindowsForms</AssemblyName>
|
13
|
+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
14
|
+
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
15
|
+
<FileAlignment>512</FileAlignment>
|
16
|
+
</PropertyGroup>
|
17
|
+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
18
|
+
<PlatformTarget>x86</PlatformTarget>
|
19
|
+
<DebugSymbols>true</DebugSymbols>
|
20
|
+
<DebugType>full</DebugType>
|
21
|
+
<Optimize>false</Optimize>
|
22
|
+
<OutputPath>..\Debug\</OutputPath>
|
23
|
+
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
24
|
+
<ErrorReport>prompt</ErrorReport>
|
25
|
+
<WarningLevel>4</WarningLevel>
|
26
|
+
</PropertyGroup>
|
27
|
+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
28
|
+
<PlatformTarget>x86</PlatformTarget>
|
29
|
+
<DebugType>pdbonly</DebugType>
|
30
|
+
<Optimize>true</Optimize>
|
31
|
+
<OutputPath>..\..\..\</OutputPath>
|
32
|
+
<DefineConstants>TRACE</DefineConstants>
|
33
|
+
<ErrorReport>prompt</ErrorReport>
|
34
|
+
<WarningLevel>4</WarningLevel>
|
35
|
+
</PropertyGroup>
|
36
|
+
<ItemGroup>
|
37
|
+
<Reference Include="System" />
|
38
|
+
<Reference Include="System.Core" />
|
39
|
+
<Reference Include="System.Xml.Linq" />
|
40
|
+
<Reference Include="System.Data.DataSetExtensions" />
|
41
|
+
<Reference Include="Microsoft.CSharp" />
|
42
|
+
<Reference Include="System.Data" />
|
43
|
+
<Reference Include="System.Deployment" />
|
44
|
+
<Reference Include="System.Drawing" />
|
45
|
+
<Reference Include="System.Windows.Forms" />
|
46
|
+
<Reference Include="System.Xml" />
|
47
|
+
<Reference Include="UIAutomationClient" />
|
48
|
+
<Reference Include="UIAutomationProvider" />
|
49
|
+
<Reference Include="UIAutomationTypes" />
|
50
|
+
<Reference Include="WindowsBase" />
|
51
|
+
</ItemGroup>
|
52
|
+
<ItemGroup>
|
53
|
+
<Compile Include="AboutBox.cs">
|
54
|
+
<SubType>Form</SubType>
|
55
|
+
</Compile>
|
56
|
+
<Compile Include="AboutBox.Designer.cs">
|
57
|
+
<DependentUpon>AboutBox.cs</DependentUpon>
|
58
|
+
</Compile>
|
59
|
+
<Compile Include="AutomatableMonthCalendar.cs">
|
60
|
+
<SubType>Component</SubType>
|
61
|
+
</Compile>
|
62
|
+
<Compile Include="AutomationHelpers\AutomationProvider.cs" />
|
63
|
+
<Compile Include="DataEntryForm.cs">
|
64
|
+
<SubType>Form</SubType>
|
65
|
+
</Compile>
|
66
|
+
<Compile Include="DataEntryForm.Designer.cs">
|
67
|
+
<DependentUpon>DataEntryForm.cs</DependentUpon>
|
68
|
+
</Compile>
|
69
|
+
<Compile Include="SimpleElementsForm.cs">
|
70
|
+
<SubType>Form</SubType>
|
71
|
+
</Compile>
|
72
|
+
<Compile Include="SimpleElementsForm.Designer.cs">
|
73
|
+
<DependentUpon>SimpleElementsForm.cs</DependentUpon>
|
74
|
+
</Compile>
|
75
|
+
<Compile Include="PersonForm.cs">
|
76
|
+
<SubType>Form</SubType>
|
77
|
+
</Compile>
|
78
|
+
<Compile Include="PersonForm.Designer.cs">
|
79
|
+
<DependentUpon>PersonForm.cs</DependentUpon>
|
80
|
+
</Compile>
|
81
|
+
<Compile Include="MainFormWindow.cs">
|
82
|
+
<SubType>Form</SubType>
|
83
|
+
</Compile>
|
84
|
+
<Compile Include="MainFormWindow.Designer.cs">
|
85
|
+
<DependentUpon>MainFormWindow.cs</DependentUpon>
|
86
|
+
</Compile>
|
87
|
+
<Compile Include="Program.cs" />
|
88
|
+
<Compile Include="Properties\AssemblyInfo.cs" />
|
89
|
+
<EmbeddedResource Include="AboutBox.resx">
|
90
|
+
<DependentUpon>AboutBox.cs</DependentUpon>
|
91
|
+
</EmbeddedResource>
|
92
|
+
<EmbeddedResource Include="DataEntryForm.resx">
|
93
|
+
<DependentUpon>DataEntryForm.cs</DependentUpon>
|
94
|
+
</EmbeddedResource>
|
95
|
+
<EmbeddedResource Include="SimpleElementsForm.resx">
|
96
|
+
<DependentUpon>SimpleElementsForm.cs</DependentUpon>
|
97
|
+
</EmbeddedResource>
|
98
|
+
<EmbeddedResource Include="PersonForm.resx">
|
99
|
+
<DependentUpon>PersonForm.cs</DependentUpon>
|
100
|
+
</EmbeddedResource>
|
101
|
+
<EmbeddedResource Include="MainFormWindow.resx">
|
102
|
+
<DependentUpon>MainFormWindow.cs</DependentUpon>
|
103
|
+
</EmbeddedResource>
|
104
|
+
<EmbeddedResource Include="Properties\Resources.resx">
|
105
|
+
<Generator>ResXFileCodeGenerator</Generator>
|
106
|
+
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
107
|
+
<SubType>Designer</SubType>
|
108
|
+
</EmbeddedResource>
|
109
|
+
<Compile Include="Properties\Resources.Designer.cs">
|
110
|
+
<AutoGen>True</AutoGen>
|
111
|
+
<DependentUpon>Resources.resx</DependentUpon>
|
112
|
+
</Compile>
|
113
|
+
<None Include="Properties\Settings.settings">
|
114
|
+
<Generator>SettingsSingleFileGenerator</Generator>
|
115
|
+
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
116
|
+
</None>
|
117
|
+
<Compile Include="Properties\Settings.Designer.cs">
|
118
|
+
<AutoGen>True</AutoGen>
|
119
|
+
<DependentUpon>Settings.settings</DependentUpon>
|
120
|
+
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
121
|
+
</Compile>
|
122
|
+
</ItemGroup>
|
123
|
+
<ItemGroup />
|
124
|
+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
125
|
+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
126
|
+
Other similar extension points exist, see Microsoft.Common.targets.
|
127
|
+
<Target Name="BeforeBuild">
|
128
|
+
</Target>
|
129
|
+
<Target Name="AfterBuild">
|
130
|
+
</Target>
|
131
|
+
-->
|
132
|
+
</Project>
|
@@ -0,0 +1,30 @@
|
|
1
|
+
|
2
|
+
Microsoft Visual Studio Solution File, Format Version 11.00
|
3
|
+
# Visual Studio 2010
|
4
|
+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsForms", "WindowsForms\WindowsForms.csproj", "{79C33EDA-58C4-41EF-93DC-BA679895BD43}"
|
5
|
+
EndProject
|
6
|
+
Global
|
7
|
+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
8
|
+
Debug|Any CPU = Debug|Any CPU
|
9
|
+
Debug|Mixed Platforms = Debug|Mixed Platforms
|
10
|
+
Debug|x86 = Debug|x86
|
11
|
+
Release|Any CPU = Release|Any CPU
|
12
|
+
Release|Mixed Platforms = Release|Mixed Platforms
|
13
|
+
Release|x86 = Release|x86
|
14
|
+
EndGlobalSection
|
15
|
+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
16
|
+
{79C33EDA-58C4-41EF-93DC-BA679895BD43}.Debug|Any CPU.ActiveCfg = Debug|x86
|
17
|
+
{79C33EDA-58C4-41EF-93DC-BA679895BD43}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
18
|
+
{79C33EDA-58C4-41EF-93DC-BA679895BD43}.Debug|Mixed Platforms.Build.0 = Debug|x86
|
19
|
+
{79C33EDA-58C4-41EF-93DC-BA679895BD43}.Debug|x86.ActiveCfg = Debug|x86
|
20
|
+
{79C33EDA-58C4-41EF-93DC-BA679895BD43}.Debug|x86.Build.0 = Debug|x86
|
21
|
+
{79C33EDA-58C4-41EF-93DC-BA679895BD43}.Release|Any CPU.ActiveCfg = Release|x86
|
22
|
+
{79C33EDA-58C4-41EF-93DC-BA679895BD43}.Release|Mixed Platforms.ActiveCfg = Release|x86
|
23
|
+
{79C33EDA-58C4-41EF-93DC-BA679895BD43}.Release|Mixed Platforms.Build.0 = Release|x86
|
24
|
+
{79C33EDA-58C4-41EF-93DC-BA679895BD43}.Release|x86.ActiveCfg = Release|x86
|
25
|
+
{79C33EDA-58C4-41EF-93DC-BA679895BD43}.Release|x86.Build.0 = Release|x86
|
26
|
+
EndGlobalSection
|
27
|
+
GlobalSection(SolutionProperties) = preSolution
|
28
|
+
HideSolutionNode = FALSE
|
29
|
+
EndGlobalSection
|
30
|
+
EndGlobal
|
data/features/support/env.rb
CHANGED
@@ -1,17 +1,28 @@
|
|
1
|
-
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '../../', 'lib'))
|
2
|
-
|
3
|
-
require 'rspec-expectations'
|
4
|
-
require 'childprocess'
|
5
|
-
require 'mohawk'
|
6
|
-
|
7
|
-
World(Mohawk::Navigation)
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
1
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '../../', 'lib'))
|
2
|
+
|
3
|
+
require 'rspec-expectations'
|
4
|
+
require 'childprocess'
|
5
|
+
require 'mohawk'
|
6
|
+
|
7
|
+
World(Mohawk::Navigation)
|
8
|
+
|
9
|
+
require_rel 'screens'
|
10
|
+
|
11
|
+
Mohawk::Navigation.routes = {
|
12
|
+
:default => [
|
13
|
+
[MainScreen, :about],
|
14
|
+
[AboutScreen, :close],
|
15
|
+
[MainScreen, :data_entry_form_button],
|
16
|
+
[DataEntryForm]
|
17
|
+
]
|
18
|
+
}
|
19
|
+
|
20
|
+
Before do
|
21
|
+
@process = ChildProcess.build('features\\support\\WindowsForms.exe')
|
22
|
+
@process.start
|
23
|
+
RAutomation::WaitHelper.wait_until {RAutomation::Window.new(:pid => @process.pid).present?}
|
24
|
+
end
|
25
|
+
|
26
|
+
After do
|
27
|
+
@process.stop
|
28
|
+
end
|
@@ -5,10 +5,13 @@ class MainScreen
|
|
5
5
|
text(:text_field, :id => "textField")
|
6
6
|
text(:masked_text_field, :id => "maskedTextBox")
|
7
7
|
button(:data_entry_form_button, :value => "Data Entry Form")
|
8
|
+
button(:about, :value => "About")
|
8
9
|
combo_box(:fruits, :id => "FruitsComboBox")
|
9
10
|
checkbox(:first_checkbox, :id => "checkBox")
|
10
11
|
radio(:first_radio, :id => "radioButton1")
|
11
12
|
label(:label_control, :id => "label1")
|
13
|
+
link(:link_control, :id => "linkLabel1")
|
12
14
|
menu_item(:file_roundabout_way_to_about, :path => ["File", "Roundabout Way", "To", "About"])
|
13
15
|
tree_view(:tree_view, :id => "treeView")
|
16
|
+
control(:value_control_field, :id => "automatableMonthCalendar1")
|
14
17
|
end
|
data/features/table.feature
CHANGED
@@ -7,6 +7,14 @@ Scenario: Selecting a row by index
|
|
7
7
|
When we select the table row with index "1"
|
8
8
|
Then the row with index "1" should be selected
|
9
9
|
|
10
|
+
Scenario: Selecting a row by value
|
11
|
+
When we select the table row with the value "Anna Doe"
|
12
|
+
Then the row with index "1" should be selected
|
13
|
+
|
14
|
+
Scenario: Selecting a row from a child item
|
15
|
+
When we select the "1"th table row
|
16
|
+
Then the row with index "1" should be selected
|
17
|
+
|
10
18
|
Scenario: Rows have cells
|
11
19
|
Then the row with index "0" should look like the following:
|
12
20
|
| Name | Date of Birth | State |
|
@@ -17,3 +25,9 @@ Scenario: Retrieving the row values
|
|
17
25
|
| text | row |
|
18
26
|
| John Doe | 0 |
|
19
27
|
| Anna Doe | 1 |
|
28
|
+
|
29
|
+
Scenario: Retrieving the headers
|
30
|
+
Then the table headers are "Name, Date of birth, State"
|
31
|
+
|
32
|
+
Scenario: Retrieving a row value by its header
|
33
|
+
Then the "date_of_birth" for the row at index "1" is "3/4/1975"
|
data/features/tree_view.feature
CHANGED
@@ -1,17 +1,19 @@
|
|
1
1
|
module Mohawk
|
2
2
|
module Accessors
|
3
3
|
class Button
|
4
|
+
attr_reader :view
|
5
|
+
|
4
6
|
def initialize(adapter, locator)
|
5
|
-
@
|
7
|
+
@view = adapter.window.button(locator)
|
6
8
|
end
|
7
9
|
|
8
10
|
def click(&block)
|
9
|
-
@
|
10
|
-
@
|
11
|
+
@view.click &block if block
|
12
|
+
@view.click {true} unless block
|
11
13
|
end
|
12
14
|
|
13
15
|
def value
|
14
|
-
@
|
16
|
+
@view.value
|
15
17
|
end
|
16
18
|
end
|
17
19
|
end
|
@@ -1,21 +1,23 @@
|
|
1
1
|
module Mohawk
|
2
2
|
module Accessors
|
3
3
|
class CheckBox
|
4
|
+
attr_reader :view
|
5
|
+
|
4
6
|
def initialize(adapter, locator)
|
5
|
-
@
|
7
|
+
@view = adapter.window.checkbox(locator)
|
6
8
|
end
|
7
9
|
|
8
10
|
def checked?
|
9
|
-
@
|
11
|
+
@view.set?
|
10
12
|
end
|
11
13
|
|
12
14
|
def set_check(should_check)
|
13
|
-
@
|
14
|
-
@
|
15
|
+
@view.set if should_check
|
16
|
+
@view.clear unless should_check
|
15
17
|
end
|
16
18
|
|
17
19
|
def value
|
18
|
-
@
|
20
|
+
@view.value
|
19
21
|
end
|
20
22
|
end
|
21
23
|
end
|
@@ -1,21 +1,23 @@
|
|
1
1
|
module Mohawk
|
2
2
|
module Accessors
|
3
3
|
class Combo
|
4
|
+
attr_reader :view
|
5
|
+
|
4
6
|
def initialize(adapter, locator)
|
5
|
-
@
|
7
|
+
@view = adapter.window.select_list(locator)
|
6
8
|
end
|
7
9
|
|
8
10
|
def value
|
9
|
-
@
|
11
|
+
@view.value
|
10
12
|
end
|
11
13
|
|
12
14
|
def set(value)
|
13
|
-
@
|
14
|
-
@
|
15
|
+
@view.select value if value.instance_of? Fixnum
|
16
|
+
@view.set value if value.instance_of? String
|
15
17
|
end
|
16
18
|
|
17
19
|
def options
|
18
|
-
@
|
20
|
+
@view.options.map &:text
|
19
21
|
end
|
20
22
|
end
|
21
23
|
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Mohawk
|
2
|
+
module Accessors
|
3
|
+
class Control
|
4
|
+
attr_reader :view
|
5
|
+
def initialize(adapter, locator)
|
6
|
+
@adapter = adapter
|
7
|
+
@view = adapter.window.value_control(locator)
|
8
|
+
end
|
9
|
+
|
10
|
+
def value
|
11
|
+
@view.value
|
12
|
+
end
|
13
|
+
|
14
|
+
def set(value)
|
15
|
+
@view.set value
|
16
|
+
end
|
17
|
+
|
18
|
+
def click
|
19
|
+
@view.click
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|