Created
January 15, 2015 19:47
-
-
Save DinisCruz/191b83fa2fbb72aa3134 to your computer and use it in GitHub Desktop.
script to automatically open swagger ui in chrome
This file contains 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
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