simplify tests

This commit is contained in:
a.krasnov
2020-12-01 23:41:11 +03:00
parent 3b5714d6ef
commit 44662ae0a4
61 changed files with 235 additions and 1591 deletions
-12
View File
@@ -1,6 +1,5 @@
import pytest
import os
from screenshot_tests.page_objects.elements import PageBoundGeneric
from conftest import Config
from typing import Type
@@ -16,14 +15,3 @@ class TestCase:
def configure(self, request):
self.base_url = request.config.getoption(Config.BASE_URL)
self.staging = request.config.getoption(Config.STAGING)
def get_page(self, page_class: Type[PageBoundGeneric]) -> PageBoundGeneric:
"""Create instance of web page and return it."""
path = page_class.path
if path is None:
raise TypeError(f"Path in {page_class} is None!")
page = page_class(self.driver)
self.driver.get(os.path.join(self.base_url, path))
return page