Wiki Article

Draft:Geb (testing framework)

Nguồn dữ liệu từ Wikipedia, hiển thị bởi DefZone.Net

Geb
Original authorsLuke Daley, Marcin Erdmann
DevelopersLuke Daley, Marcin Erdmann
Stable release
8.0.1 / November 11, 2025; 3 months ago (2025-11-11)
TypeTest framework
LicenseApache 2.0
Websitegroovy.apache.org/geb/
Repositorygithub.com/apache/groovy-geb

Geb (pronounced "jeb") is a functional test framework for browser web applications. It is backed by the Selenium WebDriver. The tests are written in the Groovy programming language. The test code syntax uses Groovy DSL that allows describing Page Object models (entire pages and their modules) in a declarative style.[1]

The framework can be integrated with test engines such as Spock, JUnit, and TestNG.[2]

Selecting web content

[edit]

The content of a web page is usually selected via the $ method, which returns an object of the Navigator class. Such an object can wrap one or more objects of the WebDriver WebElement interface and provides additional functionality. The method uses the jQuery style, e.g., the call $("div", 3, title: "section") returns the fourth (indexing begins with 0) DIV element with a title attribute value of "section".

Page object pattern support

[edit]

Geb Page Object models can describe both entire pages and modules that can be shared among different pages, such as navigation bars and footers. The model classes extend the library Page and Model classes.

The special Groovy DSL supports the declarative style and uses nested code blocks in braces, reflecting the elements hierarchy.

Integration with other tools

[edit]

As a WebDriver wrapper, Geb allows direct access to its functionality when needed. Also, since it implements the WebDriver protocol, it can be integrated with Appium and thus supports mobile testing.

Spock, JUnit, and TestNG test engines can be used to run Geb-based tests.

See also

[edit]

References

[edit]
  1. ^ Muschko, Benjamin (19 February 2014). Gradle in Action. Manning. ISBN 978-1-61729-130-2.
  2. ^ Fletcher, Rob (May 2017). Spock: Up and Running. O'Reilly Media, Inc. ISBN 978-1-4919-2328-3.

Category:Cross-platform software Category:Java development tools Category:Java platform Category:Graphical user interface testing Category:Software using the Apache license