Commit Graph

44 Commits

Author SHA1 Message Date
Florian Bruhin
561295238d Another try at stabilizing test_set_error 2018-03-20 08:58:48 +01:00
Florian Bruhin
81827a3150 Try to stabilize stylesheet tests 2018-03-20 07:05:03 +01:00
Florian Bruhin
ea1e52ea7c Load page before loading stylesheets
If we don't do this, when doing:

   self.config_stub.val.content.user_stylesheets = css_path

then _update_stylesheet gets called before the stylesheet QWebEngineScript did
run (as there was no load yet), so we get:

  [:2] Uncaught TypeError: Cannot read property 'stylesheet' of undefined!

Instead, load the page first and then update the stylesheet.
This tests that live updating works properly, and also makes sure we don't run
into the problem described above.
2018-03-19 21:44:47 +01:00
Florian Bruhin
b588f54a53 Fail javascript tests on logging messages 2018-03-19 20:43:55 +01:00
Florian Bruhin
1162e640c5 Remove unused imports 2018-03-19 19:42:56 +01:00
Florian Bruhin
0ea7a1457d Make test_position_caret work again
The tests only work properly with QtWebKit (and aren't needed on QtWebEngine).
Also, for some reason the scrolled_down tests only work without Xvfb.
2018-03-19 19:38:21 +01:00
Florian Bruhin
f5d7605ae0 Add a :scroll-to-anchor command
Fixes #2784
2018-03-19 19:18:33 +01:00
Florian Bruhin
460bd86579 Initial attempt at using the tab API for tests/unit/javascript 2018-03-19 18:18:21 +01:00
Florian Bruhin
232fd19422 Fix unit tests after refactoring 2018-03-19 09:53:35 +01:00
Jimmy
919fe45813 Greasemonkey: Add test for @require support.
There's is a lot of asserts in that one test but it tests everything.
2018-03-03 15:02:42 +13:00
Florian Bruhin
6f028e9ad0 Update copyright years 2018-02-05 12:19:50 +01:00
Jimmy
b2f95339ce Greasemonkey: support regexes in @include and @exclude.
Like the spec says, if a value for the @include or @exclude rules starts
and ends with a '/' it should be parsed as a regular expression.
Technically a ECMAScript syntax regular expression, but I am not sure of
the differences and I assume they are far fewer than the similarities.
One that I did see mentioned was that javascript RegExp doesn't support
unicode. Although it apparently does support a 'u' flag now.

Note that code will only be ran for QtWebkit and QWebEngine < 5.8
we rely on the builtin support for metadata it QWebEngine for most
things greasemonkey related. Sadly it seems that they missed the regex
requirement too. I've opened a ticket to track that https://bugreports.qt.io/browse/QTBUG-65484
2018-01-20 13:39:19 +13:00
Florian Bruhin
430126dcc8 pylint: Re-enable ungrouped-imports 2017-12-15 23:08:53 +01:00
Florian Bruhin
f033b228b1 Use py.path.local in save_script 2017-12-06 21:21:55 +01:00
Florian Bruhin
2633dcc0d5 Fix lint 2017-12-06 20:18:41 +01:00
Jimmy
92b48e77c7 Greasemonkey: add unit tests for GreasemonkeyManager 2017-11-27 20:10:38 +13:00
Florian Bruhin
6a90cebe85 Get rid of backslash 2017-11-19 14:29:22 +01:00
Jay Kamat
6338810396
Increase timeouts for javascript tests 2017-11-17 21:42:24 -05:00
Jay Kamat
6c241f96ed
Add test for appendChild #2723
Does some of #3295
2017-11-17 17:52:35 -05:00
Jay Kamat
92a6e61b52
Use importorskip to skip stylesheet tests on webkit only systems 2017-11-15 02:05:34 -05:00
Jay Kamat
28572ce3b1
Fix stylesheet tests crashing when no QtWebEngine available 2017-11-14 00:00:53 -05:00
Jay Kamat
5913552dfe
Fix style issues in stylesheet tests 2017-11-13 19:57:11 -05:00
Jay Kamat
324c537a3d
Refactor webkit and webengine js testers to have a common subclass 2017-11-10 13:00:44 -05:00
Jay Kamat
83e28a70c5
Fix error message printing for webengine js tests 2017-11-10 12:34:23 -05:00
Jay Kamat
d39dda38ce
Refactor CallbackChecker into test utils 2017-11-10 12:27:00 -05:00
Jay Kamat
155ee198cd
Update stylesheet tests for updates in stylesheet.js 2017-11-10 12:19:49 -05:00
Jay Kamat
5ac8e5ad3e
Clean up stylesheet tests 2017-11-10 12:19:35 -05:00
Jay Kamat
2f9a857a27
Add test for styling error pages 2017-11-09 14:44:33 -05:00
Jay Kamat
04b66e1a0a
Add a test for svg files 2017-11-09 14:44:33 -05:00
Jay Kamat
03eae9140e
Implement proper loading of stylesheet.js 2017-11-09 14:44:33 -05:00
Jay Kamat
9a1d10ca11
Add tests which override existing css 2017-11-09 14:44:33 -05:00
Jay Kamat
e7fdff5632
Implement basic stylesheet tests 2017-11-09 14:44:32 -05:00
Jay Kamat
2b5e8daba0
Implement qtwebengine version of JSTester 2017-11-09 14:44:32 -05:00
Florian Bruhin
822623f2ed Finally update copyrights... 2017-05-09 21:37:03 +02:00
Daniel Karbach
6728bb6430 show webview when caret testing
fixes #1988
2016-09-29 09:26:58 +02:00
Florian Bruhin
7592345b6e Make unittests work without QtWebKit 2016-09-05 18:45:50 +02:00
Florian Bruhin
df3733af54 tests: Use pytest.fixture instead of yield_fixture
See #1877
2016-08-22 07:40:24 +02:00
Florian Bruhin
1fb34331e5 tests: Default to raising=True for qtbot.
- qtbot.waitSignal with raising=True is the default this way, so we remove the
  raising=True.
- qtbot.waitSignal with raising=False stay untouched
- Some qtbot.waitSignal without raising had one added (because we don't want it
  to raise)
- Some qtbot.waitSignal without raising actually should've raised, which they
  do now.
2016-01-08 09:49:06 +01:00
Florian Bruhin
a5f2ac5f03 Adjust copyright years. 2016-01-04 07:12:39 +01:00
Florian Bruhin
e78d2a8399 tests: Check args for loadFinished signals. 2015-12-17 07:49:28 +01:00
Florian Bruhin
2556e2e27b Remove unused import. 2015-08-23 18:29:02 +02:00
Florian Bruhin
0907d8bf76 tests: Add a webview fixture. 2015-08-23 18:17:22 +02:00
Florian Bruhin
774ef58432 Use qapp fixture in enable_caret_browsing.
This fixes a segfault when only running test_position_caret.
2015-08-19 21:40:13 +02:00
Florian Bruhin
2c5269acd6 Reorganize tests directory. 2015-08-18 20:19:02 +02:00