Created
September 19, 2013 21:38
-
-
Save sergiomichels/6630221 to your computer and use it in GitHub Desktop.
_Events with custom test phase
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
| import org.codehaus.groovy.runtime.StackTraceUtils; | |
| //Script para executar os testes unitários de JavaScript | |
| includeTargets << new File("${basedir}/scripts/_RunJavaScriptUnitTests.groovy") | |
| includeTargets << new File("${basedir}/scripts/_RunJavaScriptUiTests.groovy") | |
| /* | |
| * Configuração do Tomcat que é executado internamente, utilizando GZIP para JavaScript. | |
| */ | |
| eventConfigureTomcat = { tomcat -> | |
| tomcat.connector.setAttribute("compression", "on") | |
| tomcat.connector.setAttribute("compressableMimeType", "text/html,text/xml,text/plain,application/javascript") | |
| tomcat.connector.port = serverPort | |
| } | |
| /* | |
| * Declaração das fases de teste customizadas | |
| */ | |
| eventAllTestsStart = { | |
| phasesToRun << "unitjs" | |
| phasesToRun << "uijs" | |
| } | |
| //tipos de arquivos a serem executados (não usado atualmente) | |
| unitjsTests = ["unitjs"] | |
| uijsTests = ["uijs"] | |
| unitjsTestPhasePreparation = { } | |
| unitjsTestPhaseCleanUp = { } | |
| uijsTestPhasePreparation = { | |
| functionalTestPhasePreparation() | |
| } | |
| uijsTestPhaseCleanUp = { | |
| functionalTestPhaseCleanUp() | |
| } | |
| eventTestPhaseEnd = { phase -> | |
| if (phase == "unitjs") { | |
| runJavaScriptUnitTests() | |
| } else if( phase == "uijs" ) { | |
| runJavaScriptUiTests() //this method just runs phantomjs calling the correct action with ant.exec | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment