Commit Graph

200 Commits

Author SHA1 Message Date
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
Daniel Schadt
30e2afb59d mhtml: reduce test flakiness
Waiting for "All assets downloaded" may lead to race conditions when
the output file is read before qute wrote it, so the test fails.
2015-11-12 13:17:10 +01:00
Florian Bruhin
1f3df64fe4 bdd: Add some first tests for :paste. 2015-11-11 22:38:43 +01:00
Florian Bruhin
6bd45bbf24 tests: Add some code for MHTML integration tests. 2015-11-11 09:01:05 +01:00
Florian Bruhin
d99f9a3a20 Improve :set error messages. 2015-11-10 22:09:36 +01:00
Florian Bruhin
54e2cea460 Fix some corner cases with :set. 2015-11-10 21:27:42 +01:00
Florian Bruhin
a26e99f004 bdd: Add some tests for :set. 2015-11-10 21:07:49 +01:00
Florian Bruhin
128465f12b Add some more tests for :set-cmd-text. 2015-11-10 19:22:13 +01:00
Florian Bruhin
d71618031d bdd: Decrease timeouts if not on CI. 2015-11-10 09:24:47 +01:00
Florian Bruhin
ada4b669bc tests: Strip [2s ago] markers from log messages. 2015-11-10 09:23:37 +01:00
Florian Bruhin
dc3bfb5eb4 bdd: Print ignored lines in testprocess. 2015-11-10 08:47:29 +01:00
Florian Bruhin
6b4dbad15b bdd: Wait until request is done for hints.feature. 2015-11-10 08:22:06 +01:00
Florian Bruhin
596ed5f545 bdd: Add some more back/forward tests. 2015-11-10 07:51:09 +01:00
Florian Bruhin
f440953ada bdd: Add step to start a fresh instance. 2015-11-10 07:51:09 +01:00
Florian Bruhin
3fac74656e bdd: Add some misc. tests. 2015-11-10 06:33:47 +01:00
Florian Bruhin
6579866abe Quote weird Qt functions for logging. 2015-11-09 19:55:05 +01:00
Florian Bruhin
d288c9598d tests: Add some quteprocess.LogLine tests. 2015-11-09 19:34:34 +01:00
Florian Bruhin
4f6415631f tests: Parse function/line being unset for LogLine. 2015-11-09 19:34:13 +01:00
Florian Bruhin
dce44f2dc5 bdd: Add some first tests for hints. 2015-11-09 18:20:23 +01:00
Florian Bruhin
1aebefca18 bdd: Make "I run ..." work with PrerequisitesError. 2015-11-09 18:20:23 +01:00
Florian Bruhin
0daf5885be Add some BDD tests for downloads. 2015-11-09 07:49:11 +01:00
Florian Bruhin
89c0ff0d9b bdd: Add a redirect-later page in webserver_sub.
This is needed for download tests.
2015-11-09 07:46:03 +01:00
Florian Bruhin
021ea444a1 bdd: Fix separations between tests.
With this change, no test should affect another one anymore. Changes in detail:

- Before each test, invalid lines are cleaned so the invalid output from the
  previous test doesn't affect the next one.
- Before each test, qutebrowser is restarted if it was quit.
- After each test, the data is cleared properly in every case.
- If there was an invalid output, the test waits for 1s for more output, and
  then terminates qutebrowser so it's restarted with a clean state.
2015-11-09 07:43:48 +01:00
Florian Bruhin
8b016df023 bdd: Make InvalidLine show some more informations. 2015-11-09 07:41:57 +01:00
Florian Bruhin
62f11273c5 tests: Fix quteproc.after_test() fixture.
It accidentally was named wrong, which caused it to never be executed. That
means the teardown log wasn't actually checked for errors.
2015-11-09 07:40:25 +01:00
Florian Bruhin
64730f566f tests: Make wait for loading work with downloads. 2015-11-09 07:39:24 +01:00
Florian Bruhin
8aa29a2ba2 bdd: Fix assert in "The requests should be" step.
When we call get_requests() inside the assertion, it won't act the same when
reinterpreting it.
2015-11-09 07:38:34 +01:00
Florian Bruhin
a05da2a956 bdd: Add a "then no crash should happen" step.
This is actually just a NOP, but helps in writing nice sentences ;)
2015-11-09 07:37:52 +01:00
Florian Bruhin
ae0e391c04 bdd: Add a "When I wait for the message ..." step. 2015-11-09 07:37:23 +01:00
Florian Bruhin
56bdb74ed9 bdd: Allow (port) replacement in "When I run ...". 2015-11-09 07:37:04 +01:00
Florian Bruhin
4c2e92c998 Make testprocess test more stable. 2015-11-06 07:17:15 +01:00
Florian Bruhin
25ecd9068c tests: Don't wait for the same line twice.
We need to search for lines in the history because we could miss something
otherwise, but for subsequent wait_for calls, we really don't want to wait for
the same thing again.

This should make test_backforward.py more stable as it *actually* waits when
going back now. Before, it did produce failures such as this one on OS X:

____________________________ test_going_backforward ____________________________
[..]
    @bdd.then(bdd.parsers.parse("The requests should be:\n{pages}"))
    def list_of_loaded_pages(httpbin, pages):
        requests = [httpbin.Request('GET', '/' + path.strip())
                    for path in pages.split('\n')]
>       assert httpbin.get_requests() == requests
E       assert [Request(verb...rward/1.txt')] == [Request(verb=...rward/2.txt')]
E         At index 3 diff: Request(verb='GET', path='/data/backforward/1.txt') != Request(verb='GET', path='/data/backforward/2.txt')
E         Full diff:
E         [Request(verb='GET', path='/data/backforward/1.txt'),
E         Request(verb='GET', path='/data/backforward/2.txt'),
E         Request(verb='GET', path='/data/backforward/1.txt'),
E         -  Request(verb='GET', path='/data/backforward/1.txt')]
E         ?                                              ^
E         +  Request(verb='GET', path='/data/backforward/2.txt')]
E         ?                                              ^
tests/integration/features/conftest.py:85: AssertionError
2015-11-06 07:02:17 +01:00
Florian Bruhin
f5f74b7ddc tests: Use a base class for testprocess lines. 2015-11-06 07:02:17 +01:00
Florian Bruhin
5541e3ed32 bdd: Wait until title is loaded in yankpaste. 2015-11-05 08:03:03 +01:00
Florian Bruhin
b0430ca3e7 bdd: Make it possible to wait for messages. 2015-11-05 08:02:55 +01:00
Florian Bruhin
547fc9f40e Simplify testprocess tests. 2015-11-05 07:40:10 +01:00
Florian Bruhin
10e52c6e9f Make testprocess test more robust. 2015-11-05 07:39:31 +01:00
Florian Bruhin
bf74fda5b2 Fix lint. 2015-11-05 07:33:32 +01:00
Florian Bruhin
76f5f4fefb bdd: Remove now unnecessary sleep. 2015-11-05 07:07:43 +01:00
Florian Bruhin
beab639d7a bdd: Wait for finished loads in backforward. 2015-11-05 07:07:43 +01:00
Florian Bruhin
924b0052c6 bdd: Match historic messages in wait_for.
Fixes #1083.
2015-11-05 07:07:43 +01:00
Florian Bruhin
2c7b0d2fb4 Add some bdd tests for scrolling. 2015-11-03 22:42:25 +01:00
Florian Bruhin
49137150ad tests: Print raw yaml in get_session() in QuteProc. 2015-11-03 22:41:56 +01:00
Florian Bruhin
2427bf5cb6 bdd: Make expect_error handle warnings. 2015-11-03 22:40:19 +01:00
Florian Bruhin
17396e1030 bdd tests: Add QuteProc.get_session(). 2015-11-03 14:55:46 +01:00
Florian Bruhin
d992390cbe bdd: Move yankpaste/test.html to yankpaste.html. 2015-11-03 14:40:30 +01:00
Florian Bruhin
e31240e6c9 tests: Increase wait_for default timeout again. 2015-11-03 07:54:24 +01:00
Florian Bruhin
c78bbd9fd0 tests: Show some information for WaitForTimeout. 2015-11-03 07:53:51 +01:00
Florian Bruhin
535bcab310 bdd tests: Restart qutebrowser once per module.
This should be a good compromise between reproducibility and speed.
2015-11-03 07:00:46 +01:00
Florian Bruhin
f5eb755ef3 tests: Ignore some Qt warnings during teardown. 2015-11-03 06:38:48 +01:00
Florian Bruhin
7e0e770d53 bdd: Increase timeouts. 2015-11-03 06:35:52 +01:00
Florian Bruhin
e13de98790 Fix lint. 2015-11-02 23:49:44 +01:00
Florian Bruhin
7da0d2b6d5 Add some bdd tests for zooming. 2015-11-02 23:41:48 +01:00