From 03b106b38b7b892ef4f41bc01a7e13ef493d7500 Mon Sep 17 00:00:00 2001 From: Elisa Hilprecht Date: Mon, 16 Mar 2015 10:56:34 +0100 Subject: [PATCH] Add test for testing download button. (comment out logs for determine-os.js) --- public/javascripts/determine-os.js | 4 +-- .../integration/IntegrationSetupSpec.scala | 26 +++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 test/com/yetu/oauth2provider/integration/IntegrationSetupSpec.scala diff --git a/public/javascripts/determine-os.js b/public/javascripts/determine-os.js index 54f0f24..2f434cf 100644 --- a/public/javascripts/determine-os.js +++ b/public/javascripts/determine-os.js @@ -84,8 +84,8 @@ switch (os) { requiredOS = [requiredOSWin, requiredOSMac]; break; } -console.info("OS: " + os + ", Version:" + osVersion) ; -console.log('available', downloadAvailable) +//console.info("OS: " + os + ", Version:" + osVersion) ; +//console.log('available', downloadAvailable) if(downloadAvailable){ document.getElementById('download_available').setAttribute('style','display:block;'); } diff --git a/test/com/yetu/oauth2provider/integration/IntegrationSetupSpec.scala b/test/com/yetu/oauth2provider/integration/IntegrationSetupSpec.scala new file mode 100644 index 0000000..bb2cea0 --- /dev/null +++ b/test/com/yetu/oauth2provider/integration/IntegrationSetupSpec.scala @@ -0,0 +1,26 @@ +package com.yetu.oauth2provider.integration + +import com.yetu.oauth2provider.base.BaseMethods +import org.scalatestplus.play.{ OneServerPerSuite, OneBrowserPerSuite, HtmlUnitFactory, PlaySpec } +import play.api.Logger + +/** + * Created by elisahilprecht on 16/03/15. + */ +class IntegrationSetupSpec extends PlaySpec with OneServerPerSuite with OneBrowserPerSuite with HtmlUnitFactory with BaseMethods { + + "Download page" must { + "title must be 'Download'" in { + go to (s"http://localhost:$port" + setupDownloadUrl) + pageTitle mustBe "Download" + Logger.info(pageSource) + + } + "show new content when clicking on download" in { + //TODO: why it is a windows user agent + find(id("download_win1")) must be ('defined) + click on find(id("download_win1")).value + eventually { find(id("fullContainer")) must be ('defined) } + } + } +} \ No newline at end of file