Java源码示例:net.serenitybdd.screenplay.Question
示例1
public static Question<Float> cashBalanceFor(Client client) {
return new RestQuestionBuilder<Float>().about("Cash account balance")
.to(BDDTraderEndPoints.ClientPortfolio.path())
.with(request -> request.pathParam("clientId", client.getId()))
.returning(response -> response.path("cash"));
}
示例2
public static Question<Integer> idFor(Client client) {
return new RestQuestionBuilder<Integer>().about("Cash account balance")
.to(BDDTraderEndPoints.ClientPortfolio.path())
.with(request -> request.pathParam("clientId", client.getId()))
.returning(response -> response.path("portfolioId"));
}
示例3
public static Question<List<Position>> positionsForClient(Client registeredClient) {
return new RestQuestionBuilder<List<Position>>()
.about("positions for client " + registeredClient)
.to(BDDTraderEndPoints.ClientPortfolioPositions.path())
.with(request -> request.pathParam("clientId", registeredClient.getId()))
.returning(response -> response.jsonPath().getList("", Position.class));
}
示例4
public static Question<ElementAvailability> resultsGrid() {
return new SearchResultsGrid();
}
示例5
public static Question<ElementAvailability> price() {
return new SearchResultsGridItemPrice();
}
示例6
public static Question<String> checkForTitle() {
return new SearchResultsResponseTitle();
}
示例7
public static Question<String> url() {
return new TheCurrent();
}
示例8
public static Question<?> forTheItemCalled(String itemName) {
return Instrumented.instanceOf(TheItemStatus.class).withProperties(itemName);
}
示例9
public Question<ProjectInformation> information() {
return new ProjectWidgetInformation(projectOfInterest);
}
示例10
public Question<WebElementState> state() {
return new ProjectWidgetState(projectOfInterest);
}
示例11
public Question<String> details() {
return new ProjectWidgetDetails(projectOfInterest);
}
示例12
public Question<WebElementState> badges() {
return new ProjectBadgesState(projectOfInterest);
}
示例13
public Question<String> pipelineStages() {
return new ProjectWidgetPipelineStages(projectOfInterest);
}
示例14
public static Question<List<String>> displayed() {
return new GoogleSearchResults();
}
示例15
public Question<String> executedBuilds() { return new ProjectWidgetBuilds(projectOfInterest); }