Skip to content

Instantly share code, notes, and snippets.

@DinisCruz
Created January 15, 2015 19:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DinisCruz/191b83fa2fbb72aa3134 to your computer and use it in GitHub Desktop.
Save DinisCruz/191b83fa2fbb72aa3134 to your computer and use it in GitHub Desktop.
script to automatically open swagger ui in chrome
QA_NWR_API = require './TM-QA-NWR-API'
app = require '../../app'
describe.only 'swagger', ->
page = QA_NWR_API.create(before, after)
url = 'http://localhost:8002/'
server = null
before (done)->
server = app.listen(8002);
url.append('docs').GET (html)->
html.assert_Is_String()
url.append('api-docs').GET_Json (json)->
#log json
done()
after ->
server.close()
url.GET (html)->
assert_Is_Null(html)
done()
it 'open docs', (done)->
page.chrome.open url + 'api-docs', ()->
page.chrome.open url + 'docs', ()->
200.wait ->
page.click 'pet',->
page.chrome.eval_Script "$('.endpoint .options a')[0].click()", ->
done()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment