net.jockx:fluent-page

Extension for Thucydides PageObject with support for fluent object method, log and assertion calls

License

License

MIT License
Categories

Categories

Net
GroupId

GroupId

net.jockx
ArtifactId

ArtifactId

fluent-page
Last Version

Last Version

1.1
Release Date

Release Date

Type

Type

jar
Description

Description

net.jockx:fluent-page
Extension for Thucydides PageObject with support for fluent object method, log and assertion calls
Project URL

Project URL

http://fluent-page.jockx.net
Source Code Management

Source Code Management

https://github.com/JockX/fluent-page

Download fluent-page

How to add to project

<!-- https://jarcasting.com/artifacts/net.jockx/fluent-page/ -->
<dependency>
    <groupId>net.jockx</groupId>
    <artifactId>fluent-page</artifactId>
    <version>1.1</version>
</dependency>
// https://jarcasting.com/artifacts/net.jockx/fluent-page/
implementation 'net.jockx:fluent-page:1.1'
// https://jarcasting.com/artifacts/net.jockx/fluent-page/
implementation ("net.jockx:fluent-page:1.1")
'net.jockx:fluent-page:jar:1.1'
<dependency org="net.jockx" name="fluent-page" rev="1.1">
  <artifact name="fluent-page" type="jar" />
</dependency>
@Grapes(
@Grab(group='net.jockx', module='fluent-page', version='1.1')
)
libraryDependencies += "net.jockx" % "fluent-page" % "1.1"
[net.jockx/fluent-page "1.1"]

Dependencies

compile (3)

Group / Artifact Type Version
org.slf4j : slf4j-api jar 1.7.12
net.thucydides : thucydides-core jar 0.9.275
org.testng : testng jar 6.8.21

Project Modules

There are no modules declared in this project.

Fluent Page for Selenium/Thucydides

Fluent Page is a Selenium/Thucydides PageObject extension adding a bit more functionality to your average PageObject. By making a PageObject extend net.jockx.fluentpage.Page class you can easily chain assertions, logging statements and PageObject's own methods while keeping reference to the page currently processed by WebDriver method calls.

Features:

  • Handle Page Factory initiation automatically - no need to provide constructors for pageObjects
  • Static access to all your PageObject instances
Page.get(SomePageObject.class);
Page.navigateTo(SomePageObject.class);
Page.waitForPage(SomePageObject.class);
  • Fluent access to logger and assertions
Page.navigateTo(SomePage.class)
    .clickButton()
    .assertion.assertTrue(condition, "Message")
    .logger.info("Some logging statement")
    .clickAnotherButton()

Usage:

  • Declare class the following way:
public class MyPageObject extends Page<MyPageObject>
  • Optionally override navigateTo() and waitToLoad()
  • Return a reference to one of your PageObjects from any action method call
PageB clickGoToPageB(){
    gotoPageB.click();
    return Page.waitForPage(PageB.class);
}

Versions

Version
1.1
1.0