Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion Appium Wizard/AppiumServerSetup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ public void StartAppiumServer(int appiumPort, int serverNumber, string command =
{
command = command + " --port " + appiumPort;
}
var pluginList = Common.GetListOfInstalledPlugins();
if (pluginList.TryGetValue("inspector", out string value) && !value.Equals("NotInstalled"))
{
if (!command.Contains("--use-plugins=inspector"))
{
command = command + " --use-plugins=inspector";
}
}
appiumLogLevel = Database.QueryDataFromlogLevelTable()["Server" + serverNumber];
if (!command.Contains(" --log "))
{
Expand Down Expand Up @@ -186,7 +194,7 @@ public void AppiumServer_OutputDataReceived(object sender, DataReceivedEventArgs
data = Regex.Replace(data, @"<sup>\(1\)</sup>", "");
if (portServerNumberAndFilePath.ContainsKey(serverNumber))
{
if (data.Contains("No plugins have been installed.") || data.Contains("No plugins activated."))
if (data.Contains("No plugins have been installed.") || data.Contains("No plugins activated.") || (data.Contains("[Appium]") && data.Contains("(ACTIVE)")))
{
serverStarted = true;
InitializeLogWriter(serverNumber, portServerNumberAndFilePath[serverNumber].Item2);
Expand Down
3 changes: 2 additions & 1 deletion Appium Wizard/ExcludeInInstaller/Installer Script.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Appium Wizard"
#define MyAppVersion "9.0.0"
#define MyAppVersion "9.1.0"
#define MyAppPublisher "Meganathan C"
#define MyAppExeName "Appium Wizard.exe"

Expand Down Expand Up @@ -51,6 +51,7 @@ Filename: {app}\Resources\Server\Backup\7za.exe; Parameters: "x ""{app}\Resource
Filename: "{cmd}"; Parameters: "/C set ""PATH=%PATH%;{app}\Resources\Server"" && cd {app}\Resources\Server && npm list -g appium || npm install -g appium"; Flags: runhidden runascurrentuser; StatusMsg: "Installing appium server... This may take sometime, Please wait..."
Filename: "{cmd}"; Parameters: "/C set ""PATH=%PATH%;{app}\Resources\Server"" && appium driver install xcuitest"; Flags: runhidden runascurrentuser; StatusMsg: "Installing XCUITest driver... This may take sometime, Please wait..."
Filename: "{cmd}"; Parameters: "/C set ""PATH=%PATH%;{app}\Resources\Server"" && appium driver install uiautomator2"; Flags: runhidden runascurrentuser; StatusMsg: "Installing UIAutomator2 driver... This may take sometime, Please wait..."
Filename: "{cmd}"; Parameters: "/C set ""PATH=%PATH%;{app}\Resources\Server"" && appium plugin install inspector"; Flags: runhidden runascurrentuser; StatusMsg: "Installing Appium Inspector Plugin... This may take sometime, Please wait..."
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

[Code]
Expand Down
9 changes: 8 additions & 1 deletion Appium Wizard/LoadingScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ public partial class LoadingScreen : Form
public static int appiumPort = 4723;
public static bool isServerStarted;
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
public static bool isInspectorPluginInstalled;

public LoadingScreen()
{
MainScreen mainForm = new MainScreen();
Expand Down Expand Up @@ -135,7 +137,12 @@ await Task.Run(() =>
UpdateStepLabel("Starting Appium Server...");
Database.UpdateDataIntoFirstTimeRunTable("No");
await ExecuteBackgroundMethod();
UpdateStepLabel("Loading Modules...");
UpdateStepLabel("Loading Modules...");
var pluginList = Common.GetListOfInstalledPlugins();
if (pluginList.TryGetValue("inspector", out string value) && !value.Equals("NotInstalled"))
{
isInspectorPluginInstalled = true;
}
Common.DeleteLogFiles();
MainScreen mainForm = new MainScreen();
UpdateStepLabel("Initializing User Interface...");
Expand Down
115 changes: 110 additions & 5 deletions Appium Wizard/MainScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public partial class MainScreen : Form
private Timer resizeDebounceTimer;
private bool isCleanupComplete = false;
private bool isClosingInProgress = false;
public static bool isInspectorPluginInstalled;

public MainScreen()
{
Expand Down Expand Up @@ -70,6 +71,7 @@ public MainScreen()
releaseInfo = Common.GetLatestReleaseInfo();
}
InitializeWebViews();
isInspectorPluginInstalled = LoadingScreen.isInspectorPluginInstalled;
}
string defaultText = "Appium Server Not Running. Go to Server->Config to start the server...";
private async void InitializeWebViews()
Expand Down Expand Up @@ -1346,12 +1348,105 @@ private void inspectorToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
ProcessStartInfo psInfo = new ProcessStartInfo
if (!isInspectorPluginInstalled)
{
FileName = "https://inspector.appiumpro.com/",
UseShellExecute = true
};
Process.Start(psInfo);
MessageBox.Show("Inspector plugin not installed. Please install the plugin from Server->Plugins Manager and restart the appium sever.",
"Inspector plugin not found",
MessageBoxButtons.OK,
MessageBoxIcon.Warning);
return;
}

if (!AppiumServerSetup.portServerNumberAndFilePath.Any())
{
MessageBox.Show("No active Appium server found. Please start a server first.",
"No Server Found",
MessageBoxButtons.OK,
MessageBoxIcon.Warning);
return;
}

int selectedPort;

if (AppiumServerSetup.portServerNumberAndFilePath.Count == 1)
{
// Only one server running, open directly without asking
selectedPort = AppiumServerSetup.portServerNumberAndFilePath.First().Value.Item1;
}
else
{
// Multiple servers running, let user pick one
using (var form = new Form())
{
form.Text = "Select Server";
form.Size = new Size(400, 250);
form.StartPosition = FormStartPosition.CenterParent;
form.FormBorderStyle = FormBorderStyle.FixedDialog;
form.MaximizeBox = false;
form.MinimizeBox = false;
form.Padding = new Padding(10);

var label = new Label
{
Text = "Select a server to open Inspector:",
AutoSize = true,
Location = new Point(15, 15)
};

var comboBox = new ComboBox
{
DropDownStyle = ComboBoxStyle.DropDownList,
Location = new Point(15, 40),
Width = 355,
Height = 30
};

// Populate dropdown with server options
foreach (var server in AppiumServerSetup.portServerNumberAndFilePath)
{
comboBox.Items.Add($"Server {server.Key} - Port {server.Value.Item1}");
}
comboBox.SelectedIndex = 0;

var okButton = new Button
{
Text = "Open Inspector",
Location = new Point(195, 110),
Width = 175,
Height = 35,
DialogResult = DialogResult.OK,
BackColor = Color.FromArgb(0, 122, 204),
ForeColor = Color.White,
FlatStyle = FlatStyle.Flat
};

var cancelButton = new Button
{
Text = "Cancel",
Location = new Point(15, 110),
Width = 175,
Height = 35,
DialogResult = DialogResult.Cancel,
FlatStyle = FlatStyle.Flat
};

form.Controls.Add(label);
form.Controls.Add(comboBox);
form.Controls.Add(okButton);
form.Controls.Add(cancelButton);
form.AcceptButton = okButton;
form.CancelButton = cancelButton;

if (form.ShowDialog() != DialogResult.OK) return;

// Get selected server port
var selectedServerNumber = AppiumServerSetup.portServerNumberAndFilePath
.Keys.ElementAt(comboBox.SelectedIndex);
selectedPort = AppiumServerSetup.portServerNumberAndFilePath[selectedServerNumber].Item1;
}
}

OpenInspector(selectedPort);
GoogleAnalytics.SendEvent("InspectorToolStripMenuItem_Click");
}
catch (Exception exception)
Expand All @@ -1360,6 +1455,16 @@ private void inspectorToolStripMenuItem_Click(object sender, EventArgs e)
}
}

private void OpenInspector(int portNumber)
{
ProcessStartInfo psInfo = new ProcessStartInfo
{
FileName = $"http://127.0.0.1:{portNumber}/inspector",
UseShellExecute = true
};
Process.Start(psInfo);
}

private void xCUITestToolStripMenuItem_Click(object sender, EventArgs e)
{
try
Expand Down
1 change: 1 addition & 0 deletions Appium Wizard/Plugins Manager.Designer.cs

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

14 changes: 12 additions & 2 deletions Appium Wizard/Plugins Manager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
public partial class Plugins : Form
{
string selectedPlugin, selectedVersion;

public Plugins()
{
InitializeComponent();
Expand Down Expand Up @@ -44,7 +45,7 @@
listView1.Columns[1].Width = (listView1.Width / 2) - 10;
}

public async Task UpdatePluginList(CommonProgress commonProgress = null)

Check warning on line 48 in Appium Wizard/Plugins Manager.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Cannot convert null literal to non-nullable reference type.
{
commonProgress.UpdateStepLabel("Fetch Plugins", "Please wait while fetching plugins list...", 75);
listView1.Columns[0].Width = listView1.Width / 2;
Expand All @@ -53,6 +54,10 @@
await Task.Run(() =>
{
result = Common.GetListOfInstalledPlugins();
if (result.TryGetValue("inspector", out string value) && !value.Equals("NotInstalled"))
{
MainScreen.isInspectorPluginInstalled = true;
}
});
listView1.Items.Clear();

Expand All @@ -75,12 +80,12 @@
commonProgress.Owner = this;
if (showProgressCheckBox1.Checked)
{
commonProgress.UpdateStepLabel("Install Plugin", "Please wait while installing plugin " + selectedPlugin + "..." +
commonProgress.UpdateStepLabel("Install Plugin", "Please wait while installing plugin - " + selectedPlugin + "..." +
"\n\nPlease close the cmd window once the execution completed to continue here...");
}
else
{
commonProgress.UpdateStepLabel("Install Plugin", "Please wait while installing plugin " + selectedPlugin + "...");
commonProgress.UpdateStepLabel("Install Plugin", "Please wait while installing plugin - " + selectedPlugin + "...");
}
await Task.Run(() =>
{
Expand Down Expand Up @@ -216,5 +221,10 @@
MessageBox.Show("Checking this box will display the CMD window where the plugin installation/updation execution occurs. You must manually close the CMD window once the execution is completed to continue accessing the Appium wizard.", "Show execution status", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}

private void Plugins_FormClosed(object sender, FormClosedEventArgs e)
{
MessageBox.Show("Restart the Appium server for the plugin installation or uninstallation to take effect.", "Restart Appium Server", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}
Binary file modified Appium Wizard/Resources/iOS/zsign.exe
Binary file not shown.
4 changes: 2 additions & 2 deletions Appium Wizard/VersionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
public static class VersionInfo
{
public const string VersionNumber = "9.0.0";
public const string ReleaseNotes = "Execution speed issue fix";
public const string VersionNumber = "9.1.0";
public const string ReleaseNotes = "Bug fixes";
}
}
Loading