Florian Bruhin
c7fdcc92b8
Use fully qualified imports in tests.
...
This is cleaner even if pylint can't handle it.
2015-12-01 22:03:59 +01:00
Florian Bruhin
788a096150
pylint: Ignore import-error globally for tests.
2015-12-01 22:03:59 +01:00
Florian Bruhin
150a83d8f4
pylint: Remove unneeded supressions.
2015-12-01 22:03:58 +01:00
Florian Bruhin
d53c4f2702
tests: Increase test_late_message timeout.
...
This was failing on Travis on OS X, and waiting 1s for process start and 0.5s
sleep seems a bit tight.
2015-12-01 08:10:44 +01:00
Florian Bruhin
7e8f16dd22
pylint: Disable deprecated-method in test_conftest.
2015-12-01 07:16:53 +01:00
Florian Bruhin
6f9b02741a
Switch from map() to list comprehensions.
2015-12-01 07:16:32 +01:00
Florian Bruhin
5f13fd2ece
Merge branch 'log-javascript-console' of https://github.com/flv0/qutebrowser into flv0-log-javascript-console
2015-11-30 08:08:31 +01:00
Florian Bruhin
f7a13fa1f9
Rename LineParserWrapper to LineParserMixin.
...
This makes pylint shut up as it realizes it is, in fact, a mixin.
2015-11-30 07:11:35 +01:00
Florian Bruhin
288bf1524e
Fix some unidiomatic comparisons.
2015-11-30 07:10:21 +01:00
Patric Schmitz
98a454a428
log-javascript-console -> [none, debug, info]
2015-11-29 18:37:11 +01:00
Florian Bruhin
d286f637d6
tests: Set basedir to None, not ''.
...
Turns out setting basedir='' creates cache/ in cwd.
2015-11-29 01:23:28 +01:00
Florian Bruhin
f7a3a9e015
Split testprocess.wait_for into two methods.
2015-11-29 01:23:19 +01:00
Florian Bruhin
6a46aea934
Fix tests for basedir logging.
...
f5febc4
broke various tests which called standarddir.init() without a valid
basedir.
2015-11-29 00:35:18 +01:00
Florian Bruhin
a67644589e
bdd: Add first test for :bookmark-add.
2015-11-28 23:37:27 +01:00
Florian Bruhin
f9d7f20aac
tests: Raise if wait_for is used without kwargs.
...
Otherwise wait_for would return immediately because matches is empty so
any(matches) is True.
2015-11-28 23:36:26 +01:00
Florian Bruhin
f5febc4807
Log basedir and save it in QuteProcess for tests.
2015-11-28 23:35:32 +01:00
Florian Bruhin
8d5b6b2dad
bdd: Add tests for :home.
2015-11-28 22:44:05 +01:00
Florian Bruhin
052e758f38
bdd: Add tests for :help.
2015-11-28 22:34:19 +01:00
Florian Bruhin
c236e70920
Merge branch 'log-javascript-console' of https://github.com/flv0/qutebrowser into flv0-log-javascript-console
2015-11-28 21:12:25 +01:00
Florian Bruhin
83b94a8be5
Fix session tests.
...
FakeMainWindow needs to be a QObject now as we use sip.isdeleted since
8cf6ace0e7
and that raises a TypeError on
non-QObject's.
2015-11-28 20:41:42 +01:00
Patric Schmitz
913aa209c6
remove BadMappingSubclass and rename MappingSubclass
2015-11-28 20:17:31 +01:00
Patric Schmitz
dbc6f63fc0
remove whitespace
2015-11-28 18:57:41 +01:00
Patric Schmitz
03ba38578e
set valid_values after __init__ consistently, move type validation out of class into pytest
2015-11-28 18:29:51 +01:00
Patric Schmitz
c14b52f916
initialize valid_values separately, not using base class __init__ parameter
2015-11-28 18:29:51 +01:00
Patric Schmitz
6f65397dfe
always set valid_values in __init__ instead of class scope variable
2015-11-28 18:29:51 +01:00
Artur Shaik
73f999da31
Revert a43c206
and b344f92
.
2015-11-28 21:29:54 +06:00
Florian Bruhin
f847ddf3cb
bdd: Remove :rl-backward-delete-char test.
...
It's flaky and tested enough via unittests.
2015-11-27 20:29:49 +01:00
Florian Bruhin
bf3bd3bb9d
Wait for favicon to be loaded for mhtml tests.
...
This hopefully helps with the flaky MHTML tests on Windows where the favicon
was loaded *after* clearing the requests:
http://qutebrowser.org:8010/builders/win8/builds/1370/steps/unittests-frozen/logs/stdio
2015-11-27 19:30:06 +01:00
Florian Bruhin
962ba36cda
Skip qtutils.savefile_open tests without DISPLAY.
...
I don't get why, but for some reason they cause a segfault from time to time...
So let's just skip them.
2015-11-27 19:11:37 +01:00
Florian Bruhin
d6acb3c3f4
bdd: Hopefully make caret tests more stable.
...
We now wait until the clipboard actually changed, which should make things run
better.
This should fix the cases where the expected value is empty in #1142 .
2015-11-27 18:44:59 +01:00
Florian Bruhin
d5b634301f
Make :rl-backward-delete-char test more stable.
...
The text could be inserted *after* :rl-backward-delete-char was run.
2015-11-27 18:15:17 +01:00
Florian Bruhin
e9ca1ba5c1
bdd: Add a test for :rl-backward-delete-char.
2015-11-27 16:28:06 +01:00
Florian Bruhin
be4cf19bb1
tests: Improve some parametrized test IDs.
2015-11-27 16:25:25 +01:00
Florian Bruhin
f3c378858b
tests: Remove duplicate test_split testcases.
2015-11-27 16:22:48 +01:00
Florian Bruhin
edf5463007
tests: Fix cmdline_test generation.
...
We accidentally provided valid values twice and invalid values not at all.
2015-11-27 16:17:07 +01:00
Florian Bruhin
84d6359990
bdd: Wait until page is loaded for tab-detach test
...
This should make this test more stable hopefully.
2015-11-27 15:18:53 +01:00
Florian Bruhin
b344f92a90
Add two missing xfail markers.
2015-11-27 15:10:08 +01:00
Florian Bruhin
a43c206893
Mark some caret tests as xfail on Windows/OS X.
...
See #1142 .
2015-11-27 14:39:33 +01:00
Florian Bruhin
e4947b03be
Fix lint.
2015-11-27 11:50:23 +01:00
Florian Bruhin
b4a630563f
bdd: Add tests for caret mode.
2015-11-26 23:42:43 +01:00
Florian Bruhin
dbdedf74c0
bdd: Handle \n when checking clipboard contents.
2015-11-26 22:32:01 +01:00
Florian Bruhin
3d291482a3
bdd: Move clipboard functions to conftest.py.
...
Those are needed for caret.feature and yankpaste.feature.
2015-11-26 21:22:50 +01:00
Florian Bruhin
bf8a82db12
bdd: Add a test for :tab-detach.
2015-11-26 20:56:36 +01:00
Florian Bruhin
8d1a60528d
bdd: Add some tests for :tab-clone.
2015-11-26 20:44:32 +01:00
Florian Bruhin
7f5e07d7cc
bdd: Add some tests for :tab-move.
2015-11-26 18:37:47 +01:00
Florian Bruhin
3bcc80048d
bdd: Move yankpaste.html to title.html.
2015-11-26 18:37:33 +01:00
Florian Bruhin
6f1474be71
bdd: Remove trailing dots.
2015-11-26 17:50:39 +01:00
Florian Bruhin
bc28a168cc
bdd: Add tests for :tab-prev/:tab-next/tabs->wrap.
2015-11-26 16:19:03 +01:00
Florian Bruhin
102db181c5
Remove unused imports.
2015-11-26 15:55:40 +01:00
Florian Bruhin
7eb6f658eb
tests: Use JSON for webserver_sub logging.
...
This simplifies logging output and parsing.
2015-11-26 14:40:20 +01:00
Florian Bruhin
b8467b8fef
tests: Various cleanups.
2015-11-26 14:25:33 +01:00
Florian Bruhin
7baed5f80f
tests: Don't start qutebrowser process if unneeded.
2015-11-26 13:56:42 +01:00
Florian Bruhin
fac76576d7
bdd: Add "the following tabs should be open" step.
...
This simplifies a lot of .feature files because we don't actually need to check
the full session.
2015-11-26 01:33:56 +01:00
Florian Bruhin
c861cf54e6
tests: Make QuteProcess.path_to_url public.
2015-11-26 01:33:27 +01:00
Florian Bruhin
fc328b275a
bdd: Add some tests for :tab-focus.
2015-11-26 00:48:39 +01:00
Florian Bruhin
951c2e8eb6
Fix qflags_key comparison.
2015-11-25 18:54:03 +01:00
Florian Bruhin
c755a78518
bdd: Add tests for :tab-close/:tab-only.
2015-11-25 18:48:10 +01:00
Florian Bruhin
67f726c9d4
tests: Add another BOM test for javascript_escape.
2015-11-25 18:47:16 +01:00
Florian Bruhin
73e9fd1118
Handle BOM (\ufeff) for webelem.javascript_escape.
2015-11-25 18:14:52 +01:00
Florian Bruhin
816d62bca5
bdd: Reorganize numbered test files.
2015-11-25 18:02:14 +01:00
Florian Bruhin
eed2584e3f
Fixup for last commit.
2015-11-25 17:55:33 +01:00
Florian Bruhin
0a7b552111
bdd: Use 'q' key for forward-unbound-keys test.
...
It seems ' gives us a 222 keycode with newer Qt versions, but 0 with older
ones. 'q' which is a much lower code should hopefully work better.
2015-11-25 17:52:00 +01:00
Florian Bruhin
21a1f9ca65
bdd: Add various key input tests.
2015-11-25 17:20:53 +01:00
Florian Bruhin
9670ffb78e
bdd: Add "the JS message ... should not be logged".
2015-11-25 17:20:05 +01:00
Florian Bruhin
388cc7ae29
bdd: Add "Then ... should be logged" step.
2015-11-25 17:19:49 +01:00
Florian Bruhin
9fe02d55c9
bdd: Add "I press the keys ..." step.
2015-11-25 17:19:16 +01:00
Florian Bruhin
7cfea665ff
tests: Strip trailing slash for webserver paths.
2015-11-25 10:40:24 +01:00
Florian Bruhin
24a71e5c2e
Fix webelem.javascript_escape with U+2028/U+2029.
2015-11-25 10:32:22 +01:00
Florian Bruhin
027a10c04b
bdd: Add some tests for :navigate.
2015-11-24 21:32:45 +01:00
Florian Bruhin
8f2b29a1f9
tests: Make it possible to load httpbin root.
2015-11-24 21:27:20 +01:00
Florian Bruhin
93ef85ff16
tests: Serve index.html files in webserver_sub.py.
2015-11-24 20:43:20 +01:00
Florian Bruhin
f8668ff710
bdd: Add a test for :open with -t and -b.
2015-11-24 20:31:08 +01:00
Florian Bruhin
c22e1df400
Add whitespace.
2015-11-24 19:24:39 +01:00
Florian Bruhin
28b739b9b5
bdd: Add tests for :open.
2015-11-24 19:19:23 +01:00
Florian Bruhin
287b2ba258
bdd: Replace (port) when setting a setting.
2015-11-24 19:19:03 +01:00
Florian Bruhin
925a5ba809
bdd: Add test for :debug-console.
2015-11-24 18:37:34 +01:00
Florian Bruhin
2ef2e3088f
bdd: Add tests for :view-source.
2015-11-24 18:24:33 +01:00
Florian Bruhin
d58a5d4d15
bdd: Add "the page source should look like" step.
2015-11-24 18:22:43 +01:00
Florian Bruhin
b7323914b8
tests: Add plain arg to quteprocess.get_contents.
2015-11-24 18:22:20 +01:00
Florian Bruhin
7b1e2ab471
Skip some inspector tests on windows.
...
Those cause trouble because it can't clean up the local storage directory...
2015-11-24 17:48:09 +01:00
Florian Bruhin
d13ae4c666
tests: Make checks for focus window more forgiving.
...
It seems on OS X we get this instead of focusing the webview:
"Focus object changed: <qutebrowser.browser.inspector.WebInspector object at ...>"
2015-11-24 16:54:35 +01:00
Florian Bruhin
922fdc0526
Fix :fake-key with no focused webview.
2015-11-24 16:28:56 +01:00
Florian Bruhin
4c1eff625f
tests: Make inspector smoke test more reliable.
...
Before we didn't wait until the inspector window was hidden, which caused the
following tests to fail on our OS X buildbot:
==================================== ERRORS ====================================
_________ ERROR at teardown of test_fakekey_sending_key_to_the_website _________
[...]
tests/integration/testprocess.py:186: InvalidLine
----------------------------- Captured stdout call -----------------------------
[...]
INVALID: Traceback (most recent call last):
IGNORED: File "/Users/buildbot/buildbot/slave/osx/build/qutebrowser/app.py", line 109, in <lambda>
IGNORED: target_arg=target_arg))
IGNORED: File "/Users/buildbot/buildbot/slave/osx/build/qutebrowser/app.py", line 263, in process_pos_args
IGNORED: commandrunner.run_safely_init(cmd[1:])
IGNORED: File "/Users/buildbot/buildbot/slave/osx/build/qutebrowser/commands/runners.py", line 266, in run_safely_init
IGNORED: self.run(text, count)
IGNORED: File "/Users/buildbot/buildbot/slave/osx/build/qutebrowser/commands/runners.py", line 249, in run
IGNORED: result.cmd.run(self._win_id, args)
IGNORED: File "/Users/buildbot/buildbot/slave/osx/build/qutebrowser/commands/command.py", line 505, in run
IGNORED: self.handler(*posargs, **kwargs)
IGNORED: File "/Users/buildbot/buildbot/slave/osx/build/qutebrowser/browser/commands.py", line 1781, in fake_key
IGNORED: tab='current')
IGNORED: File "/Users/buildbot/buildbot/slave/osx/build/qutebrowser/utils/objreg.py", line 215, in get
IGNORED: reg = _get_registry(scope, window, tab)
IGNORED: File "/Users/buildbot/buildbot/slave/osx/build/qutebrowser/utils/objreg.py", line 202, in _get_registry
IGNORED: return _get_tab_registry(window, tab)
IGNORED: File "/Users/buildbot/buildbot/slave/osx/build/qutebrowser/utils/objreg.py", line 152, in _get_tab_registry
IGNORED: raise RegistryUnavailableError('tab')
INVALID: qutebrowser.utils.objreg.RegistryUnavailableError: tab
[...]
While this is a real issue, this test shouldn't affect the next one.
Since we have to wait for windows getting focused but Xvfb doesn't do that, we
skip this tests when running via Xvfb.
2015-11-24 16:17:26 +01:00
Florian Bruhin
542d13b70d
tests: Add a not_xvfb marker.
2015-11-24 16:17:07 +01:00
Florian Bruhin
14f4689998
tests: Fix TestInitLog.
...
This worked before b0d4ebe
because --debug was given and the
"args.loglevel.upper()" part was never executed.
However, loglevel is expected as a string, not as an int.
2015-11-23 21:50:48 +01:00
Florian Bruhin
9479a50784
bdd: Add a timeout to redirect-later with -1 delay.
2015-11-23 21:37:22 +01:00
Florian Bruhin
196d1e95be
tests: Skip test_normal_connection IPC test on OS X.
...
Seems like it hangs there sometimes.
2015-11-23 20:33:11 +01:00
Florian Bruhin
607ca0f478
tests: Wait until page is dumped for header check.
...
If we don't do this, it's possible for the test process to delete the temporary
directory before qutebrowser actually writes the file.
2015-11-23 20:12:52 +01:00
Florian Bruhin
d4c24c935c
bdd: Compare unordered req's for :reload --force.
2015-11-23 20:00:25 +01:00
Florian Bruhin
79680f505e
Fix docstring.
2015-11-23 19:46:50 +01:00
Florian Bruhin
f3b89dba9b
tests: Make test_reload/..._with_force more stable.
...
This waits until the pages have actually been reloaded.
2015-11-23 19:44:53 +01:00
Florian Bruhin
e2da9aa3f8
tests: Make test_stop more stable.
...
It's now based by the browser opening a second page after :stop is run rather
than timing-based, which hopefully should make it run more stable on Travis.
2015-11-23 19:43:11 +01:00
Florian Bruhin
d324dd5f70
bdd: Add "I open ... in a new tab" step.
2015-11-23 19:42:01 +01:00
Florian Bruhin
39f29e2531
tests: Wait until clipboard actually changed.
...
Hopefully fixes #1124 .
2015-11-23 16:29:37 +01:00
Florian Bruhin
17b5ccde0e
tests: Ignore "SelectionRequest too old" message.
...
See #1124 .
2015-11-23 16:25:03 +01:00
Florian Bruhin
162c8b30e6
Remove unused import.
2015-11-23 14:49:37 +01:00
Florian Bruhin
7a82bb55e4
bdd: Add tests for :reload.
2015-11-23 14:37:54 +01:00
Florian Bruhin
1e79aae231
bdd: Add check_header step.
2015-11-23 14:37:40 +01:00
Florian Bruhin
76143574ef
tests: Add quteproc.get_content.
2015-11-23 14:37:29 +01:00
Florian Bruhin
52aca30342
tests: Add quteproc.temp_setting.
2015-11-23 13:31:17 +01:00
Florian Bruhin
e6eaa5f140
tests: Add quteproc.get_setting.
2015-11-23 13:30:49 +01:00
Florian Bruhin
16e1a65448
Merge branch 'download-page' of https://github.com/Kingdread/qutebrowser into Kingdread-download-page
2015-11-23 13:16:16 +01:00
Florian Bruhin
ea06c64ed4
Fix typos.
2015-11-23 11:17:26 +01:00
Florian Bruhin
4fa32bd0cd
bdd: Use a fresh instance for :stop test.
...
This hopefully makes it more stable on Travis on OS X.
2015-11-22 17:07:54 +01:00
Daniel Schadt
86eda2843d
Normalize application/x-javascript
...
Should be just application/javascript
2015-11-21 16:19:01 +01:00
Florian Bruhin
39def173ca
bdd: Fix request list for :stop test.
...
We changed the URL in the last commit but forgot to adjust that.
2015-11-21 15:31:19 +01:00
Florian Bruhin
eb232734b4
bdd: Increase timeouts for :stop test.
...
The old ones weren't enough for Travis it seems.
2015-11-21 15:14:32 +01:00
Florian Bruhin
4f165a7669
bdd: Add a test for :stop.
2015-11-21 14:23:44 +01:00
Daniel Schadt
7d6327873a
Pass test only when mhtml file is written
...
Otherwise we might spill data to tests that come after the mhtml ones.
2015-11-21 12:45:57 +01:00
Daniel Schadt
59c9c6ccb0
Actually test :download --mhtml, not :download
2015-11-21 12:37:26 +01:00
Daniel Schadt
c7294781f5
Don't make ExpectedRequest orderable
...
Instead, make it hashable and use collections.Counter instead of sorted
lists. This actually produces a nicer output for differences between
the counters.
2015-11-21 00:20:09 +01:00
Daniel Schadt
c12011c84d
Style fixes
2015-11-21 00:10:49 +01:00
Daniel Schadt
b776aeac84
Use same representation in webview and quteprocess
...
Otherwise the "page loaded" message will not be recognized.
Also use percent-encoding to avoid unicode-related bugs on different
systems.
2015-11-20 19:11:20 +01:00
Florian Bruhin
af875f4b8f
Add a :fake-key command.
...
Closes #556 .
See #551 .
2015-11-20 19:06:06 +01:00
Daniel Schadt
0a9a75c337
Add more tests for the :download command
2015-11-20 18:31:39 +01:00
Daniel Schadt
0c2a285fef
Convert to QUrl before waiting for the logline
...
webview uses QUrl to output the url and thus might convert some escape
sequences to their unicode characters. If we don't do the same
conversions here, we will "miss" the log message and fail the test.
2015-11-20 18:30:08 +01:00
Daniel Schadt
7f8c118991
Fix pylint
2015-11-20 16:57:27 +01:00
Daniel Schadt
cd78086d10
Fix pep257
2015-11-20 16:23:46 +01:00
Daniel Schadt
729d29b8a7
webserver: listen on 127.0.0.1 instead of 0.0.0.0
2015-11-20 16:17:34 +01:00
Daniel Schadt
09e310277d
Remove server global, use lambda instead
2015-11-20 16:13:30 +01:00
Daniel Schadt
fb8f200291
Remove polling in webserver, use property instead
2015-11-20 16:11:13 +01:00
Daniel Schadt
613faf84ef
Move pylint comment
2015-11-20 15:30:27 +01:00
Daniel Schadt
097a14d5f3
Disable pylint no-member for cherrypy.wsgiserver
2015-11-20 14:03:51 +01:00
Daniel Schadt
a991a8c43c
Don't compare requests triggered by loading a page
2015-11-20 13:42:32 +01:00
Daniel Schadt
3466ee03f6
Change development server to cherrypy.wsgiserver
...
The Flask/Werkzeug development servers had some issues which lead to
failing tests (together with some Qt bugs).
2015-11-20 13:35:24 +01:00
Daniel Schadt
452c6f5310
Add __str__ method to ExpectedRequest
...
Better for reading test logs.
2015-11-20 13:35:24 +01:00
Florian Bruhin
1ec03462c8
Add a utils.parse_keystring.
2015-11-20 07:06:16 +01:00
Florian Bruhin
9a310dd1fb
bdd: Add step to check for JS console.log.
2015-11-20 07:06:16 +01:00
Florian Bruhin
4d1f37f296
bdd: Add tests for :inspector.
2015-11-18 20:08:25 +01:00
Florian Bruhin
55992337b8
bdd: Add a --qute-delay argument.
2015-11-18 20:01:40 +01:00
Daniel Schadt
4060fd5e90
Fix mhtml tests
2015-11-18 19:56:49 +01:00
Daniel Schadt
3438a45b19
Merge branch 'master' into download-page
2015-11-18 19:27:26 +01:00
Daniel Schadt
0d6d276592
mhtml: remove non-existing ftp asset
...
This could be the cause of failing tests, depending on the OS.
2015-11-18 19:15:18 +01:00
Florian Bruhin
90c1240ad4
tests: Remove unnecessary override.
2015-11-18 18:29:27 +01:00
Florian Bruhin
dd2ec30b97
Revert "Use parametrization for TestKeyToString:test_all."
...
This reverts commit aa1ea9b063
.
I changed my mind on this, generating >400 tests for this is stupid.
2015-11-18 18:15:21 +01:00
Florian Bruhin
516a81c3cc
tests: Don't parse httpbin date.
...
We don't need the parsed date, and the parsing is locale dependent, which can
cause trouble.
2015-11-17 07:36:21 +01:00
Florian Bruhin
726525b26a
bdd: Add some more tests for scrolling with floats.
2015-11-17 06:57:33 +01:00
Florian Bruhin
40e2258ef3
Don't accept floats for :scroll-px.
2015-11-17 06:57:13 +01:00
Florian Bruhin
71134f97e3
bdd: Wait for request with "... should be loaded".
...
Hopefully makes things less prone to race conditions.
2015-11-17 06:42:13 +01:00
Florian Bruhin
779df4c08e
bdd: Use separate files for scroll navigate tests.
...
hello.txt was already cached from some other tests, so let's make sure a fresh
file gets loaded.
2015-11-17 06:40:23 +01:00
Florian Bruhin
7fe9be432a
tests: Make httpbin.Request a proper class.
2015-11-16 23:24:11 +01:00
Florian Bruhin
bc96da47ef
bdd: Tests for scrolling with non-scrollable page.
2015-11-16 20:35:44 +01:00
Florian Bruhin
a4d15b550e
Abort :back/:forward at beginning/end of history.
2015-11-16 19:03:07 +01:00
Florian Bruhin
eef760359c
Add missing 3.txt.
2015-11-16 07:17:53 +01:00
Florian Bruhin
6a4ea944cf
bdd: Add tests with very big counts.
2015-11-16 07:17:43 +01:00
Florian Bruhin
fe08cb24f8
bdd: Test some commands with count.
2015-11-15 20:48:07 +01:00
Florian Bruhin
eeab4d41ba
Make it possible to pass a count via command name.
...
This is only used for tests so far and not intended for general usage (and thus
undocumented).
2015-11-15 19:55:01 +01:00
Florian Bruhin
29a1620e81
bdd: Add tests for :scroll-page with --*-navigate.
2015-11-15 17:50:26 +01:00
Florian Bruhin
3d44d619fc
bdd: Add some tests for :scroll-{perc,page}.
2015-11-15 16:38:56 +01:00
Florian Bruhin
1af30772b1
bdd: Add some comments to scroll.feature.
2015-11-15 16:38:56 +01:00