How do I run my automation scripts which include UI interaction on an Octopus tentacle using the Octopus Server? - nunit

I have a batch file which uses nunitconsole runner to run my tests.
It's a combination of nunit framework and specflow.
When I run the batch file on the Octopus tentacle it works as expected.
However, if I create a step in the Octopus server to trigger this batch file, none of the UI related things happen.
Any setting or prerequisite is required for this?

Some time ago I had a similar situation, this is because Octopus server runs as a service, due to this, you can not have anything that requires a window or interaction to run, however a workaround could be, execute a scheduled task through Octopus to execute your batch, so you will execute in a non background way.

Related

Azure Devops automated test results incoherent with powershell test results using the same data

I'm currently trying to integrate automatic test execution on the deployment process using Azure Devops but it's causing me an issue where some tests don't run properly.
The application I'm testing has a log-in page and I've set up a couple of tests to see if it opened properly. These ones run smoothly, but the ones that require going through the login process do not.
I've set up some snapshots amidst the process and the result was that I was getting an error on the last step of logging in. I've checked the application logs and the result I got was that no credentials were sent through the request which I found odd since they were displayed on the snapshots.
All the data being inserted was correct, I've checked the endpoints and settings on the agent that was running them and everything seemed fine.
I tried then to run the automated tests through powershell command directly on the same agent and all of them passed with no issue whatsoever.
I've tried changing my task to a powershell command but it still gives me an error.
I have no idea where my issue could be or where I should be even able to start looking for the problem, as clearly it seems that the problem is on the azure devops task but everything seems fine with it, I've tinkered around with the settings a bit but none of them seemed to have any impact on the results I was getting.
I'm using version 2 of the vstest task and am targetting the test assembly that was deployed to the agent. Any idea on what I could be missing or pointers on how to find the solution?
These ones run smoothly, but the ones that require going through the
login process do not
Based on this description, it seems that it will open a new window automatically by the task.
If I'm right, and your test will open a window to login with your private-hosted agent. At this time, the mode of your private-hosted agent must be in interactive which it can allow auto-logon enabled.
Just check this official document for more detail information.

How to run a foreground task through WinRM / Remote Powershelling

I'm trying to incorporate a test suite that runs nightly on an Azure VM.
As of now, I have a Build process using TFS2015 that publishes my test files, starts the VM, and copies the files.
I'm trying to then use the "PowerShell on Target Machine" task to execute a script that launches a batch file. The reason it'll be executing a batch file is because I can't have the build process wait until that script is finished (it takes around 3 hours for the tasks in the batch file to complete).
My initial logic was to have the powershell script create a task using schtasks. This part works and the task itself is created on the virtual machine, however, it never runs at the scheduled time.
The other issue is that if I manually create these tasks, the task is executed, but everything is executed in the background. I need everything to be executed in the foreground.
I'm aware that this is by design since you should not be able to run foreground processes/applications remotely since it isn't "your session".
So the question will remain, are there any work arounds to this?
I'm trying to do launch selenium webservers and then execute protractor automation tests on the virtual machine. So one batch file starts the selenium server and the second launches protractor with a defined suite. If these are ran in the background (essentially headless) all my tests break.
Any insight would be helpful, or if I need to expand on my question or provide further details please let me know. Thanks.
I'm aware that this doesn't answer your specific question, but have you looked at moving your Selenium tests into VSTS? They're officially supported in the build/release pipelines and other people are taking this approach with protractor here and elsewhere. People are also making it work with TFS.

TeamCity nunit tests different output

I have tests that have to be run on CI server. The thing is that when I am running the tests in nunit console, they are all passing, but on teamcity server I keep receiving a bunch of errors, connected with sqllocaldb instance. I guess this is due to the fact that running teamcity from 'local system' privileges gives such an output, but I don't know how to bypass this thing, even using 'Run as' plugin.
Maybe you can suggest an option/configuration/workaround to me to get the right results?
Created new windows profile, called "TeamCity", configured everything and made service to be run under this profile, now everything works fine.

End to end/integration testing - jenkins build

I am currently in a process of setting up Jenkins-CI for my Scala/Akka project.
I managed to create build that is integrated with BitBucket and executes builds when new pull reuqest is created/old pull request is updated.
As a testing framework we are using Specs2 which is also integrated with Jenkins by using JUnit post-build action. Now I am wondering how to properly execute e2e tests in my build.
Basically in git repository we have 2 projects, lets call them main-project and rest-tests. rest-tests contains e2e tests that are written using REST-assured library. To execute them I need to start main-project application (which uses Spray library to set up HTTP server) and then execute test task in sbt project of rest-test.
My idea was to execute main-project startup script (generated by sbt-native-packager) whith something like this:
$WORKSPACE/main-project/target/universal/stage/bin/main-project & echo $! > /tmp/main-project.pid
then execute test task of rest-tests project and finally kill process with PID that is saved in /tmp/main-project.pid file.
The last step should be implemented using https://wiki.jenkins-ci.org/display/JENKINS/Post+build+task because if some rest-testswill fail the next steps of build will not be executed (or at least that is what I am thinking) and I could end with my instance of application running after the build is finished.
This is first time when I am setting up CI system and my solution seems to be a little hacky (at least to me). I am wondering if there is a better/more idiomatic way of solving my problem of running e2e tests which require another application running.

Automatic installer deploy to remote server using TeamCity and MSBuild

I'm having a .net WPF project that compiles to a bunch of dlls. I also have another project that compiles all the dlls and creates an installator exe.
I am also using TeamCity to automatically do those tasks for me with a press of a button.
The problem is that I want to have a separate TeamCity build configuration intended to automatically copy the result installator exe to a number of remote machines, each having specific credentials. But, unfortunately, I don't get how do I do this.
I have found some articles on automatic deploying (like this http://www.troyhunt.com/2010/11/you-deploying-it-wrong-teamcity.html), but, obviously, they are very specific for web projects.
So, how should I correctly deploy my installator on build?
Your best bet is to research NAnt and make a simple task that will copy the TeamCity artifact (installer) out to the specified location.
All you would need to do is have TeamCity execute the specified NAnt task after the installer has been built.
http://nant.sourceforge.net/release/0.85/help/tasks/copy.html
Update
Also, check out this question for solutions on specifying the credentials for the copy task.
OK, I've found out that it's pretty easy to do this using the FtpUpload MSBuild community task. There, one can set up the credentials and all other stuff needed for uploading a file (or a set of files) via ftp.