Commit Graph

351 Commits (f0da3a0c4caea24123c22b6e0dc10bec419ccccd)

Author SHA1 Message Date
webzwo0i b67c9cc136
tests: Speed up and fix travis (#4453)
Various test runner fixes.
2020-10-30 10:40:11 +00:00
webzwo0i 069e9997dd
tests: 10 sec maximum wait time for timeslider (#4430) 2020-10-23 12:43:38 +01:00
webzwo0i 047dfcdee9
tests: relaxed constraint on the number of interval triggers (#4427) 2020-10-22 16:01:51 +01:00
webzwo0i 69c7033a86
tests: refactor some frontend tests (#4408)
* don't include sendkeys in index.html as it's included in helper.init
mocha opts: add default timeout and replace ignoreLeaks with checkLeaks,
as the former is deprecated

* introduce helper.edit to write to a pad

* add test to check if helper.edit() supports line numbers

* helper tests: waitFor/waitForPromise seem to be a little bit faster sometimes

* tests: refactor chat.js

* tests: refactor timeslider_numeric_padID

* tests: refactor timeslider_labels

* tests: refactor timeslider_follow

* ensure followContents is enabled, although it should be by default

* timeslider_follow: increase number of revision for Edge

* make textLines() depend on linesDiv()

Co-authored-by: Richard Hansen <rhansen@rhansen.org>

* make linesDiv return standard Array

* use `contain` instead of `indexOf`

* more fixes from the review

* review fixes

* align waitFor and waitForPromise behaviour

* timeslider_follow: check if it's following to the correct lines

* lower expected waitFor/waitForPromise interval check

* disable responsivness and regression test in timeslider_follow

* timeslider_follow: fix Range detection

* more explicit test for linesDiv

Co-authored-by: Richard Hansen <rhansen@rhansen.org>
2020-10-21 18:43:17 +01:00
Richard Hansen 1dba121aff tests: Tune `waitForPromise()` poll count test some more
Looks like the test machines can be quite slow, which causes noise in
the count.
2020-10-14 18:16:20 +01:00
Richard Hansen e0542f903a tests: Tune `waitForPromise()` poll count test
This should have been done in c222fc5d0b
but I forgot.
2020-10-14 16:59:03 +01:00
Richard Hansen 50e402193b tests: `waitForPromise()` test improvements
* Avoid a false positive if a Promise that is expected to reject
    doesn't reject.
  * Use modern JavaScript language features: arrow functions,
    `const`/`let` instead of `var`.
  * Remove the tests that test Promise behavior.
  * Add new test that checks that it returns a Promise.
2020-10-14 10:38:52 +01:00
webzwo0i a3f062af96 tests: add waitForPromise method and test for it 2020-10-14 10:38:52 +01:00
webzwo0i 86c0648ede tests: don't force a callback in it, so we can use async in tests 2020-10-14 10:38:52 +01:00
Richard Hansen c222fc5d0b tests: Change `waitFor()` to check before first sleep
There are a few problems with sleeping before checking the condition
for the first time:

  * It slows down tests.
  * The predicate is never checked if the interval duration is greater
    than the timeout.
  * 0 can't be used to test if the condition is currently true.

There is a minor disadvantage to sleeping before checking: It will
cause more tests to run without an asynchronous interruption, which
could theoretically mask some async bugs.
2020-10-14 10:38:52 +01:00
Richard Hansen 8016bd225f tests: Teach `waitFor()` to reject if the predicate throws 2020-10-14 10:38:52 +01:00
Richard Hansen 262eb9af60 tests: Use default arguments for `helper.waitFor`
Now `helper.waitFor(fn, 0)` times out immediately (as expected in
tests) instead of waiting 1900ms.
2020-10-14 10:38:52 +01:00
Richard Hansen 16b0768a93 tests: Fix unchainable `helper.waitFor().fail()`
The `helper.waitFor()` function returns a jQuery Deferred object.
Deferred objects are supposed to have a `.fail()` method that is
chainable (it should return `this`). Before this change,
`helper.waitFor()` monkey-patched the `.fail()` method with a function
that returned `undefined`. Now the monkey-patched `.fail()` returns
the Deferred object.

Also modernize the code a bit.
2020-10-14 10:38:52 +01:00
John McLear 92d4b8b649
tests: re-enable docker tests in travis (#4395)
Thanks to node10 having better support we can re-enable these tests.
2020-10-06 14:21:09 +01:00
Richard Hansen a8cf434d1d import: Replace the `allowAnyoneToImport` check with `userCanModify`
This reduces the number of hoops a user or tool must jump through to
import.
2020-10-05 18:48:16 +01:00
John McLear 8919608d45 tests: disable a version of safari for now as its too buggy on sauce labs 2020-09-27 23:13:29 +01:00
John McLear 505d67ed1c allowing longer for FF to do timeslider rev test 2020-09-27 21:44:43 +01:00
John McLear 53b80d6280
tests: adding a check before finishing responsiveness test - allowing load test to run for 25 instead of 30 seconds to facilitate travis performance. (#4363)
The goal of this PR is to make tests break less frequently.  It is yet confirmed if this has worked but time will tell.
2020-09-27 15:13:55 +01:00
John McLear ea4b9bf7d7
tests: support even slower safari (#4361) 2020-09-26 21:57:21 +01:00
John McLear ca7b8e278f allow slower for Safari 2020-09-22 16:32:40 +01:00
webzwo0i 85f52a2f23
tests: Plugin backend tests in ci (#4314) 2020-09-18 16:28:42 +01:00
John McLear 4434e54368
Update responsiveness.js
Changing allowed delay from 300 to 400 because Safari OSX is consistently slow compared to every other modern browser.
2020-09-12 11:00:05 +01:00
webzwo0i e2b3b009e1
tests: skip responsivness test on firefox 52.0/windows (#4275) 2020-09-09 21:40:53 +01:00
John McLear 2b9915d00d commenting out responsiveness test in preperation for a release 2020-09-08 15:18:19 +01:00
webzwo0i d30364d3de
tests: make it more clear that test duration exceeded (#4237) 2020-08-30 16:41:12 +01:00
John McLear 4db484e34e
tests: uncomment responsiveness tests
To make travis run them again and review to see what fails.
2020-08-27 22:45:32 +01:00
webzwo0i acfa1b6b4e
frontend tests: retry should retry with the same padName, which was not true in case there was no padName supplied (#4206) 2020-07-29 19:26:09 +01:00
webzwo0i 1b6a9d8be0
tests: Fix frontend tests (#4188), ugly work around for "Pad never loaded" (#4200)
* remote_runner.js: fix drain call (cf.
https://github.com/caolan/async/blob/master/CHANGELOG.md#breaking-changes)

* dont wait 30 seconds after remote_runner.js returned

* timeout frontend tests after 9.5 minutes to prevent travis from silently stop them

* log when not all tests finished

* prevent killTimeout to happen after last test

* log server messages to console

* remote_runner will take some time to setup sl, so this second is not necessary

* dont write to global mocha variable

* mochas `test end` event is not called when a before/beforeEach-hooks
failed, so we should only use pass/fail/pending-hooks for logging.
also some cruft removed

* pass test in `pending`-event handler

* remove some more cruft in tests/frontend/runner.js

* frontend tests: clarify why stats.tests and total differ

* move killTimeout to pass/fail/pending instead of `test end` to guarantee that it is run

* delete killTimeout on test end to prevent misleading log message

* unused variable

* fix regex

* unlikely edge case

* ensure `allowed test duration exceeded` message is printed for the last runner

* get rid of jquery.iframe.js, currently no support for IE<9

* retry up to 3 times when pad could not be loaded

* Call the logging code in stopSauce in a callback for `browser.quit()`.
This should fix cases like
https://app.saucelabs.com/tests/cb8225375d274cbcbb091309f5466cfd
Travis received all the logs and remote_runner.js exits, but there never
is a DELETE command for webdriver.
2020-07-28 19:57:33 +01:00
Daniel Krol 859a128c54
Command line argument for chromium test for fake webrtc (#4199) 2020-07-28 10:33:49 +01:00
John McLear 29e6daedcb
tests: Remove scroll tests again - Finally accept they will never work again due to browser changes. (#4183) 2020-07-20 00:11:59 +01:00
John McLear bf295d42d7
tests: fix follow test to work on larger screens (#4182) 2020-07-20 00:09:33 +01:00
John McLear bf24063234
Feature: Timeslider follow (#4133)
When new edits come in changes are followed in the time slider.
2020-07-19 23:46:58 +01:00
John McLear a785914aa4
tests: Scroll test update (but potentially not fix) (#4179)
* comment out broken ones for now with notes to fix

* changes to scroll tests to make them pass but afaik everything is broken due to browser restrictions RE sending keypresses so you cant trust these tests
2020-07-19 22:55:31 +01:00
John McLear 40014d8230
Rate limit Socket IO communication - WIP (#4036)
Includes settings
    Includes i18n
    Includes a nice notification
    Disconnects on rate limit
    Includes feeding into metrics/stats
    Include console warn to server console.
2020-07-19 22:44:24 +01:00
John McLear 4f5cf2dc63
tests and bugfix: test coverage and fix for 4165 - bad HTML export of list items (#4180)
Also fix for test max value for ratelimiter
2020-07-19 16:31:13 +01:00
John McLear 8863ea804c Revert "Revert "tests: testing to see if responsiveness test enable broke travis... Committing direct to ensure SL tests run""
This reverts commit 7c8c2665cb.
2020-07-17 23:23:34 +00:00
John McLear 09ce8bcc45 tests: make target versions inline with #4162 part 3 2020-07-17 12:40:48 +00:00
John McLear f4e5e9b750 tests: make target versions inline with #4162 part 3 2020-07-17 12:40:13 +00:00
John McLear c288fbe2e0 tests: make target versions inline with #4162 part 2 2020-07-17 12:28:24 +00:00
John McLear fad3830097 tests: make target versions inline with #4162 2020-07-17 11:58:32 +00:00
John McLear 7c8c2665cb Revert "tests: testing to see if responsiveness test enable broke travis... Committing direct to ensure SL tests run"
This reverts commit 423b99f499.
2020-07-17 11:57:28 +00:00
John McLear 423b99f499 tests: testing to see if responsiveness test enable broke travis... Committing direct to ensure SL tests run 2020-07-17 10:15:30 +00:00
John McLear 864e76b300
tests: Responsive test enable (#4174)
Just enabling the responsiveness test as part of attempting to solve #3506
2020-07-17 10:23:13 +01:00
John McLear 7b0fd4fb29
Bugfix / tests: Travis use LibreOffice PPA and fix import /export tests for good. (#4166)
Just final bits of test coverage for import/export of LibreOffice.  It turns out Travis by default installs an old LO that doesn't support PDF import.  To remedy that I use the LO PPA and also strict install the PDF import support.

Still to do in a future date is check LO exported contents includes expected strings, for now it just checks output length looks sane.
2020-07-16 10:46:45 +01:00
webzwo0i 2c8fb99be8
frontend test improvements (#4161)
* update sauce connect proxy to 4.6.2

* include tunnelIdentifier in webdriver capabilities

* add platform in console output

* include extendedDebugging in webdriver capabilities to get browser console logs

* informative: add comment for timeouts during tests

* When the killTimeout in runner.js stops the tests, it's an failure.

* do not wait a hardcoded amount of 10 seconds for files to be minified.
this setup time is not included in the total time of the first test.

* run 4 browsers at a time during frontend testing

* try to include test.speed in output

* time is in test.duration, not test.speed

* frontend tests: 6 sessions in parallel, add OSX 10.14-safari and Windows7-firefox, pin all browsers instead of use latest

* typo
2020-07-13 15:12:39 +01:00
webzwo0i b7dff552f0
cruft: Remove unecessary consolelogs (#4141) 2020-06-27 20:12:06 +01:00
webzwo0i bbee833b89
Fix backendRunner's exitcode (#4134)
* remove minification because it's not necessary for backend and contentcollector tests

* run all tests regardless of errors
2020-06-27 20:10:55 +01:00
John McLear d1efa509e6 Revert "Revert "tests: updating mocha and refactoring the custom html reporter using events""
This reverts commit 2ce798339d.
2020-06-07 08:53:10 +00:00
John McLear c5584fb5b4
editor: outdent on ol removal (#4088) 2020-06-07 09:51:12 +01:00
John McLear 71a1f28ab9 tests: remote parallel runners, they defo causing issues at the moment ;( 2020-06-07 02:23:56 +00:00