Commit Graph

42 Commits

Author SHA1 Message Date
Florian Bruhin d8079515fa tests: Stabilize flaky scrolling test
See #5390
2025-10-24 12:26:00 +02:00
Florian Bruhin 6f21accfae Fix focus handling when closing hidden statusbar
From knezi's analysis in #8722:

    The problem was that in Qt, slots are called in the order of connection, so
    even though there's a code that tries to set up the focus correctly, it's
    run after the cmd widget is hidden and hence the focus is already moved and
    it doesn't work as expected.

Follow-up for #2236/#8024.
Fixes #8223.
Supersedes and closes #8722.
Also see #8625 and #8174 (which are not fixed by this).
2025-10-10 20:15:12 +02:00
Florian Bruhin a8a5068e62 pytest-bdd 8: Fix missing multiline step quoting 2024-12-05 16:13:04 +01:00
Florian Bruhin cec00266d0 pytest-bdd 8: Fix tags
Tags containing spaces aren't supported anymore, so we can't add additional skip
descriptions sadly...
2024-12-05 16:11:17 +01:00
Philipp Albrecht d9e8b638bf Remove vim modelines
We're deprecating vim modelines in favor of `.editorconfig`.

Removing vim modelines could be done using two one-liners. Most of the vim modelines
were followed by an empty line, so this one-liner took care of these ones:

```sh
rg '^# vim: .+\n\n' -l | xargs sed -i '/^# vim: /,+1d'
```

Then some of the vim modelines were followed by a pylint configuration line, so running
this one-liner afterwards took care of that:

```sh
rg '^# vim:' -l | xargs sed -i '/^# vim: /d'
```
2023-06-30 11:03:06 +02:00
Florian Bruhin 258f69c986 Mark another scroll test as flaky 2020-08-17 09:47:36 +02:00
Florian Bruhin 9e327e34ac Mark another scroll test as flaky 2020-08-11 11:44:38 +02:00
Florian Bruhin f259547291 tests: Mark another scrolling test as flaky 2020-07-22 13:49:42 +02:00
Florian Bruhin 8e4dec2b6e tests: Mark another scrolling test as flaky 2020-07-20 10:55:21 +02:00
Florian Bruhin 8cbf6305e9 tests: Remove issue3572 marker
See #3572
2019-11-21 14:33:04 +01:00
Florian Bruhin 04e7b89978 Add delay after zooming
It looks like zooming happens asynchronously, so we need to make sure we scroll
after zoomed in.

See #4025
2018-09-24 16:39:18 +02:00
Florian Bruhin 57d3ed95f2 Mark another test as flaky 2018-08-10 08:40:24 +02:00
Florian Bruhin c1d06c8abb Skip another test 2018-08-06 09:55:49 +02:00
Florian Bruhin 98cf1e5b2c Kill some more tests 2018-07-22 17:19:12 +02:00
Florian Bruhin 463dd911a3 More flaky tests 2018-07-22 15:46:24 +02:00
Florian Bruhin 40e58126aa About everything is flaky
Did I already mention that I'm starting to hate those tests I wrote in the past
with a passion?
2018-07-22 14:05:40 +02:00
Florian Bruhin 52d7ff79fc Skip another scroll test with Qt 5.10 and Travis 2018-02-10 20:15:17 +01:00
Florian Bruhin 53e7d13c2d Skip failing scrolling tests on Qt 5.10 on Travis
See #3572
2018-02-08 10:42:55 +01:00
Florian Bruhin feaccb3083 Rename :scroll-perc to :scroll-to-perc
Closes #2819
2017-10-03 22:59:32 +02:00
Florian Bruhin cee51df4fb Refactor JS log handling and use a dict for javascript.log
Fixes #2828
2017-09-14 00:37:01 +02:00
Florian Bruhin bd9b45bb96 tests: Fix more issues with new config 2017-07-04 15:08:02 +02:00
Florian Bruhin d132b6ed71 Fix :scroll-page with --bottom-navigate on QtWebEngine
There were two issues here:

- The comparison was backwards, causing scroller.at_bottom() to always return
  true.
- When zoomed in, jsret['px']['y'] can be a float, which means we can be
  slightly off when checking the difference - math.ceil() fixes that.
2017-06-29 22:39:48 +02:00
Florian Bruhin 57fbfbd606 Set an initial window size for background tabs
When we open a background tab, it gets a hardcoded size (800x600 or so) because
it doesn't get resized by the layout yet.

By resizing it to the size it'll actually have later, we make sure scrolling to
an anchor in an background tab works, and JS also gets the correct size for
background tabs.

Fixes #1190
Fixes #2495
See #1417
2017-06-11 17:48:01 +02:00
Florian Bruhin 28e6158a04 Stabilize some tests with Qt 5.9 QtWebEngine 2017-04-08 20:38:23 +02:00
Martin Tournoij 8af5cfb4ac
Add a modeline to all the *.feature files
This really tripped me up yesterday, My "Vim default" is to use tabs.

This (where `!···` is a tab) does not work as you'll hope it works:

    Scenario: Retrying a failed download when the directory didn't exist (issue 2445)
        When I download http://localhost:(port)/data/downloads/download.bin to <path>
        And I wait for the error "Download error: No such file or directory: *"
        And I make the directory <mkdir>
        And I run :download-retry
!···!···And I wait until the download is finished
        Then the downloaded file <expected> should exist

        Examples:
        | path                 | mkdir   | expected             |
        | asd/zxc/             | asd/zxc | asd/zxc/download.bin |

Unfortunately, pytest-bdd uses the "Python 2 behaviour" of "expand all
tabs to 8 spaces", and doesn't give any errors on strange/inconsistent
whitespace. It can cause very confusing errors.
2017-03-31 16:16:31 +01:00
Florian Bruhin a4f04db848 Cap scroll count to 5000
Fixes #1694
2017-02-11 22:26:37 +01:00
Florian Bruhin de50f30b9b Replace all GitHub links 2017-02-05 00:13:11 +01:00
Florian Bruhin b21f7be03a Remove qtwebengine_todo for position:absolute test 2016-10-03 06:55:58 +02:00
Florian Bruhin 5b27e06ce2 Add xfailing test for #1945 2016-09-29 07:16:40 +02:00
Florian Bruhin c40325b510 Stabilize "Jumping back after searching" test
The test was flaky because waiting for scrolling didn't actually wait,
as the page logged a scroll position change to 0/0 directly after
loading.

We work around this by making the generic "And I wait until the scroll
position changed" not wait when it changed to 0/0.
2016-09-12 18:53:56 +02:00
Florian Bruhin fff777404b Use QApplication.postEvent again
We had some funny segfaults reported during scrolling (i.e. with
QApplication.sendEvent), and some code already had to use postpone=True
so there was no segfault...

So now we're back to postEvent again, and eliminated the main reason for
segfaults with it, which was re-using (and -posting) events which had
already been posted.

At least during tests this seems to run stable, let's hope it helps for
the people having crashes as well.
2016-09-11 19:37:09 +02:00
Florian Bruhin 919196714b QtWebEngine: Implement WebEngineScroller.at_bottom 2016-09-07 09:32:51 +02:00
Florian Bruhin c58a0e926f Skip scrolling tests on Qt < 5.7
This fixes tests on OS X on Travis, since Homebrew is still on Qt 5.6.
2016-09-06 20:29:58 +02:00
Florian Bruhin 85b3d08c66 bdd: Fix scrolling tests with QtWebEngine
Scrolling happens async with QtWebEngine, so we add a new log output
when the page was scrolled, and wait for that in various places.
2016-09-06 14:58:33 +02:00
Florian Bruhin fa0bde631d bdd: at_top is actually implemented (scroll) 2016-08-18 23:47:09 +02:00
Florian Bruhin 84b8ea856d bdd: Skip :scroll-page+navigate tests on webengine 2016-08-18 22:46:48 +02:00
Florian Bruhin 8da942ddc7 bdd: Skip tests on WebEngine causing memory leaks 2016-08-18 22:46:32 +02:00
Florian Bruhin 0557fea79e Use QApplication.sendEvent instead of postEvent
From the QApplication.postEvent docs:
http://doc.qt.io/qt-5/qcoreapplication.html#postEvent

  The event must be allocated on the heap since the post event queue
  will take ownership of the event and delete it once it has been
  posted. It is not safe to access the event after it has been posted.

We can't reliably guarantee that from Python, so we need to use
sendEvent instead.
2016-08-18 21:36:43 +02:00
Florian Bruhin bb2eee6178 Add a test for #1821 2016-08-11 11:49:56 +02:00
Florian Bruhin c12aeea670 tests: Move data/scroll.html to data/scroll/simple 2016-08-11 11:47:55 +02:00
Jan Verbeek 3c2c7ecaae Test for scroll with count and argument 2016-06-29 11:47:51 +02:00
Florian Bruhin 64d4c9f83e Clean up end2end test file structure
This renames tests/integration to tests/end2end and moves some files to
tests/end2end/fixtures.
2016-05-29 18:20:00 +02:00
Renamed from tests/integration/features/scroll.feature (Browse further)