-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
219 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
.../mir_ci/tests/robot/suites/scale/1.0-gtk4-demo-button-combo-boxes-maximized.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
mir-ci/mir_ci/tests/robot/suites/scale/1.0-gtk4-demo-button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
mir-ci/mir_ci/tests/robot/suites/scale/1.0-gtk4-demo-screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...i/mir_ci/tests/robot/suites/scale/1.0-gtk4-demo-title-combo-boxes-maximized.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
mir-ci/mir_ci/tests/robot/suites/scale/1.0-gtk4-demo-title-main.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
mir-ci/mir_ci/tests/robot/suites/scale/1.0-gtk4-demo-title.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...mir_ci/tests/robot/suites/scale/1.25-gtk4-demo-button-combo-boxes-maximized.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
mir-ci/mir_ci/tests/robot/suites/scale/1.25-gtk4-demo-screenshot-floating.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
mir-ci/mir_ci/tests/robot/suites/scale/1.25-gtk4-demo-screenshot-maximized.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
mir-ci/mir_ci/tests/robot/suites/scale/1.25-gtk4-demo-title-app-title.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
.../mir_ci/tests/robot/suites/scale/1.25-gtk4-demo-title-combo-boxes-maximized.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
.../mir_ci/tests/robot/suites/scale/1.5-gtk4-demo-button-combo-boxes-maximized.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
mir-ci/mir_ci/tests/robot/suites/scale/1.5-gtk4-demo-button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
mir-ci/mir_ci/tests/robot/suites/scale/1.5-gtk4-demo-screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...i/mir_ci/tests/robot/suites/scale/1.5-gtk4-demo-title-combo-boxes-maximized.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
mir-ci/mir_ci/tests/robot/suites/scale/1.5-gtk4-demo-title-main-half.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
mir-ci/mir_ci/tests/robot/suites/scale/1.5-gtk4-demo-title-main.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
mir-ci/mir_ci/tests/robot/suites/scale/1.5-gtk4-demo-title.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...mir_ci/tests/robot/suites/scale/1.75-gtk4-demo-button-combo-boxes-maximized.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
mir-ci/mir_ci/tests/robot/suites/scale/1.75-gtk4-demo-screenshot-floating.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
mir-ci/mir_ci/tests/robot/suites/scale/1.75-gtk4-demo-screenshot-maximized.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
mir-ci/mir_ci/tests/robot/suites/scale/1.75-gtk4-demo-title-app-title.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
.../mir_ci/tests/robot/suites/scale/1.75-gtk4-demo-title-combo-boxes-maximized.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
.../mir_ci/tests/robot/suites/scale/2.0-gtk4-demo-button-combo-boxes-maximized.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
mir-ci/mir_ci/tests/robot/suites/scale/2.0-gtk4-demo-button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
mir-ci/mir_ci/tests/robot/suites/scale/2.0-gtk4-demo-screenshot.png
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
...i/mir_ci/tests/robot/suites/scale/2.0-gtk4-demo-title-combo-boxes-maximized.png
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
mir-ci/mir_ci/tests/robot/suites/scale/2.0-gtk4-demo-title-main.png
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
mir-ci/mir_ci/tests/robot/suites/scale/2.0-gtk4-demo-title.png
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
*** Settings *** | ||
Resource ${KVM_RESOURCE} | ||
|
||
Suite Setup Suite Setup | ||
Test Setup Set Output Scale ${SCALE} | ||
|
||
|
||
*** Variables *** | ||
${T} ${CURDIR} | ||
${SCREENSHOT} ${T}/${SCALE}-gtk4-demo-screenshot.png | ||
${DEMO-APP-TITLE} ${T}/${SCALE}-gtk4-demo-title-main.png | ||
${DEMO-APP-TITLE-HALF} ${T}/${SCALE}-gtk4-demo-title-main-half.png | ||
${BUTTON} ${T}/${SCALE}-gtk4-demo-button.png | ||
${TITLE} ${T}/${SCALE}-gtk4-demo-title.png | ||
|
||
|
||
*** Test Cases *** | ||
Ensure Scaling Is Visually Correct | ||
Move Pointer To Proportional (1.0, 1.0) | ||
|
||
Match ${SCREENSHOT} | ||
|
||
Click Button With Scaling Enabled | ||
Walk Pointer To ${BUTTON} | ||
Click LEFT Button | ||
|
||
Match ${TITLE} | ||
|
||
|
||
*** Keywords *** | ||
Suite Setup | ||
Set Output Scale ${SCALE} | ||
# Work around https://github.com/canonical/mir/issues/3553 | ||
${aligned}= Run Keyword And Return Status | ||
... Walk Pointer To ${DEMO-APP-TITLE} | ||
IF ${aligned} == False Walk Pointer To ${DEMO-APP-TITLE-HALF} | ||
Click LEFT Button | ||
Click LEFT Button |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import itertools | ||
from pathlib import Path | ||
from textwrap import dedent | ||
from typing import Collection | ||
|
||
import pytest | ||
from mir_ci import VARIANT | ||
from mir_ci.fixtures.servers import ServerCap, servers | ||
from mir_ci.program.app import App, AppType | ||
from mir_ci.program.display_server import DisplayServer | ||
|
||
TESTS_PATH = Path(__file__).parent | ||
APP_PATH = "gtk4-demo" | ||
ROBOT_PATH = TESTS_PATH / "robot" | ||
|
||
|
||
def collect_asset(asset: Path, variant): | ||
variants = reversed((variant, *variant.parents[:-1])) | ||
return itertools.chain( | ||
asset.glob("*"), | ||
*((asset / "variants" / v).glob("*") for v in variants), | ||
) | ||
|
||
|
||
def collect_assets(platform: str, resources: Collection[str], suite: str, variant: Path = VARIANT): | ||
return { | ||
p.name: p | ||
for p in itertools.chain( | ||
collect_asset(ROBOT_PATH / "platforms" / platform, variant), | ||
*(collect_asset(ROBOT_PATH / "resources" / resource, variant) for resource in resources), | ||
collect_asset(ROBOT_PATH / "suites" / suite, variant), | ||
) | ||
if p.is_file() | ||
} | ||
|
||
|
||
@pytest.mark.xdg( | ||
XDG_CONFIG_HOME={ | ||
"glib-2.0/settings/keyfile": dedent( | ||
"""\ | ||
[org/gnome/desktop/interface] | ||
color-scheme='prefer-light' | ||
gtk-theme='Adwaita' | ||
icon-theme='Adwaita' | ||
font-name='Ubuntu 11' | ||
cursor-theme='Adwaita' | ||
cursor-size=24 | ||
font-antialiasing='grayscale' | ||
""" | ||
), | ||
}, | ||
) | ||
@pytest.mark.env(GSETTINGS_BACKEND="keyfile") | ||
@pytest.mark.parametrize("server", servers(ServerCap.DISPLAY_CONFIG)) | ||
@pytest.mark.parametrize("scale", [1.0, 1.5, 2.0]) | ||
@pytest.mark.deps( | ||
debs=("gtk-4-examples",), | ||
pip_pkgs=( | ||
("pygobject", "gi"), | ||
("robotframework~=6.1.1", "robot"), | ||
("rpaframework", "RPA"), | ||
("rpaframework-recognition", "RPA.recognition"), | ||
), | ||
) | ||
class TestScale: | ||
async def test_scale(self, robot_log, server, scale, tmp_path) -> None: | ||
extensions = ("all",) # TODO no need to enable all extension | ||
|
||
server_instance = DisplayServer( | ||
server, | ||
add_extensions=extensions, | ||
env={"MIR_SERVER_X11_OUTPUT": "1024x768", "MIR_SERVER_DISPLAY_SCALE": str(scale)}, | ||
) | ||
|
||
assets = collect_assets("wayland", ["kvm"], "scale") | ||
|
||
async with server_instance, server_instance.program(App(APP_PATH, AppType.deb)): | ||
tuple((tmp_path / k).symlink_to(v) for k, v in assets.items()) | ||
|
||
robot = server_instance.program( | ||
App(("robot", "-d", tmp_path, "--log", robot_log, "--variable", f"SCALE:{scale}", tmp_path)) | ||
) | ||
|
||
async with robot: | ||
await robot.wait(120) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters