Skip to content
This repository has been archived by the owner on Jun 1, 2022. It is now read-only.

Commit

Permalink
Merge pull request #48 from pricelessspirit/master
Browse files Browse the repository at this point in the history
polished some minor things in the tool
  • Loading branch information
dzharii authored Jun 30, 2016
2 parents 81fbfd2 + 2fc7593 commit 01f48be
Show file tree
Hide file tree
Showing 20 changed files with 204 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\TestStack.White.0.13.3\lib\net40\TestStack.White.dll</HintPath>
</Reference>
<Reference Include="WebDriver, Version=2.51.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Selenium.WebDriver.2.51.0\lib\net40\WebDriver.dll</HintPath>
<Reference Include="WebDriver, Version=2.53.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Selenium.WebDriver.2.53.0\lib\net40\WebDriver.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion SwdPageRecorder/SwdPageRecorder.TestModel/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<package id="Castle.Core" version="3.3.3" targetFramework="net45" />
<package id="Newtonsoft.Json" version="8.0.2" targetFramework="net45" />
<package id="NLog" version="4.2.3" targetFramework="net45" />
<package id="Selenium.WebDriver" version="2.51.0" targetFramework="net45" />
<package id="Selenium.WebDriver" version="2.53.0" targetFramework="net45" />
<package id="TestStack.White" version="0.13.3" targetFramework="net45" />
</packages>
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\TestStack.White.0.13.3\lib\net40\TestStack.White.dll</HintPath>
</Reference>
<Reference Include="WebDriver, Version=2.51.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Selenium.WebDriver.2.51.0\lib\net40\WebDriver.dll</HintPath>
<Reference Include="WebDriver, Version=2.53.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Selenium.WebDriver.2.53.0\lib\net40\WebDriver.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion SwdPageRecorder/SwdPageRecorder.Tests/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
<package id="Newtonsoft.Json" version="8.0.2" targetFramework="net45" />
<package id="NLog" version="4.2.3" targetFramework="net45" />
<package id="NUnitTestAdapter.WithFramework" version="2.0.0" targetFramework="net45" />
<package id="Selenium.WebDriver" version="2.51.0" targetFramework="net45" />
<package id="Selenium.WebDriver" version="2.53.0" targetFramework="net45" />
<package id="TestStack.White" version="0.13.3" targetFramework="net45" />
</packages>
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,14 @@ public void ProcessCommands()
simpleFrame = new SimpleFrame(-1, "noFrameChosen", "noFrameChosen", "noFrameChosen", null);
}

bool emptyHtmlId = String.IsNullOrEmpty(addElementCommand.ElementId);
var element = new WebElementDefinition()
{
Name = addElementCommand.ElementCodeName,
HowToSearch = LocatorSearchMethod.XPath,
Locator = addElementCommand.ElementXPath,
HtmlId = addElementCommand.ElementId,
Xpath = addElementCommand.ElementXPath,
HowToSearch = (emptyHtmlId) ? LocatorSearchMethod.XPath: LocatorSearchMethod.Id,
Locator = (emptyHtmlId) ? addElementCommand.ElementXPath: addElementCommand.ElementId,
CssSelector = addElementCommand.ElementCssSelector,
frame = simpleFrame,
};
Expand Down
26 changes: 13 additions & 13 deletions SwdPageRecorder/SwdPageRecorder.UI/SwdMain/SwdMainView.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 23 additions & 21 deletions SwdPageRecorder/SwdPageRecorder.UI/SwdMain/SwdMainView.resx
Original file line number Diff line number Diff line change
Expand Up @@ -123,29 +123,31 @@
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="pictureBox2.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABUAAAAYCAIAAACa6yEfAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADrwAAA68AZW8ckkAAARLSURBVDhPhdJ7TFpXHAfwsyxZsixZsizZmrRpVayCUhAF
8QnamqZLk3bLkjVdsu2P7Y+tyUyWJqUtW9dNXevbivjgcUFBUFSU1ke3uU5d5wNctMps4wsfSIvK4wIX
Llpzd8CrVtdlJ9+Qc87v++EkBPBAIvjf/FZ3MLsj0CcVEC4BQZT9V7a2SjY3i4PBIhwPBW7gEV6GpoPn
wIBMYCp7J9ib89IEfjnlu3/S1Zlt7+Db2ngwcOO8l+3tOQlHys9B2Be/Hfw5+9/B72f5uviODh46Kdvw
WDewVXShb1abY21Odxp4cKT4DICHcoGp8K0Q6OGHsrvp4fs7eaghE30kJl5Ylt7vp5XcZ7o0jyET+QSA
ISTsd8yLwTp5zvYM9LGWpASxEUBNivNmGceqTXV3ZOz4n94MdmaEDPzcCX4vHTOkO1pSF7XZK8NVK+Mt
MwM1/VU5f5Yx/5YkrTRyUX0a8jEAIwqBKe+NoCH1QALtKd5W7ro2eUGRNCFOGCw50Xeb/rCYPiZizskT
VzUcOFVceJnHO1L8+hRfG9elS36qZsM29KYKhrGcAfG0NNGmYsMR7JDe+MPreDt3O/62ZF9rMtrCXdOw
rfWJi/qL9lEZumxyL5nG5WcmqxgWOQuOPDoObCo+AsCk3PPwytvCcTVxnjVy1/pv+Fcfk79beD3p+na8
krGAsNY1bPhGQB/2f9WTHp7hraspzTNatumzb2BrpNtZ/aKzxpK4uTrGuorla07CW9mKDwEYaxAYb7wG
D35dEtb7xabbgj5CZlTvDRXRcO/eVzht0/orUYO3Ymer49frGZg2AW9mKd4HYEIlMApfhQe/NgHVsNfU
aQt19MlymlF8mqThNaARQj98O9ZSS3c2MPf7a69se08jc03J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iWD0lRQmQ5qMoGEB2T8UD+ULPAPM7qx9cULW8UAAAAASUVORK5CYII=
</value>
</data>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>25</value>
</metadata>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAQEAAAAEAIAAoQgAAFgAAACgAAABAAAAAgAAAAAEAIAAAAAAAAEAAACcAAAAnAAAAAAAAAAAA
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,23 @@ internal void UpdateExistingPageDefinition(TreeNode existingNode, WebElementDefi
}
}

internal void DeleteExistingElementFromPage(TreeNode existingNode) {

var action = (MethodInvoker)delegate
{
tvWebElements.Nodes[0].Nodes.Remove(existingNode);
};

if (tvWebElements.InvokeRequired)
{
tvWebElements.Invoke(action);
}
else
{
action();
}
}

internal void UpdateLastCallStat(string elapsedTime)
{
lblLastCallTime.DoInvokeAction(() =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,27 @@ internal void UpdatePageDefinition(WebElementDefinition element, bool forceAddNe
}
}

internal void removeElementFromObjectPage(WebElementDefinition element)
{
if (_isEditingExistingNode)
{
DialogResult dr = MessageBox.Show("Do you want to remove the element which is named as "+ _currentEditingNode.Text + "?", "Attention", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (dr == DialogResult.Yes)
{
view.DeleteExistingElementFromPage(_currentEditingNode);
NotifyOnChanges();
}
else
{
return;
}
}
else
{
MessageBox.Show("Can not remove if element hasn't been ever saved. ", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}


internal void OpenExistingNodeForEdit(TreeNode treeNode)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ internal void CopyWebElement()
view.AppendWebElementNameWith("__Copy");
}

internal void RemoveWebElement(WebElementDefinition element)
{
Presenters.PageObjectDefinitionPresenter.removeElementFromObjectPage(element);
}

internal void HighLightWebElement(WebElementDefinition element)
{
if (!IsValidForm()) return;
Expand All @@ -89,6 +94,7 @@ internal void OpenExistingNodeForEdit(TreeNode treeNode)
Presenters.PageObjectDefinitionPresenter._currentEditingNode = treeNode;
var webElementFormData = treeNode.Tag as WebElementDefinition;
view.UpdateWebElementForm(webElementFormData);
view.btnRemoveWebElement.Enabled = true;
}

internal LocatorSearchMethod GetLocatorSearchMethod()
Expand Down
Loading

0 comments on commit 01f48be

Please sign in to comment.