Note that there are some explanatory texts on larger screens.

plurals
  1. POGeb Firefox Driver: why my test runs twice?
    primarykey
    data
    text
    <p>Sorry for all this code, but I don't have a clue what's making my issue, so here it goes.</p> <p>I configured the geb plugin to run functional tests with JUnit. So I have in my <strong>buildConfig.groovy</strong>:</p> <pre><code>def seleniumVersion = "2.29.0" def gebVersion = "0.7.0" dependencies { // specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg. // runtime 'mysql:mysql-connector-java:5.1.5' provided('com.oracle:oracle:11.1.0.7.0') provided('com.oracle:i18n:10.2.0.5') test ("org.seleniumhq.selenium:selenium-chrome-driver:$seleniumVersion") { export = false } test("org.seleniumhq.selenium:selenium-firefox-driver:$seleniumVersion"){ excludes "commons-io" export = false } test ("org.seleniumhq.selenium:selenium-ie-driver:$seleniumVersion") { export = false } test ("org.seleniumhq.selenium:selenium-support:$seleniumVersion") { export = false } test ("org.seleniumhq.selenium:selenium-remote-driver:$seleniumVersion") { export = false } test ("org.codehaus.geb:geb-junit4:$gebVersion") { export = false } } plugins { build(":tomcat:$grailsVersion") { export = false excludes 'svn' } compile (":hibernate:$grailsVersion") { export = false excludes 'svn' } build (":release:2.0.0") { excludes 'commons-io','http-builder' export = false } compile(":spring-security-core:1.2.7.3") { excludes 'svn' } compile(":spring-security-ldap:1.0.6") compile (":remote-control:1.3") { export = false } test(":geb:$gebVersion") { export = false } } </code></pre> <p>And I have a <strong>GebConfig.groovy</strong> in my conf folder:</p> <pre><code>driver = { //def driver = new HtmlUnitDriver() //driver.javascriptEnabled = true //driver def driver = new FirefoxDriver() driver } environments { // run as “grails -Dgeb.env=chrome test-app” // See: http://code.google.com/p/selenium/wiki/ChromeDriver chrome { driver = { new ChromeDriver() } } // run as “grails -Dgeb.env=firefox test-app” // See: http://code.google.com/p/selenium/wiki/FirefoxDriver firefox { driver = { new FirefoxDriver() } } } </code></pre> <p>I have a functional test for the login:</p> <pre><code>class LoginTests extends GebReportingTest { @Test void login() { to LoginPage at LoginPage username = "SERGIO" password = "SERGIO" loginButton.click() assert at(IndexPage) link.click() } } </code></pre> <p>And this are my two pages:</p> <pre><code>class LoginPage extends Page { static url = "login/auth" static at = { title ==~ /Efetuar Login/ } static content = { loginForm { $("form", id: "loginForm") } username { $("input", type:"text", id:"username") } password { $("input", type:"password", id:"password") } loginButton{ $("input", type:"submit", id:"submit") } } } class IndexPage extends Page { static at = { title ==~ /Security Service Index View/ } static content = { description { $('h1') } link { $('a') } } } </code></pre> <p>For some reason my functional test run twice and don't matter how I start this:</p> <pre><code>grails test-app :functional grails test-app -functional </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload