Integration tests for Office 365 Outlook Add-in - outlook-addin

I have not been able to find guidelines to introduce integration tests for an Office 365 Outlook Add-in using a browser automation tool like Cypress or Selenium, and I'm looking for alternatives.
My team is currently using Cypress for automation tests, and the only way I was able to run tests on an Outlook Add-in was to make the Add-in run outside of the Office 365 Outlook environment in a standalone mode.
For the standalone mode, I had to mock the JavaScript API Office object (https://appsforoffice.microsoft.com/lib/1/hosted/Office.js) as well as mock the Office rest API responses to get a couple of tests running.
It's a very painful process, so I would like to know if there's a better way to implement the integration tests.

Unfortunately, it seems like the process you're using is correct, and there are no better alternatives for integration tests for Outlook add-ins.
We suggest that you add this request for better add-in integration tests to our user-voice page. Feature requests on user-voice are considered when we go through our planning process.

It is possible to automate e2e-Tests for Office Add-ins (real environment, no mocking of APIs required) using Appium and WinAppDriver. The HTML Elements of your app can be accessed by their id or via other methods. This gh repo contains a how-to.

Related

UiPath Bot -Can we do automation testing of Uipath bots?

I want to do the automation testing of UiPath attended and unattended bot. I am not able to identify the window dialog box getting generated from Uipath. Please advice me the tool which can identify objects and automate the UiPath bots.
With uipath 20.4 community preview release there are new exciting features to create test cases in the UiPath studio itself. refer this link here.
https://forum.uipath.com/t/testing-capabilities-in-community-orchestrator-20-4-community-preview-release/210487
however I would imagine you will be on older versions of studio, which requires you to apply other approaches. here is few ways to automate the testing for UIPath processes.
Using the Orchestrator APIs we can monitor the jobs in various ways
https://platform.uipath.com/kinooqmollho/kinoorgDefault/swagger/ui/index#/
Jobs APIs to get status of the jobs
Alerts API to get any alerts generated by the Job
RobotLogs api to get check specific logs you expect or not expect in
the jobs
Apart from this, you could build a test automation script to verify
the results of bot, directly on the applications to make sure results
you expect are showing up there.
Newevest versions of UiPath Studio already have testing built-in (Test Activity).
For full-fledged Automated Testing capabilities watch for the announcements early this year
The newest versions of UiPath Studio already have testing built-in (Test Activity).
You can also take the tutorial in https://academy.uipath.com on how the test automation works.
For running the BOT from command line you can use below syntac on CMD:
"drive:\Users\username\AppData\Local\UiPath\app-20.10.4\UiRobot.exe" -file "..\path_of\Main.xaml"
For testing, if the BOT is running or not you could send an email every few minutes so that you can remotely get the heartbeat of the BOT.

Javascript in Office

I am trying to understand how to develop add-ins/macros in JS for Office, do I need VSTO for it or does it run from Office somewhere?
I did understood that Microsoft is making the first steps toward replacing VBa with JS and impemented an API to develop macros in Office.Js simmilar to the one Google has for it's Docs. But where can I find a development enviroment for Office.js?
The new web-based add-ins are basically a web application executed in the context of the Office application, either on the Desktop (by embedding a browser, IE11 at the moment) or in the browser (Office Online) where everything is web-based already.
The add-in can be hosted on any web resource you like. You just need to specify a source location URI.
Settings and metadata of the add-in are defined in a manifest file. The article Office Add-ins platform overview describes it very well.
Development can be done in any editor or IDE suitable for coding web apps. There is no Alt+F11 VBA IDE anymore, but you may try the Script Lab add-in, a Microsoft Garage project that allows you to try out some code directly in Office and share code snippets. It includes a great collection of sample code too.
The new WebApplications are hosted on a Webserver. You can develop Office Apps with Visual Studio.
Here is a good course for developing Office Apps including an overview of the Javascript Office API:
https://mva.microsoft.com/en-us/training-courses/introduction-to-office-365-development-8329

Log into Outlook via Process without Dialog for password

When I try to run Outlook via Interop using the profile name it opens a dialog for the password. This script is running from Windows Task Scheduler Task. Does it use the admin account when running these tasks? The profile been made and my email account is the only one loaded in here.
The Always prompt for login credentials is unchecked for the account listed in the profile.
This is a network computer in domain. Outlook 2010.
Profile Switch(link):
Process.Start("Outlook", "/profile profilename")
'logs in with a prompt for the password
How can I pass the password in code and avoid the dialog?
Alternatively, I have a macro that does what I need, but I have not been able to get it to run when the profile loads. This would solve the problem as well. Macros enabled is checked in the Trust Center.
Thanks
First, you need to run both application under the same security context to be able to automate one from another.
This app is being launched from Windows Task Scheduler
Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.
If you are building a solution that runs in a server-side context, you should try to use components that have been made safe for unattended execution. Or, you should try to find alternatives that allow at least part of the code to run client-side. If you use an Office application from a server-side solution, the application will lack many of the necessary capabilities to run successfully. Additionally, you will be taking risks with the stability of your overall solution. Read more about that in the Considerations for server-side Automation of Office article.
As a workaround, you may consider usign a low-level API on which Outlook is based on - Extended MAPI. Or any third-party wrapper around that API such as Redemption.

Cloud-based testing automation tools

I try to find a service which provides a functionality that allow me to create manual tests autmation for web-based applications in simple way with visual constructor without any coding, so it could be
simple in use without any coding on selenium or another framework tool
has option to set testing in schedule mode via the web interface to perform regression testing
has ID's validation and shows possible inconsistencies
The main point is reproduce manual tester's work without using automation scripts and do it in simple way in order to a beginner will be able to work with it.
So could anyone describe his own experience ?
There are two main options I would consider
to find a service which provides a functionality that allow me to create manual tests autmation for web-based applications in simple way
First one is BrowserStack and you can record your Selenium tests using the Selenium IDE extension for FireFox. It can export the recorded steps into your favorite language (C#, Python, ect). You can execute these recorded scripts on BrowserStack by pointing the hub URL to Browserstack's Selenium hub ‘http://hub.browserstack.com/wd/hub’ along with your username and Automate key. Your 'username' and 'automate key' can be found at Account --> Automate1, after you have logged in to your account.
I would suggest, you refer to the comprehensive documentation on BrowserStack Automate. It takes you step-by-step through the product and all its features. You can select the language you are using and get started with BrowserStack Automate. If you have any more questions, feel free to email at support#browserstack.com. They will be happy to help you out.
Second option is SauceLabs and the Selenium Builder. This is the docs that will guide you. Further more you have CI integrations for Jenkins and Bamboo.
You can use Selenium IDE to create your automated tests. With this Firefox plugin, you can record a test in your browser.
Once you're done recording, you can export the test and upload it to TestingBot. There you can specify the browsers you want to run the test on. TestingBot will then run your test across all the browsers you specified.

Advantages of Powershell for web-ui testing?

I am working on a commercial project which is a web-based app which will be bundled with an app/web server (JBoss), which is deployed, with the web app files, at runtime.
I've seen links about how Powershell can do UI testing. Is there any advantage in Powershell for web-testing as opposed to Selenium or VS2010's coded UI tests? (Selenium has poor documentation, which is in Powershell's favour, but I am interested in more functional reasons).
Thanks
Powershell will give you advantage if you need to manipulate something else than a browser/webpage/webapp. With Powershell you can do something with OS, applications, things outside the browser.
If you don't need to do that, if you want to automate only web based app, than I would suggest using web specific tool. Selenium is nice, tests in MSVS2010 are great. If you prefer coding try WatiN for .net, and WatiJ for java. All of them will run smoothly not only inside IDE, but also on CI server.