Skip to content

Commit

Permalink
Merge pull request saucepleez#168 from saucepleez/development-branch
Browse files Browse the repository at this point in the history
taskt v3.3.0.0
  • Loading branch information
saucepleez authored Dec 7, 2019
2 parents dba1f20 + 911359a commit 64471c5
Show file tree
Hide file tree
Showing 28 changed files with 1,693 additions and 85 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,21 @@ taskt is free for both personal and commercial use. taskt is licensed under the
![Let us know what you think!](https://i.imgur.com/wKExziN.png)
Feel free to open up a feature request or report a bug/issue.

# System specifications
Please note whatever software that taskt is automating can affect the minimum software requirements.
## Minimum
* Windows 7/8.1/10/Server 2012/Server 2016
* 1GB ram
* 200MB disk space
* 1 vCPU
* .NET Framework 4.8
## Recommended
* Windows 10/Server 2012/Server 2016
* 4GB ram
* 1GB disk space
* 2 CPU
* .NET Framework 4.8

[![Open New Issue](https://img.shields.io/badge/Open-New Issue-blue.svg)](https://github.com/saucepleez/taskt/issues/new)
[![Chat on Gitter](https://img.shields.io/badge/Chat-On Gitter-green.svg)](https://gitter.im/taskt-rpa/Lobby)

4 changes: 0 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ steps:
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'

- task: VSTest@2
inputs:
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'

- task: DownloadSecureFile@1
inputs:
Expand Down
36 changes: 36 additions & 0 deletions taskt/Core/ApplicationSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class ApplicationSettings
public ServerSettings ServerSettings { get; set; } = new ServerSettings();
public EngineSettings EngineSettings { get; set; } = new EngineSettings();
public ClientSettings ClientSettings { get; set; } = new ClientSettings();
public LocalListenerSettings ListenerSettings { get; set; } = new LocalListenerSettings();
public ApplicationSettings()
{

Expand Down Expand Up @@ -167,4 +168,39 @@ public ClientSettings()
UseSlimActionBar = true;
}
}
/// <summary>
/// Defines Server settings for tasktServer if using the server component to manage the client
/// </summary>
[Serializable]
public class LocalListenerSettings
{
public bool StartListenerOnStartup { get; set; }
public bool LocalListeningEnabled { get; set; }
public bool RequireListenerAuthenticationKey { get; set; }
public int ListeningPort { get; set; }
public string AuthKey { get; set; }
public bool EnableWhitelist { get; set; }
public string IPWhiteList { get; set; }
public LocalListenerSettings()
{
StartListenerOnStartup = false;
LocalListeningEnabled = false;
RequireListenerAuthenticationKey = false;
EnableWhitelist = false;
ListeningPort = 19312;
AuthKey = Guid.NewGuid().ToString();
IPWhiteList = "";
}
}

[Serializable]
public class WhiteListIP
{
string _value;
public WhiteListIP(string s)
{
_value = s;
}
public string Value { get { return _value; } set { _value = value; } }
}
}
6 changes: 6 additions & 0 deletions taskt/Core/Automation/Commands/BeginIfCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,10 @@ where rw.Field<string>("Parameter Name") == "True When"
}
else if (v_IfActionType == "Web Element Exists")
{
string instanceName = ((from rw in v_IfActionParameterTable.AsEnumerable()
where rw.Field<string>("Parameter Name") == "Selenium Instance Name"
select rw.Field<string>("Parameter Value")).FirstOrDefault());

string parameterName = ((from rw in v_IfActionParameterTable.AsEnumerable()
where rw.Field<string>("Parameter Name") == "Element Search Parameter"
select rw.Field<string>("Parameter Value")).FirstOrDefault());
Expand All @@ -462,8 +466,10 @@ where rw.Field<string>("Parameter Name") == "Element Search Parameter"
where rw.Field<string>("Parameter Name") == "Element Search Method"
select rw.Field<string>("Parameter Value")).FirstOrDefault());


SeleniumBrowserElementActionCommand newElementActionCommand = new SeleniumBrowserElementActionCommand();
newElementActionCommand.v_SeleniumSearchType = searchMethod;
newElementActionCommand.v_InstanceName = instanceName.ConvertToUserVariable(sender);
bool elementExists = newElementActionCommand.ElementExists(sender, searchMethod, parameterName);
ifResult = elementExists;

Expand Down
55 changes: 50 additions & 5 deletions taskt/Core/Automation/Commands/PDFTextExtractionCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,30 @@

namespace taskt.Core.Automation.Commands
{
[Serializable]
[Serializable]
[Attributes.ClassAttributes.Group("Data Commands")]
[Attributes.ClassAttributes.Description("")]
[Attributes.ClassAttributes.UsesDescription("")]
[Attributes.ClassAttributes.ImplementationDescription("")]
public class PDFTextExtractionCommand : ScriptCommand
{
[XmlAttribute]
[Attributes.PropertyAttributes.PropertyDescription("Please indicate the PDF file path")]
[Attributes.PropertyAttributes.PropertyDescription("Please indicate the PDF file path or PDF file URL")]
[Attributes.PropertyAttributes.PropertyUIHelper(Attributes.PropertyAttributes.PropertyUIHelper.UIAdditionalHelperType.ShowFileSelectionHelper)]
[Attributes.PropertyAttributes.InputSpecification("Enter or Select the path to the applicable file.")]
[Attributes.PropertyAttributes.SampleUsage(@"C:\temp\myfile.pdf or [vFilePath]")]
[Attributes.PropertyAttributes.InputSpecification("Enter or Select the path to the applicable file or enter file URL.")]
[Attributes.PropertyAttributes.SampleUsage(@"C:\temp\myfile.pdf , [vFilePath] or https://temp.com/myfile.pdf")]
[Attributes.PropertyAttributes.Remarks("")]
public string v_FilePath { get; set; }

[XmlAttribute]
[Attributes.PropertyAttributes.PropertyDescription("Please select source type of PDF file")]
[Attributes.PropertyAttributes.PropertyUISelectionOption("File Path")]
[Attributes.PropertyAttributes.PropertyUISelectionOption("File URL")]
[Attributes.PropertyAttributes.InputSpecification("Select source type of PDF file")]
[Attributes.PropertyAttributes.SampleUsage("Select **File Path**, **File URL**")]
[Attributes.PropertyAttributes.Remarks("")]
public string v_FileSourceType { get; set; }

[XmlAttribute]
[Attributes.PropertyAttributes.PropertyDescription("Please select the variable to receive the PDF text")]
[Attributes.PropertyAttributes.PropertyUIHelper(Attributes.PropertyAttributes.PropertyUIHelper.UIAdditionalHelperType.ShowVariableHelper)]
Expand All @@ -42,10 +51,44 @@ public PDFTextExtractionCommand()
public override void RunCommand(object sender)
{

//get variable path to source file
//get variable path or URL to source file
var vSourceFilePath = v_FilePath.ConvertToUserVariable(sender);
// get source type of file either from a physical file or from a URL
var vSourceFileType = v_FileSourceType.ConvertToUserVariable(sender);

if (vSourceFileType == "File URL")
{
//create temp directory
var tempDir = Core.IO.Folders.GetFolder(Folders.FolderType.TempFolder);
var tempFile = System.IO.Path.Combine(tempDir, $"{ Guid.NewGuid()}.pdf");

//check if directory does not exist then create directory
if (!System.IO.Directory.Exists(tempDir))
{
System.IO.Directory.CreateDirectory(tempDir);
}

// Create webClient to download the file for extraction
var webclient = new System.Net.WebClient();
var uri = new Uri(vSourceFilePath);
webclient.DownloadFile(uri, tempFile);

// check if file is downloaded successfully
if (System.IO.File.Exists(tempFile))
{
vSourceFilePath = tempFile;
}

// Free not needed resources
uri = null;
if (webclient != null)
{
webclient.Dispose();
webclient = null;
}
}

// Check if file exists before proceeding
if (!System.IO.File.Exists(vSourceFilePath))
{
throw new System.IO.FileNotFoundException("Could not find file: " + vSourceFilePath);
Expand All @@ -68,6 +111,8 @@ public override List<Control> Render(frmCommandEditor editor)
base.Render(editor);

//create standard group controls
RenderedControls.AddRange(CommandControls.CreateDefaultDropdownGroupFor("v_FileSourceType", this, editor));

RenderedControls.AddRange(CommandControls.CreateDefaultInputGroupFor("v_FilePath", this, editor));


Expand Down
109 changes: 109 additions & 0 deletions taskt/Core/Automation/Commands/RemoteAPICommand.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml.Serialization;
using taskt.UI.CustomControls;
using taskt.UI.Forms;
using RestSharp;
using System.Data;
using System.Drawing;

namespace taskt.Core.Automation.Commands
{

[Serializable]
[Attributes.ClassAttributes.Group("Remote Commands")]
[Attributes.ClassAttributes.Description("This command allows you to execute automation against another taskt Client.")]
[Attributes.ClassAttributes.UsesDescription("Use this command when you want to automate against a taskt instance that enables Local Listener.")]
[Attributes.ClassAttributes.ImplementationDescription("This command uses Core.Server.LocalTCPListener")]
public class RemoteAPICommand : ScriptCommand
{
[XmlAttribute]
[Attributes.PropertyAttributes.PropertyDescription("Please enter the IP:Port (ex. 192.168.2.200:19312)")]
[Attributes.PropertyAttributes.PropertyUIHelper(Attributes.PropertyAttributes.PropertyUIHelper.UIAdditionalHelperType.ShowVariableHelper)]
[Attributes.PropertyAttributes.InputSpecification("Define any IP endpoint which is enabled for local listening.")]
[Attributes.PropertyAttributes.SampleUsage("**https://example.com** or **{vMyUrl}**")]
[Attributes.PropertyAttributes.Remarks("")]
public string v_BaseURL { get; set; }

[XmlAttribute]
[Attributes.PropertyAttributes.PropertyDescription("Select Parameter Type")]
[Attributes.PropertyAttributes.PropertyUIHelper(Attributes.PropertyAttributes.PropertyUIHelper.UIAdditionalHelperType.ShowVariableHelper)]
[Attributes.PropertyAttributes.PropertyUISelectionOption("Get Engine Status")]
[Attributes.PropertyAttributes.PropertyUISelectionOption("Restart taskt")]
[Attributes.PropertyAttributes.InputSpecification("Select the necessary API Method")]
[Attributes.PropertyAttributes.Remarks("")]
public string v_ParameterType { get; set; }

[XmlAttribute]
[Attributes.PropertyAttributes.PropertyDescription("Request Timeout (ms)")]
[Attributes.PropertyAttributes.PropertyUIHelper(Attributes.PropertyAttributes.PropertyUIHelper.UIAdditionalHelperType.ShowVariableHelper)]
[Attributes.PropertyAttributes.InputSpecification("Enter the length of time to wait before the request times out ")]
[Attributes.PropertyAttributes.Remarks("")]
public string v_RequestTimeout { get; set; }

[XmlAttribute]
[Attributes.PropertyAttributes.PropertyDescription("Please select the variable to receive the response")]
[Attributes.PropertyAttributes.PropertyUIHelper(Attributes.PropertyAttributes.PropertyUIHelper.UIAdditionalHelperType.ShowVariableHelper)]
[Attributes.PropertyAttributes.InputSpecification("Select or provide a variable from the variable list")]
[Attributes.PropertyAttributes.SampleUsage("**vSomeVariable**")]
[Attributes.PropertyAttributes.Remarks("If you have enabled the setting **Create Missing Variables at Runtime** then you are not required to pre-define your variables, however, it is highly recommended.")]
public string v_userVariableName { get; set; }

public RemoteAPICommand()
{
this.CommandName = "RemoteAPICommand";
this.SelectionName = "Remote API";
this.CommandEnabled = true;
this.CustomRendering = true;
this.v_RequestTimeout = "5000";
}

public override void RunCommand(object sender)
{

try
{
var server = v_BaseURL.ConvertToUserVariable(sender);
var paramType = v_ParameterType.ConvertToUserVariable(sender);
var timeout = v_RequestTimeout.ConvertToUserVariable(sender);

var response = Server.LocalTCPListener.SendAutomationTask(server, paramType, timeout);

response.StoreInUserVariable(sender, v_userVariableName);

}
catch (Exception ex)
{
throw ex;
}

}
public override List<Control> Render(frmCommandEditor editor)
{
base.Render(editor);
RenderedControls.AddRange(CommandControls.CreateDefaultInputGroupFor("v_BaseURL", this, editor));
RenderedControls.AddRange(CommandControls.CreateDefaultDropdownGroupFor("v_ParameterType", this, editor));
RenderedControls.AddRange(CommandControls.CreateDefaultInputGroupFor("v_RequestTimeout", this, editor));

RenderedControls.Add(CommandControls.CreateDefaultLabelFor("v_userVariableName", this));
var VariableNameControl = CommandControls.CreateStandardComboboxFor("v_userVariableName", this).AddVariableNames(editor);
RenderedControls.AddRange(CommandControls.CreateUIHelpersFor("v_userVariableName", this, new Control[] { VariableNameControl }, editor));
RenderedControls.Add(VariableNameControl);

return RenderedControls;

}

public override string GetDisplayValue()
{
return base.GetDisplayValue() + $" [{v_ParameterType} on {v_BaseURL}]";
}

}

}

Loading

0 comments on commit 64471c5

Please sign in to comment.