Skip to content

Commit

Permalink
Fix test_screenshot_remove
Browse files Browse the repository at this point in the history
  • Loading branch information
VladimirPodolian committed Dec 24, 2024
1 parent 00abbc8 commit 9ddefaf
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 3 deletions.
9 changes: 9 additions & 0 deletions tests/adata/pages/colored_blocks_page.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
from typing import List

from dyatel.base.element import Element
from dyatel.base.group import Group
from dyatel.base.page import Page
from tests.settings import domain_name, repo_name


class Row(Group):
def __init__(self, locator, name: str):
self.card = Element('.card', name=f'any colored block of {name}')
super().__init__(locator, name=name)


class ColoredBlocksPage(Page):

def __init__(self):
Expand All @@ -13,6 +20,8 @@ def __init__(self):
url = f'{domain_name}/{repo_name}/colored_blocks.html'

blocks_container = Element('.container', name='colored blocks container')
row1 = Row('row-1', name='first blocks row')
row2 = Row('row-2', name='second blocks row')
card = Element('.card', name='any colored block')
navbar = Element('.navbar', name='navbar')

Expand Down
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 8 additions & 3 deletions tests/web_tests/test_assert_screenshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,14 @@ def test_screenshot_name_with_suffix(base_playground_page, driver_name, platform
base_playground_page.kube.scroll_into_view().assert_screenshot(filename, name_suffix='second')


def test_screenshot_remove(base_playground_page):
base_playground_page.text_container.scroll_into_view(sleep=0.5).assert_screenshot(
remove=[base_playground_page.inner_text_1, base_playground_page.inner_text_2])
def test_screenshot_remove(colored_blocks_page):
row2_card = colored_blocks_page.row2.card
cards = row2_card.wait_elements_count(8).all_elements
colored_blocks_page.row2.assert_screenshot(
scroll=True,
remove=[cards[5], cards[3]],
delay=0.5
)


@pytest.fixture
Expand Down

0 comments on commit 9ddefaf

Please sign in to comment.