atata-framework / atata

C#/.NET test automation framework for web
https://atata.io
Apache License 2.0
490 stars 80 forks source link

Add `OnRefreshed` navigation method #798

Closed YevgeniyShunevych closed 9 months ago

YevgeniyShunevych commented 9 months ago

The new method was added to Go and AtataNavigator classes:

public T OnRefreshed<T>()
    where T : PageObject<T>;

Continues with the specified page object type with rage refresh. Firstly, checks whether the current AtataContext.PageObject is T, if it is, returns it; otherwise, creates a new instance of T without navigation. Then a page is refreshed. The method is useful in case when you reuse a single test suite driver by tests and want to refresh a page on start of each test to ensure that the page is in clean start state.

Usage

Go.OnRefreshed<SomePage>();