How to compare PDF using nightwatch.js - automated-tests

I would like to compare two PDF during an automated test. One will be generate on a website, and the other one will be stored on my computer.
As I am a beginner in automation I would like to know if I can use Nightwatch during an existing test case to compare PDF during a new step.

Related

Using readline(prompt = "") in rMarkdown

I'm currently attempting to automate some statistical report generation, however to do so I would like to collect a couple of piece of information from the user before beginning, then create a markdown report from it.
When knitting the document however it hangs forever because it has no route to receive the user input from. Does anyone know of one, or would it be a case of using a separate r script to gather the information then using calling the report generation from within that using rmarkdown::render?
You could embed a Shiny app or make use of parameterized reports in the Rmarkdown document. Without further detail (eg some code), it is hard to tell you more.
I hope that this helps, though.

Tie R script and QlikSense software together

I require qliksense to create an Excel file when the user selects a set of tuples and R to automatically pick up this file, perform my script on the file. My script then creates another CSV file which I then want qliksense to automatically pick up and perform some predefined operations on it. Is there any way I can link the two of these software together in such a manner?
So to clarify the flowchart is: Qlik gets a large data set -> the user selects a set of rows and creates csv -> My custom R script (picks up this csv automatically) is run on the csv and creates a new csv -> qlik picks it up (automatically) and visually displays the results of the program
Is there any kind of wrapper software to tie them together? Or is it a better idea to perhaps just make some sort of UI that works with R in the background and the user can manually pass the file through the UI? Thanks for the help.
Check out the R extension that has been developed on http://branch.Qlik.com , extensions are being created and added all the time. You will probably need to create an account to access the project but once you have the direct link is below.
http://branch.qlik.com/#/project/5677d32d7f70718900987bdd

Implement whole R script contains functions into shiny

I have a complex R script which contains many new declared functions. These functions are able to check and clear given file under some requirements.
I want to prepare a simple user interface, where people without any knowledge about R will be able to upload source file, choose some options, and download analysed file without looking into a code.
I prepared a simple shiny app which contains my archival R code in the past, however each time when I want to perform some calculations, I had to use reactive() and add () after each variable.
This time, script is too complex to adjust it to reactive() form.
Is there any way to implement whole R script with avoid this?

How to create an interactive script in R to simplify/partly automate the data exploration part?

I would like to make an interactive menu in R - that interacts with me and then performs the selected tasks...I did some googling on interactive R / R user menu / etc. but nothing really helped.
I would like to present myself with the following interactive menu
clear all memory
load data
run regression model
run cluster model
Make a choice please (1,2,3 or 4):
based on the selection it would ask additional input (eg. after option 2, load data it would give all the files present in the data/in directory under my project prepended with a number so I could choose which file to load by simply entering 1,2,3, etc.
I do prepare different datasets to run with my script (for different segments or scenarios) and would like to quickly switch between these. eg. business operational plan Oct'12, consumer budget plan, etc. Also I would not like to reload my data over and over again..
I was thinking of building something 'pseudocode' like
print the menu
ask user for input
ifelse(menuinput==1, source(script1.r),
ifelse(menuinput== 2,source(script2.r),
ifelse(menuinput==3,source(script3.r),NA)))
But I am not sure if there are easier ways to do this.
Thanks,
Geoffrey
If you need to design a customized menu I suggest you take a look Shiny by the folks at Rstudio.
I am using it to create an analysis and data-manipulation GUI for my students. It is a work in progress but should give you an idea of some of the things that are possible. Code and installation instructions linked below:
https://github.com/mostly-harmless/radyant
To see it in action on a server:
http://vnijs.rady.ucsd.edu:3838/marketing/

web based report generation that supports R (or just external programs)

I'm getting quite good at generating one off reports using R / Sweave / Knitr to process a template with R code that gets database data and produces a pdf / html / text / md or odf file, and I'm providing them more and more to users.
Ideally I'd love to provide an easy way for users to request a particular template with particular settings, then pick up the results of that report.
Can anyone suggest something like this, web based or whatever that will support an R / sweave workflow ??
Edit: Generating these reports (sweave'ing or knit'ting) can take a while, 3-5 mins, so support for requesting and later pickup is a must. In addtion multi user support would be good (i.e Bob can't see Jane's reports)
If you want a true, interactive, web-based R framework, I'd strongly recommend taking a look at RStudio's new app: Shiny.
If you actually just want static reports of the PDF/HTML variety, I don't know that you need much to get that off the ground. You're basically just looking to take form-based input from a web page, pass that to R, run your reports, and offer the file as a download.
To build a simple HTML form, PHP would be dead-simple and supported by most hosting providers.
Then use something like PHP's system() function to call your RScript code passing the parameters in that call.
In R, use the commandArgs() function to extract the parameters specified to your script, generate the report.
Offer the generated report to the web user.
If you wanted something more comprehensive, you can look at setting up RApache or a similar technology, but I really think with the amount of effort you'd expend setting that up, you (and your users) would probably be better off using Shiny and getting the benefits of interactivity.

Resources