Created
April 17, 2015 10:34
-
-
Save tredence123/18cedde89e7b09820446 to your computer and use it in GitHub Desktop.
sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| casper.test.begin("Pre executed two or more R cells and Rmarkdown cells to be executed using Run All", 12, function suite(test) { | |
| var x = require('casper').selectXPath; | |
| var github_username = casper.cli.options.username; | |
| var github_password = casper.cli.options.password; | |
| var rcloud_url = casper.cli.options.url; | |
| var functions = require(fs.absolute('basicfunctions')); | |
| var input_code = "50+50" ; | |
| var expected_result = "100"; | |
| var errors = []; | |
| casper.start(rcloud_url, function () { | |
| casper.page.injectJs('jquery-1.10.2.js'); | |
| }); | |
| casper.wait(10000); | |
| casper.viewport(1024, 768).then(function () { | |
| functions.login(casper, github_username, github_password, rcloud_url); | |
| }); | |
| casper.viewport(1024, 768).then(function () { | |
| this.wait(9000); | |
| console.log("validating that the Main page has got loaded properly by detecting if some of its elements are visible. Here we are checking for Shareable Link and Logout options"); | |
| functions.validation(casper); | |
| }); | |
| //Create a new Notebook. | |
| functions.create_notebook(casper); | |
| casper.then(function(){ | |
| this.click({type:'xpath', path:"/html/body/div[3]/div/div[2]/div/div[3]/div[1]/div/span/i"});//creating 1st R cell | |
| this.wait(3000); | |
| var form = document.evaluate(".//*[@id='part1.R']/div[2]/div[2]/select", document, null,XPathResult.FIRST_ORDERED_NODE_TYPE); | |
| }); | |
| casper.wait(10000); | |
| casper.run(function () { | |
| test.done(); | |
| }); | |
| }); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You should use