Skip to content
This repository was archived by the owner on May 30, 2023. It is now read-only.

phantomjs, Jasmine, and CI #7

Closed
wants to merge 2 commits into from
Closed

phantomjs, Jasmine, and CI #7

wants to merge 2 commits into from

Conversation

gmusick
Copy link

@gmusick gmusick commented Feb 15, 2011

Great tool! I wanted to use it to run my Jasmine tests headless as a part of my CI, which, for reporting purposes, needs results written to a file in an XML format. I made some updates that allow for file writing and also loading up a local file using relative paths rather than using the file:/// notation. I edited the run-jasmine.js example to use these features. run-jasmine.js now exposes a window.fileWriter object which can be used by a custom Jasmine reporter to write results to disk (see https://github.com/gmusick/jasmine-reporters/blob/master/nunit-reporter.js for an example reporter that does this).

Thanks,

Greg

- Spec runner html file can be loaded up as a local file rather than a url
- window.fileWriter.write() API is set up so a jasmine reporter could
  write out its results to a file for CI
- Get run results from Jasmine API rather than html scraping
@ariya
Copy link
Owner

ariya commented Feb 16, 2011

The file access is rather dangerous with proper sandboxing, see issue 41 (http://code.google.com/p/phantomjs/issues/detail?id=41). Until the better security model is implement, this poses too much risk for the user.

As a workaround, the result can be written out to stdout using console.log and then redirected to a file (when invoking phantomjs).

I've been using practically the above approach for CI, it works rather well. To overcome the file:// scheme problem and use relative path instead, it is wrapped in a simple shell script which would invoke phantomjs + run-jasmine with the proper local file URL using file scheme.

@ariya ariya closed this Feb 16, 2011
@andronick83 andronick83 mentioned this pull request Mar 15, 2013
This was referenced Jul 1, 2013
@tigerfz tigerfz mentioned this pull request Feb 5, 2015
ghost pushed a commit that referenced this pull request Dec 22, 2017
ghost pushed a commit that referenced this pull request Dec 26, 2017
* removed'='

* removed'=' #2

* removed'=' #3

* removed '=' #4

* removed '=' #5

* removed '=' #6

* removed '=' #7
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants