# Path: selene/support/shared/browser.py
# class SharedBrowser(Browser):
#         class CallableString(str):
#     def __init__(self, config: SharedConfig):
#     def config(self) -> SharedConfig:
#     def with_(self, config: Config = None, **config_as_kwargs) -> Browser:
#     def open(self, relative_or_absolute_url: str):
#     def driver(self) -> WebDriver:
#         def return_driver(this) -> WebDriver:
#     def save_screenshot(self, file: str = None):
#     def last_screenshot(self) -> str:
#     def latest_screenshot(self) -> str:
#             def __new__(cls, value):
#             def __call__(self, *args, **kwargs):
#             def __bool__(self):
#     def save_page_source(self, file: str = None) -> Optional[str]:
#     def last_page_source(self) -> str:
#     def latest_page_source(self):
#     def quit(self) -> None:
#     def quit_driver(self):
#     def close(self):
#     def set_driver(self, webdriver: WebDriver):
#     def open_url(self, absolute_or_relative_url):
#     def elements(self, css_or_xpath_or_by: Union[str, tuple]) -> Collection:
#     def wait_to(self, webdriver_condition, timeout=None, polling=None):
#     def execute_script(self, script, *args):
#     def title(self):
#     def take_screenshot(self, path=None, filename=None):
# 
# Path: tests/examples/todomvc/pagemodules_approach/pages/tasks.py
# def visit():
# def filter_active():
# def filter_completed():
# def add(*task_texts):
# def toggle(task_text):
# def should_be(*task_texts):
# def clear_completed():


from selene.support.shared import browser
from tests.examples.todomvc.pagemodules_approach.pages import tasks
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.


class TestTodoMVC:
    def teardown(self):
        browser.driver.execute_script('localStorage.clear()')

    def test_filter_tasks(self):
        tasks.visit()

        tasks.add('a', 'b', 'c')
        tasks.should_be('a', 'b', 'c')

        tasks.toggle('b')

        tasks.filter_active()
        tasks.should_be('a', 'c')


# Path: selene/support/shared/browser.py
# class SharedBrowser(Browser):
#         class CallableString(str):
#     def __init__(self, config: SharedConfig):
#     def config(self) -> SharedConfig:
#     def with_(self, config: Config = None, **config_as_kwargs) -> Browser:
#     def open(self, relative_or_absolute_url: str):
#     def driver(self) -> WebDriver:
#         def return_driver(this) -> WebDriver:
#     def save_screenshot(self, file: str = None):
#     def last_screenshot(self) -> str:
#     def latest_screenshot(self) -> str:
#             def __new__(cls, value):
#             def __call__(self, *args, **kwargs):
#             def __bool__(self):
#     def save_page_source(self, file: str = None) -> Optional[str]:
#     def last_page_source(self) -> str:
#     def latest_page_source(self):
#     def quit(self) -> None:
#     def quit_driver(self):
#     def close(self):
#     def set_driver(self, webdriver: WebDriver):
#     def open_url(self, absolute_or_relative_url):
#     def elements(self, css_or_xpath_or_by: Union[str, tuple]) -> Collection:
#     def wait_to(self, webdriver_condition, timeout=None, polling=None):
#     def execute_script(self, script, *args):
#     def title(self):
#     def take_screenshot(self, path=None, filename=None):
# 
# Path: tests/examples/todomvc/pagemodules_approach/pages/tasks.py
# def visit():
# def filter_active():
# def filter_completed():
# def add(*task_texts):
# def toggle(task_text):
# def should_be(*task_texts):
# def clear_completed():


# Path: tests/examples/todomvc/pagemodules_approach/todomvc_test.py
from selene.support.shared import browser
from tests.examples.todomvc.pagemodules_approach.pages import tasks

# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.


class TestTodoMVC:
    def teardown(self):
        browser.driver.execute_script('localStorage.clear()')

    def test_filter_tasks(self):
        tasks.visit()

        tasks.add('a', 'b', 'c')
        tasks.should_be('a', 'b', 'c')

        tasks.toggle('b')

        tasks.filter_active()
        tasks.should_be('a', 'c')


        tasks.filter_completed()