geb

Grails — loader constraint violation

China☆狼群 提交于 2019-12-12 05:42:15
问题 In one of my application i have to use geb with grails. i installed geb plugin and added dependency selenium standalone jar. Now the problem is while i cleaning or compiling i got the error like following Interactive mode exited with error: loader constraint violation: when resolving overridden method "org.apache.xerces.jaxp.SAXParserImpl.getXMLReader()Lorg/xml/sax/XMLReader;" the class loader (instance of org/codehaus/groovy/grails/cli/support/GrailsRootLoader) of the current class, org

How to make an element visible using Geb?

﹥>﹥吖頭↗ 提交于 2019-12-12 04:56:06
问题 I have an element with class "popup", which i want to make visible during a functional test. What is the best way to programmatically make the element visible? I am using Geb for functional testing. 回答1: If you use Jquery in your web pages. You could use jquery "show" method to make visible an invisible element. The code would look like this $(".popup", 0).jquery.show(); Note : As per documentation, the jQuery integration only works when the pages you are working with include jQuery, Geb does

Unable to assert axis label text in highcharts using Geb

╄→гoц情女王★ 提交于 2019-12-12 04:53:58
问题 I am writing a geb test that asserts the axis labels in a highcharts graph. The test I wrote works when run with the selenium chrome driver. When I run with phantomjs it fails. //Selector in GEB $(id:"graph-id").find("g.highcharts-legend-item").find("tspan").text() This returns as expected in Chrome. It returns empty in phantomjs. We have to use phantomjs for our CI builds. 回答1: If for whatever reason geb isn't supporting your phantomjs driver properly, you can always execute a javascript

Using Spock Data Tables to Test Geb Page Objects

 ̄綄美尐妖づ 提交于 2019-12-12 04:19:42
问题 Full Disclosure: I'm very new to both Geb and Spock. As part of a test suite I'm working on, we have to test run the same test on several page elements. I would love to be able to abstract this behavior using a Spock data-table. However, when I do this, Geb complains that it doesn't recognize the page property. Here is a bare-bones example of what I'm talking about: when: textBox = value submit() then:"value is updated" at SuccessPage textBox == value where: textBox | value box1 | val1 box2 |

Browser Restart Using Geb & Spock within same test

。_饼干妹妹 提交于 2019-12-12 03:58:04
问题 I would like to be able to restart my browser session mid test using Geb and Spock Framework. I no howto close the browser and update after test compltion etc, but when i close during the test and try and re use the browser object i get a session error thrown by selenium. Below is the base outline i am trying to execute. NB never allows me to navigate to the new StoreHome and if i try and use just Browser i get error thrown. @Category(High.class) def "TC1: Verify Browser Restart"() { when:

Spock: How to run a set of methods as a single test repeatedly?

泄露秘密 提交于 2019-12-12 03:37:14
问题 I have a test case like below: def "Go to home page and click login button and go to login page" { } def "Input user ID and password and click login" { when: code.... then: code.... where: param1 << [ID1,ID2,ID3] param2 << [password1,password2,password3] } The test consists of two defs. I want to repeat the whole process with different ID and Password. How I can do that? For example: - First execute def "Go to home page and click login button and go to login page" - Than execute def "Input

Geb exception when running tests in maven

本秂侑毒 提交于 2019-12-12 02:52:53
问题 I get this exception when I run my tests from command line with maven. My command: mvn -Dtest=specs.full.* -Dtestsystem=Win7/IE test On my local machine, everything works fine. But when I run the tests on our server, where jenkins is installed, I get following exception: java.lang.VerifyError: (class: specs/full/ReadCheckMenuLinks, method: super$8$$spock_feature_3_1 signature: ()V) Illegal use of nonvirtual function call at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class

Configuring Geb and Spock on Jenkins (Grails)

陌路散爱 提交于 2019-12-11 20:19:33
问题 I cannot use port 8080 for my testing. When I set the port to another open port (8090) Geb-Spock tests work fine, but only while running locally on IntelliJ. However, if I try and run a Jenkins build, I come out empty handed. I am pretty certain the problem has something to do with my GebConfig.groovy. Note: I am using xvfb to aid the browser, and I am fairly certain it is configured correctly as it is producing results when configured to 8080. Running on port 8090... Running on port 8080...

Selenium commands not working in Chrome web driver (working with firefox)

情到浓时终转凉″ 提交于 2019-12-11 15:37:53
问题 I'm writing integration/e2e tests and for some reason any selenium driver commands don't see to be working with chromedriver, but they are working flawlessly with firefox driver and the firefox headless driver. Commands tried: moveByOffset , and doubleClick Tried both Geb's Interact method interact { doubleClick(centerClickable) } and accessing the webdriver directly: def driver = browser.getDriver() Actions action = new Actions(driver) WebElement element= driver.findElement(By.className("vis

grails “test-app” fails for functional geb+spock test but “test-app -functional” is successfull

懵懂的女人 提交于 2019-12-11 14:41:50
问题 I have some problems regarding functional testing in Grails using GEB+Spock. If i run "test-app" it always fails, but if i run "test-app -integration" before "test-app" it works! The following test-sequence illustrates my problem: Run #1 grails> clean grails> test-app -functional ... Tests PASSED Run #2 grails> clean grails> test-app ... Tests FAILED Run #3 grails> clean grails> test-app -functional ... Test PASSED grails> test-app ... Test PASSED The tests that are failing are throwing "geb