Родитель
9555235b06
Коммит
d30edc200e
|
@ -12,7 +12,10 @@ Locator = typing.Tuple[typing.Any, str]
|
|||
|
||||
class QueryDetailPage(Page):
|
||||
|
||||
_query_description_locator: Locator = (By.CSS_SELECTOR, ".edit-in-place p")
|
||||
_query_description_locator: Locator = (
|
||||
By.CSS_SELECTOR,
|
||||
"edit-in-place:nth-child(1) > span:nth-child(1) > p:nth-child(1)",
|
||||
)
|
||||
_query_publish_button_locator: Locator = (By.CSS_SELECTOR, ".btn-publish")
|
||||
|
||||
@property
|
||||
|
@ -25,7 +28,7 @@ class QueryDetailPage(Page):
|
|||
|
||||
class QueryRow(Region):
|
||||
|
||||
_query_link_locator: Locator = (By.CSS_SELECTOR, "td a")
|
||||
_query_link_locator: Locator = (By.CSS_SELECTOR, ".table-main-title a")
|
||||
|
||||
@property
|
||||
def link(self) -> typing.Any:
|
||||
|
@ -40,9 +43,13 @@ class QueryPage(Page):
|
|||
|
||||
URL_TEMPLATE = "{server_url}/{queries}"
|
||||
|
||||
_query_table_locator: Locator = (By.TAG_NAME, "table")
|
||||
_query_table_locator: Locator = (By.CSS_SELECTOR, ".table")
|
||||
_table_row_locator: Locator = (By.TAG_NAME, "tr")
|
||||
|
||||
def wait_for_page_to_load(self) -> typing.Any:
|
||||
self.wait.until(lambda _: self.is_element_displayed(*self._query_table_locator))
|
||||
return self
|
||||
|
||||
@property
|
||||
def queries(self) -> typing.List[QueryRow]:
|
||||
table = self.selenium.find_element(*self._query_table_locator)
|
||||
|
|
|
@ -133,7 +133,7 @@ def fixture_create_user(
|
|||
"""
|
||||
# look up user by email and return if found. If not, create user.
|
||||
response = root_session.get(f"{server_url}/api/users")
|
||||
for user in response.json():
|
||||
for user in response.json()["results"]:
|
||||
if user["email"] == email:
|
||||
return user_factory.create_user(
|
||||
name=name, password=password, email=email, id=user["id"]
|
||||
|
|
|
@ -14,7 +14,7 @@ from pages.login import LoginPage
|
|||
@pytest.mark.parametrize(
|
||||
"search_term, description",
|
||||
[
|
||||
("Default Query", "Test query for redash UI tests."),
|
||||
("Default Query", "Test default query for redash UI tests."),
|
||||
("Ashleys Query", "Query created by Ashley."),
|
||||
],
|
||||
)
|
||||
|
@ -35,7 +35,7 @@ def test_query_by_username(
|
|||
@pytest.mark.parametrize(
|
||||
"search_term, description",
|
||||
[
|
||||
("Default Query", "Test query for redash UI tests."),
|
||||
("Default Query", "Test default query for redash UI tests."),
|
||||
("Ashleys Query", "Query created by Ashley."),
|
||||
],
|
||||
)
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
},
|
||||
"default": {
|
||||
"data_source_id": "1",
|
||||
"description": "Test query for redash UI tests.",
|
||||
"description": "Test default query for redash UI tests.",
|
||||
"name": "Default Query",
|
||||
"query": "this is a test query.",
|
||||
"schedule": 60
|
||||
|
|
Загрузка…
Ссылка в новой задаче