Class ClickAndWaitForDocumentReady
- Namespace
- CSF.Screenplay.Selenium.Tasks
- Assembly
- CSF.Screenplay.Selenium.dll
Screenplay task similar to Click but which additionally waits for a page-load to complete after clicking.
public class ClickAndWaitForDocumentReady : ISingleElementPerformable, ICanReportForElement
- Inheritance
-
ClickAndWaitForDocumentReady
- Implements
- Inherited Members
Remarks
Use this task via ClickOn(element).AndWaitForANewPageToLoad().
The benefit of this task is that it ensures that (following a page-load navigation), the incoming page is ready before
subsequent performables are executed.
Constructors
ClickAndWaitForDocumentReady(TimeSpan)
Initializes a new instance of the ClickAndWaitForDocumentReady class.
public ClickAndWaitForDocumentReady(TimeSpan waitTimeout)
Parameters
waitTimeoutTimeSpanThe maximum duration to wait for the document to be ready.
Methods
GetReportFragment(Actor, Lazy<SeleniumElement>, IFormatsReportFragment)
Counterpart to GetReportFragment(Actor, IFormatsReportFragment) except that this method also offers a Selenium element.
public ReportFragment GetReportFragment(Actor actor, Lazy<SeleniumElement> element, IFormatsReportFragment formatter)
Parameters
actorActorAn actor for whom to write the report fragment
elementLazy<SeleniumElement>The Selenium element for which the report is being written
formatterIFormatsReportFragmentA report-formatting service
Returns
- ReportFragment
A human-readable report fragment.
Remarks
Please see the documentation for GetReportFragment(Actor, IFormatsReportFragment) for more information.
PerformAsAsync(ICanPerform, IWebDriver, Lazy<SeleniumElement>, CancellationToken)
Counterpart to PerformAsAsync(ICanPerform, CancellationToken) except that this method also offers a Selenium WebDriver and element.
public ValueTask PerformAsAsync(ICanPerform actor, IWebDriver webDriver, Lazy<SeleniumElement> element, CancellationToken cancellationToken = default)
Parameters
actorICanPerformThe actor that is performing.
webDriverIWebDriverThe Selenium WebDriver provided from the actor's abilities.
elementLazy<SeleniumElement>The single Selenium Element upon which this method should operate.
cancellationTokenCancellationTokenAn optional cancellation token by which to abort the performable.
Returns
- ValueTask
A task which completes when the performable represented by the current instance is complete.