Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🎉 Add custom undo system #118

Merged
merged 32 commits into from
Feb 2, 2022
Merged
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
ebd26aa
:beetle: Fix history lost by manual history creation
FabienRoger Jan 8, 2022
10f9256
:sparkles: Improve lint
FabienRoger Jan 8, 2022
3ff6ff7
:umbrella: Add integration tests for writing, undo and redo
FabienRoger Jan 9, 2022
432c85b
:umbrella: Fix tests and add tests for the history bug
FabienRoger Jan 9, 2022
fe0e794
:umbrella: Add sleep to make tests work
FabienRoger Jan 9, 2022
e570101
:beetle: :umbrella: Fix aux_test_write_in did not call test_write
MathisFederico Jan 12, 2022
02eb52c
:umbrella: Fix editing integration tests
FabienRoger Jan 14, 2022
359e0b4
:beetle: Fix WebPageEngine error by adding a finish test
FabienRoger Jan 14, 2022
0c3b018
:wrench: Rename e -> event
MathisFederico Jan 15, 2022
91606e0
:wrench: Methods to override should raise NotImplementedError
MathisFederico Jan 15, 2022
4e95f79
:hammer: Refactor integration tests with InAppTest
MathisFederico Jan 15, 2022
3bcd2f8
:beetle: Fix block_type was not replaced for herited blocks
MathisFederico Jan 15, 2022
4d4b59a
:beetle: Add missing scene checkpoints
MathisFederico Jan 15, 2022
98d6ea0
:beetle: Add missing block_type argument
MathisFederico Jan 15, 2022
37836a2
:beetle: Add missing checkpoints for pyeditor
MathisFederico Jan 15, 2022
89104fc
:hammer: :umbrella: Refactor test_editing
MathisFederico Jan 15, 2022
a4bf6cd
:twisted_rightwards_arrows: Merge 'origin/dev' into bugfix/historylost
MathisFederico Jan 22, 2022
dca392a
:tada: :memo: Add history logging
MathisFederico Jan 27, 2022
3712453
:tada: Add logging & improve CLI
MathisFederico Jan 27, 2022
95ef2b5
Merge branch 'feature/logging-cli' into bugfix/historylost
MathisFederico Jan 27, 2022
a86d11b
:sparkles: Disable pylint false positive
MathisFederico Jan 27, 2022
3c1a749
Merge remote-tracking branch 'origin/feature/logging-cli' into bugfix…
MathisFederico Jan 27, 2022
29362fe
:beetle: Fix bring_block_forward did not deselect previous
MathisFederico Jan 30, 2022
6beb486
:tada: Add Scene.getItemById to retrieve items by id
MathisFederico Jan 30, 2022
76b5220
:beetle: :umbrella: Fix test_code_blocks_history
MathisFederico Jan 30, 2022
59cd417
:fire: Comment out test_write_code_blocks as checks do not work for n…
MathisFederico Jan 30, 2022
4f738d1
:wrench: Add some sleep timer for CI tests
MathisFederico Jan 30, 2022
d35e4b0
:wrench: ZzzzZzzzZ
MathisFederico Jan 30, 2022
d38bb82
:fire: Comment out tests than work locally only
MathisFederico Feb 2, 2022
630bed2
:memo: Add getItemById docstring
MathisFederico Feb 2, 2022
a2677d8
:wrench: Use of logger warning instead of warn
MathisFederico Feb 2, 2022
b0bf7d2
:fire: Remove unused import
MathisFederico Feb 2, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
☔ Fix editing integration tests
  • Loading branch information
FabienRoger committed Jan 14, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 02eb52c1a51be54a14c3ee797c1c344d2c00c7e4
25 changes: 11 additions & 14 deletions tests/integration/blocks/test_editing.py
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@
"""

import time
from typing import Callable
import pytest
import pyautogui
from pytestqt.qtbot import QtBot
@@ -26,15 +27,6 @@ def setup(self):
start_app(self)
self.code_block = CodeBlock(title="Testing code block 1")
self.code_block_2 = CodeBlock(title="Testing code block 2")
self.markdown_block = MarkdownBlock(title="Testing markdown block")

def test_write_code_blocks(self, qtbot: QtBot):
"""code blocks can be written in."""
self.aux_test_write_in(self.code_block, qtbot)

def test_write_markdown_blocks(self, qtbot: QtBot):
"""markdown blocks can be written in."""
self.aux_test_write_in(self.markdown_block, qtbot)

def test_history_not_lost(self, qtbot: QtBot):
"""code blocks keep their own undo history."""
@@ -97,13 +89,17 @@ def testing_history(msgQueue: CheckingQueue):
"cd\n",
"undo done properly",
)
time.sleep(0.1)

msgQueue.stop()

apply_function_inapp(self.window, testing_history)

def aux_test_write_in(self, block: Block, qtbot: QtBot):
"""can be written in."""
def test_write_code_blocks(self, qtbot: QtBot):
"""code blocks can be written in."""

block = self.code_block

self._widget.scene.addItem(block)
self._widget.view.horizontalScrollBar().setValue(block.x())
self._widget.view.verticalScrollBar().setValue(
@@ -126,6 +122,7 @@ def testing_write(msgQueue: CheckingQueue):
pyautogui.press(["a", "b", "enter", "a"])

time.sleep(0.1)

msgQueue.check_equal(
block.source_editor.text().replace("\r", ""),
"ab\na",
@@ -135,11 +132,9 @@ def testing_write(msgQueue: CheckingQueue):
with pyautogui.hold("ctrl"):
pyautogui.press("z")

time.sleep(0.1)

msgQueue.check_equal(
block.source_editor.text().replace("\r", ""),
"ab",
"ab\n",
"undo worked properly",
)

@@ -154,6 +149,8 @@ def testing_write(msgQueue: CheckingQueue):
"redo worked properly",
)

time.sleep(0.1)

msgQueue.stop()

apply_function_inapp(self.window, testing_write)