Skip to content

Commit

Permalink
Made reading UI values more fluent.
Browse files Browse the repository at this point in the history
The narrative was interrupted by the .value() so hidden away for now behind a more fluent method
  • Loading branch information
wakaleo committed Feb 5, 2016
1 parent c28a95e commit 5cb49b2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package net.serenitybdd.screenplay.questions;

public class ValueOf {
public static <OUTPUT> OUTPUT the(UIState<OUTPUT> answer) {
return answer.value();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,18 @@ class WhenReadingUIValues extends Specification {
SelectedOptions.of(target).viewedBy(actor).asList() == [["value1", "value2"], ["value3", "value4"]]
}

def "should read css value"() {
def "should be able to read values without calling value() directly"() {
when:
element.getCssValue("font") >> "Italics"
then:
CSSValue.of(target).named("font").viewedBy(actor).value() == "Italics"
ValueOf.the(CSSValue.of(target).named("font").viewedBy(actor)) == "Italics"
}
def "should read css value"() {
when:
element.getCssValue("font") >> "Italics"
then:
CSSValue.of(target).named("font").viewedBy(actor).value() == "Italics"
}
def "should read multiple css values"() {
Expand Down

0 comments on commit 5cb49b2

Please sign in to comment.