Checking email with CasperJS or PhantomJS - automated-tests

I'm looking to use CasperJS/PhantomJS to automate the testing of a project that extensively uses email as part of its process but I keep running into issues when I need check the content of emails in an automated way.
These tools are very capable of crawling through the HTTP version of many email services, but maintaining tests to keep up with UI changes made to external services is not something I want to do.
Do CasperJS or PhantomJS have the ability to use IMAP or POP3 to retrieve mail, or is there a more common solution that is generally implemented?

You can use any nodejs module with Casper:
"Like PhantomJS, CasperJS allows using nodejs modules installed through npm."
So you just need to check the npm repo and test which lib suits you.

Hi using casperjs\Phantomjs you can navigate and automate however for mailing process you have to use nodejs nodemailer module.Try the following command after installing nodejs.
npm install nodemailer#0.7.1.
This installs the nodemailer package and post that you can install the mail clients like sendgrid sendmail or you can just use the nodemailer direct transport but that may cause some delay in mail delivery.
Kindly check the nodemailer scripts and run the script using:
node scriptname.js

PhantomJS (and by extension, Casper) is a web browser - it's not able to use POP or IMAP as far as I know. My first thought as to approach would be to use a separate system for test automation (at least, for those tests that require verifying emails), e.g. using Python, Ruby, or Node.js, invoke Casper via the command line within those tests, and then use a separate tool to check and verify the email.

You could also use a dev smtp server with a web interface like mailcatcher (ruby) or maildev (node).
They also have a rest api, which returns the email in a more stable way than to use the web interface.
I don't tested it, but will soon.

Related

firebase - how do I install software onto a server I have deployed to?

I am getting an error with firebase functions. When I run the functions locally using emulators they work fine. But when I firebase deploy and on subsequent execution of a certain function, I get an error which suggests that the version of ffmpeg installed on the server I have deployed to is out of date
How do I update ffmpeg (or indeed any software) on the server? Maybe I SSH into it and update software? Maybe I should provide some config to define what software my code depends on prior to deployment? Please advise how an update can be done thanks
OPTIONAL READING:
My Node.js code uses execSync(myFfmpegCommand) which is why the dependency exists
Here's my findings.
You cannot install custom software onto a Node.js runtime environment as the disk is read only. If the software you want is not on the runtime environment already then you are stuffed.
I further found that functions are not meant for heavyweight work but just for lightweight ops. If a function needs to do some heavy lifting then it can ask Google App Engine to do it for it. The function communicates with App Engine over HTTP or PubSub.
What is App Engine I hear you ask! It basically allows you to deploy server code to the cloud. For example, think of an express.js server that you typically use for your backend. That's what App Engine is. Then you just deploy it!
App Engine can be configured through a yaml file to determine memory and optionally a Dockerfile to determine what OS to use and what software to install. The yaml looks like this:
runtime: custom # uses Dockerfile
env: flex
manual_scaling:
instances: 1
resources:
cpu: 1
memory_gb: 0.5
disk_size_gb: 10
Consider App Engine as the heavy lifter. When a firebase function wants to do some hard work, it just asks App Engine to do it for it! In this manner, firebase functions become simple event handlers to trigger other work.

Firebase CLI - How to Manage Cloud Functions

Using the firebase-cli you can easily deploy functions and show the logs. But I have yet to find the option to download or retrieve cloud functions.
I've dug through quiet a bit of the -h commands and nothing yet.
Is it possible to download / retrieve a projects cloud functions through the firebase-cli? I tend to switch between computers from home to work and I need to go to the console to copy the source code and redeploy.
The Firebase CLI doesn't provide a way to get deployed code. It's expected that you use some form of source control for managing code between developers and machines.

Does Bonobo git server support web hooks

I would like to set up a Git server on a Windows server using open source code. Bonobo is one of my alternatives, but I can't find information on the support for web hooks.
The answer is - Yes! For an example, see this description of how to use a post receive webhook to trigger a Jenkins build - https://blog.dangl.me/archive/configure-git-hooks-on-bonobo-git-server-in-windows/

How to get list of installed features in Karaf using REST API?

I know using command line it can be get by running feature:list -i but is there any API/JSON available to fetch this?
You can use jolokia and hawtio to retrieve that information. Quite easily. I believe you can easily add the hawtio repo from the native karaf repos in features (repo-add hawtio). Then you need to install jolokio, hawtio, and the karaf web console. From the karaf webconsole alone you can see a full list of features, but I find the hawtio interface to be a god send.
A REST API can be installed without the need for Hawtio, which uses jolokia for accessing the bundle list under the hood.
The jolokia project provides web applications called agents serving a REST API. For quick experiments you can deploy the war jolokia-war-unsecured into the hot deploy folder of a running karaf instance. This installs a A REST web service at e.g. http://localhost/jolokia-war-unsecured/ which does not require any authentications.

Why do we need to deploy a meteor app instead of just starting it?

As we all know, we can run a meteor app by just typing meteor in a terminal.
By default it will start a server and use port 3000.
So why do I need to deploy it using MUP etc.
I can configure it to use port 80 or use nginx to route to port 80 for the app. So the port is not the point.
Edit:
Assume meteor is running on a VPS or cloud server with public IP address, not a personal computer.
MUP does a few extra things you can do yourself:
it 'bundles' the code into a single file, using meteor build bundle
the javascript is one file, and css another; it's minified, and obfuscated so it's smaller and faster to load, and less easy to decipher on the client.
some packages are also meant to be removed when running in production. For example meteorToys, the utility toolset to look up collections and much more, is not bundled into the production bundle, as per the instructions in its package. This insures you don't deploy code with security vulnerabilities (Meteor toys basically opens up client side delete / updates etc... if you're not careful)
So, in short, it installs a minimal version of your site, making sure that what's meant for development only doesn't get push to a production environment.
EDIT: On other reason to do this, is that you don't need all the Meteor build tools on your production server; that can add up to a lot of stuff, especially if you keep caches going for a while...
I believe it also takes care of hooking up to a remote MongoDB Instance (at least it used to be the case on the free meteor site) which is more scalable and fault tolerant than running on the same instance as the web server, as well as provision storage etc... if needed.
basically, to deploy a Meteor app yourself manually, you need to:
on your dev box:
meteor build bundle your app to a tar file (using the architecture flag corresponding to the OS you will use)
on the server:
install node v0.10 (or whatever is the current version of node required by Meteor)
you might have to install Fiber#1.0.5 (but I believe this is now part of meteor install already)
untar the bundle, get into bundle/programs/server/ and run npm install
run the server with node main.js in the bundle folder.
The purpose of deploying an application is that you are situating your project on hardware outside of your local machine. For example if you deploy an application on Heroku app you create a repository on heroku's systems and that code based is used to serve your application off of their servers.
If you just start an application on your personal system, you will suffer a lack of network and resource availability as well as under use of computer time at non-peak hours as your system will need to remain attentive for additional users without having alternative tasks. Hosting providers provide resources as needed, and their diverse client base allows their systems to work around the clock on a global scale.

Resources