diff --git a/test/asammdf/gui/widgets/test_FileWidget_Shortcuts.py b/test/asammdf/gui/widgets/test_FileWidget_Shortcuts.py index c21bd6bdc..820ffc816 100644 --- a/test/asammdf/gui/widgets/test_FileWidget_Shortcuts.py +++ b/test/asammdf/gui/widgets/test_FileWidget_Shortcuts.py @@ -390,33 +390,33 @@ def test_FileWidget_Shortcut_Key_Period(self): )[0] rect = QRect(x - 4, y - 4, 11, 10) # One dot + 1 pixel surface - pm = Pixmap.color_map(plot.plot.grab(rect)) + pm_with_dots = Pixmap.color_map(plot.plot.grab(rect)) # Black coverage with_dots_black_coverage = 0 - for cov in pm.values(): + for cov in pm_with_dots.values(): with_dots_black_coverage += cov.count(Pixmap.COLOR_BACKGROUND) # Event QTest.keySequence(self.widget, QKeySequence(self.shortcuts["set_line_style"])) self.processEvents(0.1) # Gat new pixmap - pm = Pixmap.color_map(plot.plot.grab(rect)) + pm_without_dots = Pixmap.color_map(plot.plot.grab(rect)) # New black coverage without_dots_black_coverage = 0 - for cov in pm.values(): + for cov in pm_without_dots.values(): without_dots_black_coverage += cov.count(Pixmap.COLOR_BACKGROUND) - + debug = f"pixmap : {pm_with_dots} : pixmap || pixmap : {pm_without_dots} : pixmap" # Evaluate - self.assertGreater(without_dots_black_coverage, with_dots_black_coverage) + self.assertGreater(without_dots_black_coverage, with_dots_black_coverage, debug) # Event QTest.keySequence(self.widget, QKeySequence(self.shortcuts["set_line_style"])) self.processEvents(0.1) # Gat new pixmap - pm = Pixmap.color_map(plot.plot.grab(rect)) + pm_with_dots = Pixmap.color_map(plot.plot.grab(rect)) # New black coverage new_with_dots_black_coverage = 0 - for cov in pm.values(): + for cov in pm_with_dots.values(): new_with_dots_black_coverage += cov.count(Pixmap.COLOR_BACKGROUND) # Evaluate diff --git a/test/asammdf/gui/widgets/test_PlotWidget_Shortcuts.py b/test/asammdf/gui/widgets/test_PlotWidget_Shortcuts.py index 6d424d954..53b22d9c5 100644 --- a/test/asammdf/gui/widgets/test_PlotWidget_Shortcuts.py +++ b/test/asammdf/gui/widgets/test_PlotWidget_Shortcuts.py @@ -146,9 +146,9 @@ def test_Plot_Plot_Shortcut_Key_2(self): self.processEvents(1) for _ in range(100): self.processEvents(0.01) - + pm = Pixmap.color_map(self.widget.grab()) # Evaluate - self.assertTrue(Pixmap.is_black(self.plot.plot.viewport().grab()), f"pixmap : {self.widget.grab()} : pixmap") + self.assertTrue(Pixmap.is_black(self.plot.plot.viewport().grab()), f"pixmap : {pm} : pixmap") # case 1 self.mouseClick_WidgetItem(self.channels[0]) @@ -748,11 +748,13 @@ def test_Plot_Plot_Shortcut_Keys_Backspace__Shift_Backspace__Shift_W(self): - Evaluate that after pressing key "Backspace", y_range isn't equal with previous ranges """ # Setup - self.widget.showMaximized() + if not self.plot.focused_mode_btn.isFlat(): + QTest.mouseClick(self.plot.focused_mode_btn, Qt.MouseButton.LeftButton) self.plot.plot.viewbox.menu.set_x_zoom_mode(True) self.plot.plot.viewbox.menu.set_y_zoom_mode(True) self.plot.plot.viewbox.setMouseMode(3) self.plot.plot.setFocus() + self.processEvents(0.1) # add channel to plot self.assertIsNotNone(self.add_channels([35])) # Toggle full screen @@ -764,6 +766,10 @@ def test_Plot_Plot_Shortcut_Keys_Backspace__Shift_Backspace__Shift_W(self): y_range = self.plot.plot.signals[0].y_range # Events + self.mouseClick_WidgetItem(self.channels[0]) + self.processEvents(1) + for _ in range(100): + self.processEvents(0.01) # Click in the center of the plot QTest.mouseClick( self.plot.plot.viewport(),