Skip to content

Commit

Permalink
fast
Browse files Browse the repository at this point in the history
  • Loading branch information
maxime-desroches committed Oct 30, 2024
1 parent 2016628 commit c46dab6
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions selfdrive/ui/tests/test_ui/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def setup(self):
print(f"failed to find ui window, assuming that it's in the top left (for Xvfb) {e}")
self.ui = namedtuple("bb", ["left", "top", "width", "height"])(0,0,2160,1080)

def screenshot(self):
def screenshot(self, name):
im = pyautogui.screenshot(SCREENSHOTS_DIR / f"{name}.png", region=(self.ui.left, self.ui.top, self.ui.width, self.ui.height))
assert im.width == 2160
assert im.height == 1080
Expand All @@ -234,11 +234,8 @@ def click(self, x, y, *args, **kwargs):
@with_processes(["ui"])
def test_ui(self, name, setup_case):
self.setup()

setup_case(self.click, self.pm)

im = self.screenshot()
plt.imsave(SCREENSHOTS_DIR / f"{name}.png", im)
self.screenshot(name)

def create_screenshots():
if TEST_OUTPUT_DIR.exists():
Expand Down

0 comments on commit c46dab6

Please sign in to comment.