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
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
9479a50784
bdd: Add a timeout to redirect-later with -1 delay.
2015-11-23 21:37:22 +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
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
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
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
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
Florian Bruhin
4c75422c05
bdd: Add some :debug-webaction tests.
2015-11-15 16:38:56 +01:00
Florian Bruhin
145772476b
bdd: Add some tests for :jseval.
2015-11-15 16:38:56 +01:00
Florian Bruhin
9f1c6e0139
bdd: Add some comments to misc.feature.
2015-11-15 16:38:56 +01:00
Florian Bruhin
384c753094
tests: Add ensure_not_logged to TestProcess.
2015-11-15 16:38:56 +01:00
Florian Bruhin
e9ece3d114
tests: Validate **kwargs for TestProcess.wait_for.
2015-11-13 23:26:14 +01:00
Florian Bruhin
04c2e45bee
bdd: Add a first test for :jseval.
2015-11-13 07:56:59 +01:00
Florian Bruhin
3290048458
tests: Do custom fnmatch-like matching.
...
fnmatch treats [, ] and ? as shell metacharacters too, and has no way to escape
them. We need a literal [] and really only need * for filtering.
2015-11-13 07:56:59 +01:00
Florian Bruhin
205af3737f
bdd: Skip yankpaste tests if clipboard is broken.
...
This seems to be the case on OS X Yosemite (on my Mac Mini).
2015-11-13 06:54:45 +01:00
Florian Bruhin
0085421ec6
tests: Use __tracebackhide__ in wait_for methods.
2015-11-13 06:45:55 +01:00
Florian Bruhin
ce66d731f2
tests: Add missing file.
2015-11-13 06:24:53 +01:00
Florian Bruhin
85c82b32fb
tests: Only print ignored lines with invalid ones.
2015-11-12 22:13:56 +01:00
Florian Bruhin
1dd5bb1596
bdd: Add more tests for :zoom
2015-11-12 22:10:13 +01:00
Daniel Schadt
4210d7e15d
mhtml: use png instead of ico for test
...
Seems like httpbin sends a different MIME-type on travis than on my
laptop, something 'clear' like image/png should fix this.
2015-11-12 21:58:33 +01:00
Florian Bruhin
00ccc236bb
bdd: Add more :paste tests.
2015-11-12 21:52:39 +01:00
Florian Bruhin
25921792ef
tests: Allow to open about:…/qute:… in QuteProc.
2015-11-12 21:52:06 +01:00
Daniel Schadt
354259777a
mhtml: don't test with dynamically modified page
2015-11-12 21:07:14 +01:00
Daniel Schadt
69a92af097
mhtml: add "complex" test case
...
The html page is very ugly, but tests the downloader pretty throughout
2015-11-12 20:57:38 +01:00
Florian Bruhin
ba902f1d92
tests: Fix test_testprocess flakyness.
...
When we don't include the start time in the measurement, the subprocess will
already start sleeping before we start measuring, which can lead to times
measured which are around 260-300ms.
2015-11-12 20:29:06 +01:00