|
42 | 42 | import org.testingisdocumenting.webtau.expectation.ActualPathAndDescriptionAware; |
43 | 43 | import org.testingisdocumenting.webtau.expectation.ActualValueExpectations; |
44 | 44 | import org.testingisdocumenting.webtau.expectation.state.VisibleStateAware; |
45 | | -import org.testingisdocumenting.webtau.reporter.StepReportOptions; |
46 | | -import org.testingisdocumenting.webtau.reporter.TokenizedMessage; |
47 | | -import org.testingisdocumenting.webtau.reporter.WebTauStepInput; |
48 | | -import org.testingisdocumenting.webtau.reporter.WebTauStepInputKeyValue; |
| 45 | +import org.testingisdocumenting.webtau.reporter.*; |
49 | 46 |
|
50 | 47 | import java.util.*; |
51 | 48 | import java.util.function.Consumer; |
@@ -367,6 +364,23 @@ public void prettyPrint(PrettyPrinter printer) { |
367 | 364 | new PageElementPrettyPrinter(this, 10).prettyPrint(printer); |
368 | 365 | } |
369 | 366 |
|
| 367 | + @Override |
| 368 | + public void takeSnapshot() { |
| 369 | + execute(tokenizedMessage().action("taking value snapshot").add(pathDescription), |
| 370 | + () -> tokenizedMessage().action("value snapshot is taken").forP().add(pathDescription), |
| 371 | + () -> snapshotValue.take(extractActualValue())); |
| 372 | + } |
| 373 | + |
| 374 | + @Override |
| 375 | + public Object snapshotValue() { |
| 376 | + return snapshotValue.required(); |
| 377 | + } |
| 378 | + |
| 379 | + @Override |
| 380 | + public Object currentValue() { |
| 381 | + return extractActualValue(); |
| 382 | + } |
| 383 | + |
370 | 384 | List<HtmlNode> extractHtmlNodes() { |
371 | 385 | return extractHtmlNodes(findElements()); |
372 | 386 | } |
@@ -574,21 +588,6 @@ private void checkNotNullAndExecuteScriptOnElement(String actionLabel, String sc |
574 | 588 | ((JavascriptExecutor) driver).executeScript(script, argsList.toArray(new Object[0])); |
575 | 589 | } |
576 | 590 |
|
577 | | - @Override |
578 | | - public void takeSnapshot() { |
579 | | - snapshotValue.take(extractActualValue()); |
580 | | - } |
581 | | - |
582 | | - @Override |
583 | | - public Object snapshotValue() { |
584 | | - return snapshotValue.required(); |
585 | | - } |
586 | | - |
587 | | - @Override |
588 | | - public Object currentValue() { |
589 | | - return extractActualValue(); |
590 | | - } |
591 | | - |
592 | 591 | private Object extractActualValue() { |
593 | 592 | return isMarkedAsAll ? |
594 | 593 | valuesList.get() : |
|
0 commit comments