Commit Graph

518 Commits

Author SHA1 Message Date
Richard Hansen ab5934cbda webaccess: Split authFailure hook into authnFailure and authzFailure
This makes it possible for plugins to return different pages to the
user depending on whether the auth failure was authn or authz.
2020-09-26 19:37:11 +01:00
Richard Hansen 02757079c0 security: Enable authorize plugins to grant modify-only access 2020-09-26 18:36:36 +01:00
Richard Hansen 72ed1816ec security: Fix authz check for pad names with encoded characters
Also:
  * Minor test cleanups (`function` instead of arrow functions, etc.).
  * Add a test for a case that was previously not covered.
2020-09-26 10:47:27 +01:00
Richard Hansen 23131a501c tests: Rewrite import/export tests to use async and supertest 2020-09-26 10:46:16 +01:00
Richard Hansen 54c999fe83 tests: Factor out common skip checks 2020-09-26 10:46:16 +01:00
Richard Hansen 1c3c5b744c tests: Skip all import/export tests if `!allowAnyoneToImport`
Three of the four tests fail if `settings.allowAnyoneToImport` is
false. The fourth ("tries to import Plain Text to a pad that does not
exist") isn't particularly useful when `settings.allowAnyoneToImport`
is false: That test tests an import failure mode, and when
`settings.allowAnyoneToImport` is false the failure could be caused by
that instead of the expected cause.
2020-09-26 10:46:16 +01:00
Richard Hansen c148e673a8 tests: Use `this.skip()` when skipping tests 2020-09-26 10:46:16 +01:00
Richard Hansen 668373b80f tests: Fix abiword/soffice check 2020-09-26 10:46:16 +01:00
Richard Hansen 89de03795a tests: Delete unused imports and code 2020-09-26 10:46:16 +01:00
Richard Hansen 94f944160d security: Don't require express_sid if authn not required
This should make it possible to embed a pad in an iframe from another
site as long as `settings.requireAuthentication` is false.
2020-09-24 10:42:41 +01:00
Richard Hansen 53fd0b4f98 webaccess: Return 401 for authn failure, 403 for authz failure
This makes it possible for reverse proxies to transform 403 errors
into something like "upgrade to a premium account to access this
pad".

Also add some webaccess tests.
2020-09-24 10:41:58 +01:00
John McLear ca7b8e278f allow slower for Safari 2020-09-22 16:32:40 +01:00
Richard Hansen a000a93dc6 Refactor startup/shutdown for tests
* `src/node/server.js` can now be run as a script (for normal
    operation) or imported as a module (for tests).
  * Move shutdown actions to `src/node/server.js` to be close to the
    startup actions.
  * Put startup and shutdown in functions so that tests can call them.
  * Use `await` instead of callbacks.
  * Block until the HTTP server is listening to avoid races during
    test startup.
  * Add a new `shutdown` hook.
  * Use the `shutdown` hook to:
      * close the HTTP server
      * call `end()` on the stats collection to cancel its timers
      * call `terminate()` on the Threads.Pool to stop the workers
  * Exit with exit code 0 (instead of 1) on SIGTERM.
  * Export the HTTP server so that tests can get the HTTP server's
    port via `server.address().port` when `settings.port` is 0.
2020-09-22 11:07:21 +01:00
Richard Hansen 346111250e utils: Fix promise creation accounting bug in promises.timesLimit
Before this change, `promises.timesLimit()` created `concurrency - 1`
too many promises. The only users of this function use a concurrency
of 500, so this meant that 499 extra promises were created each time
it was used. The bug didn't affect correctness, but it did result in a
large number of unnecessary database operations whenever a pad was
deleted. This change fixes that bug.

Also:
  * Convert the function to async and have it resolve after all of the
    created promises are resolved.
  * Reject concurrency of 0 (unless total is 0).
  * Document the function.
  * Add tests.
2020-09-21 23:16:32 +01:00
webzwo0i 85f52a2f23
tests: Plugin backend tests in ci (#4314) 2020-09-18 16:28:42 +01:00
Joas Souza 8c04fe8775
Feature: Copy Pad without history (#4295)
New feature to copy a pad without copying entire history.  This is useful to perform a low CPU intensive operation while still copying current pad state.
2020-09-16 19:24:09 +01:00
Richard Hansen b80a37173e security: Fix authorization bypass vulnerability
Before, a malicious user could bypass authorization restrictions
imposed by the authorize hook:

 * Step 1: Fetch any resource that the malicious user is authorized to
   access (e.g., static content).
 * Step 2: Use the signed express_sid cookie generated in step 1 to
   create a socket.io connection.
 * Step 3: Perform the CLIENT_READY handshake for the desired pad.
 * Step 4: Profit!

Now the authorization decision made by the authorize hook is
propagated to SecurityManager so that it can approve or reject
socket.io messages as appropriate.

This also sets up future support for per-user read-only and
modify-only (no create) authorization levels.
2020-09-15 21:40:25 +01:00
Richard Hansen 9e6d3f3f63 tests: Add authentication, authorization bypass tests 2020-09-15 20:03:30 +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 12c05c20b2
bugfix/import: doc import bugfix (#4235) 2020-08-30 14:11: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
John McLear ab8320d15b
WIP - Test Coverage: Import & Export include LibreOffice Test Coverage (#4163)
Runs on Travis
Will only run locally is ``allowAnyoneToImport`` and ``soffice`` or ``abiword`` is set.
2020-07-14 18:44:53 +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
John McLear 2ce798339d Revert "tests: updating mocha and refactoring the custom html reporter using events"
This reverts commit df1629c7b9.
2020-06-06 18:57:52 +00:00
John McLear e0ae5010ad tests: testing parallel runners 2020-06-06 18:38:50 +00:00
John McLear aff93d24dd
export: txt import include correct OL prefix (#4086)
Includes test coverage
Final part of solving https://github.com/ether/etherpad-lite/issues/3447
2020-06-06 14:30:13 +01:00
John McLear b6bcdaf772 Revert "tests: comment out some chat tests for now until we can find a fix"
This reverts commit 16d9ca774b.
2020-06-05 23:54:57 +00:00
John McLear 16d9ca774b tests: comment out some chat tests for now until we can find a fix 2020-06-05 23:23:00 +00:00
John McLear 56cc2dca4c Merge branch 'develop' of github.com:ether/etherpad-lite into develop 2020-06-05 23:08:58 +00:00
John McLear 7985963354 comment out showchat test 2020-06-05 23:06:50 +00:00
John McLear 56f6973209
import/export: Timeslider export links numeric pad IDs (#4073)
Fixes #4071
2020-06-05 22:50:55 +01:00
John McLear fb68ac672b
tests: OL/UL further testing. 2020-06-05 22:18:58 +01:00
John McLear a4bdcc3392
tests/editor/ul/li/ol/import/export: Introduce contentcollector.js tests & various OL/UL/LI related bugfixes
1. Introduce contentcollector.js backend tests
1. Fix issue with OL LI items not being properly numbered after import
1. Fix issue with nested OL LI items being improperly numbered on export
1. Fix issue with new lines not being introduced after lists in on import #3961
1. Sanitize HTML on the way in (import)
1. Fix ExportHTML CSS because it needs to support OL > LI > OL not OL > OL [The latter being the correct format]
1. Fix backend tests.
2020-06-05 20:54:16 +01:00
John McLear 76084820ca
tests: CSS frontend runner (#4081) 2020-06-04 17:03:25 +01:00
John McLear 02af7d0c2d tests: fix font select test 2020-06-03 10:34:13 +00:00
Alexandre Magno df1629c7b9
tests: updating mocha and refactoring the custom html reporter using events 2020-06-03 10:54:55 +01:00
John McLear 4497d37af9 tests: path to request require fix 2020-06-01 18:45:01 +00:00
John McLear 0dd9db4e99
tests: fix for fix of fuzz tests
Commenting out fuzz tests for now

Fixed up paths with request..  Pesky globals..
2020-06-01 19:26:49 +01:00
John McLear 71bffed190
tests: fix for fuzz tests (#4068) 2020-06-01 18:52:46 +01:00
John McLear dc11b85e62
tests: fuzzing, binary imports 2020-06-01 17:26:55 +01:00
John McLear 4f37865d97 tests: allow tests to run for more than 10 minutes because browsers are slow on saucelabs 2020-05-31 20:11:33 +00:00
John McLear c9c2adbdb3 tests: sensible value for load tester to run at 2020-05-30 21:58:39 +00:00
John McLear 7be701dbea tests: make test runner width 80/20 2020-05-30 21:35:11 +00:00
John McLear 6d34e5b427 tests: make default timeout a bit longer and allow it to be spammy 2020-05-30 21:04:59 +00:00
John McLear 1b772c449d tests: run bcakend tests for 50 seconds instead of 60 because this is the point of optimization 2020-05-30 20:06:34 +00:00
John McLear f629f9f890 tests: change binary used for load testing 2020-05-30 18:28:33 +00:00
John McLear 2844224acb tests: backend tests tweak 2020-05-30 18:22:24 +00:00
John McLear 04cbebc165 runner load test config 2020-05-30 18:13:57 +00:00
John McLear 66aff57d87
tests: introduce automated load testing (#4066) 2020-05-30 18:51:14 +01:00
John McLear 5000997a9f
tests: make the waitFor helper more reliable and less spammy (#4065) 2020-05-30 17:10:50 +01:00
John McLear 520b20a3ca
tests: Only run one frontend test at a time (#4064) 2020-05-30 01:05:06 +01:00
John McLear 8c669682c4
tests: remove another setTimeout for Edge tests.. 2020-05-29 21:06:38 +01:00
John McLear cc606a24d7
tests: Edge test fixes and cruft removal. (#4061) 2020-05-29 20:46:07 +01:00
John McLear 174e68d468
tests: remove more edge settimeout issues (#4060) 2020-05-29 20:07:27 +01:00
John McLear be2ba34d3c
tests: remove set timeouts to try fix edge remote tests 2020-05-29 19:45:28 +01:00
John McLear 3c190c1782
Another change to the test name to make it run last... 2020-05-29 18:27:16 +01:00
John McLear e557723c8e
Renaming auto connection test 2020-05-29 17:52:00 +01:00
John McLear 59aab3676d
Revert "testing: New chrome testing hack slash workaround (#4055)" (#4057)
This reverts commit 59b54b4772.
2020-05-29 17:50:11 +01:00
John McLear 59b54b4772
testing: New chrome testing hack slash workaround (#4055)
* testing this

* worth isolating
2020-05-29 17:34:32 +01:00
John McLear c6b5846172
tests: Fix backend testing which were always partially broken due to cache (#4053) 2020-05-29 13:26:34 +01:00
John McLear d8e067a5f9
tests: Resolve Gateway timeout during automated tests by adding delay after minify request
* Remove npm cache from Travis, this was causing a world of pain.
* Remove the broken line attribute tests.
* Do a HTTP get against Etherpad to begin minification.
* Wait 10 seconds after minification before running tests.
2020-05-29 12:28:31 +01:00
John McLear b92b8a66e1
tests: Safari test fixes
* fix safari font type select & remove buggy safari test, commenting for now as it will need fixing later
2020-05-28 22:37:34 +01:00
John McLear 51eb1a7ce7
Tests: Fix Clear cookies test (#4050)
* name uses a placeholder instead of a value so this should be nothing
2020-05-28 15:27:48 +01:00
John McLear 40f36d7eb5
Tests: ShowChat fix (#4049)
Resolves https://github.com/ether/etherpad-lite/issues/3541
2020-05-28 15:18:13 +01:00
Daniel Krol febd48954c
Tests: Add and test padPrefs for helper.newPad (#4042)
Also fix a couple other tests along the way, including accounting for this change:

23307d14d5
2020-05-28 14:25:07 +01:00
John McLear 0dc59eba4d
tests: authorship test fix (#4001)
* Placeholderfortest

* rename script and make it work
2020-05-27 16:55:14 +01:00
John McLear bcdb331c79
tests: Embed test fix (#4020)
* quick fix for iframe code wihch someone broke

* Also fix cookie test
2020-05-27 16:54:20 +01:00
Daniel Krol 770c1c80b7 tests: properly clear cookies in test helper
This was introduced in 2012 with cd368b5f8e.
2020-05-13 19:29:53 +02:00
Daniel Krol 30884dd93d tests: in helper.js, add test for clearing cookies 2020-05-13 19:29:53 +02:00
John McLear 0f827ca104 tests: fix timeslider revision tests (#3898) 2020-04-19 15:15:15 +01:00
muxator 86ceeb0f15 tests: remove the scroll tests (#3897) 2020-04-19 17:25:30 +02:00
Sebastian Castro 7a6d212e17 test: fix chat
Change way of clicking the settings button, and use stick-to-screen button is second test
2020-04-19 03:03:44 +02:00
Sebastian Castro 87fb23149d test: fix layout so pad is 820px large, so is not considered as mobile 2020-04-19 03:03:44 +02:00
Sebastian Castro 21afd538aa tests: fix change_ser_color, force color author to be on 2020-04-19 03:03:44 +02:00
Sebastian Castro f5cd5a3379 test: fix pad_modal test with new popups
Old check is jquery is(':visible') no longer works because we use css property visibility hidden (for animation to work properly), and not display none
2020-04-19 03:03:44 +02:00
muxator c0d9797d0f formatting: remove trailing whitespaces on files Sebastian is going to modify
In the following commits Sebastian is going to edit three files. This change is
necessary make evident what he is going to modify, because some of them are old
vendorized libraries whose history we might want to reconstruct.

No functional changes.

Command:
    sed --in-place 's/[[:space:]]*$//' src/static/js/farbtastic.js
    sed --in-place 's/[[:space:]]*$//' src/static/js/gritter.js
    sed --in-place 's/[[:space:]]*$//' tests/frontend/specs/change_user_color.js
2020-04-19 03:03:44 +02:00
Christian Schröder 5537ef3950 test: fix settings loading in api/instance backend test
With commit 44186ed (tests: remove loadSettings.js for backend tests.)
the loading of the settings in backendtests changed. One test spec
was not updated.
2020-04-16 03:03:20 +02:00
muxator 44186edbc5 tests: remove loadSettings.js for backend tests.
The old loadSettings.js was a way of customizing settings upon load, because
the Settings module did not offer this functionality. But it did not work well,
since all the default settings were not loaded.

Let's get rid of loadSettings.js for the bulk of the tests (the "backend"
specs). For the "container" specs, we'll keep it in place until/if we rewrite
Settings.js making it less brittle.
2020-04-14 03:36:13 +02:00
Chocobozzz 8c4625ec50 tests: add tests for listAllPads() API call
--HG--
branch : padlist-use-set
2020-04-09 03:39:32 +02:00
John McLear babf67175c undomodule: disallow undoing "clear authorship colors"
Clearing the authorship colors of a document with at least two authors, and then
undoing that action caused a disconnect from the pad.
This change disallows undoing clearing authorship colors in order to prevent
the problem from affecting users, and adds the relative test coverage.

This is a change of behaviour, and is documented in the changelog.

Fixes #2802 (sidestepping it).
2020-04-08 15:20:37 +02:00
muxator e6251687bf api: test coverage for getStats() 2020-04-04 22:03:46 +02:00
John McLear 93180c287b
tests: in Travis, also run the backend tests
This change introduces automatic execution of the backend tests in Travis.

Implements #2351.
2020-04-03 03:27:05 +02:00
Viljami Kuosmanen ccf406708e openapi: support standard http error codes
API errors are now handled at the end of the request heap by
throwing exceptions from the handler
2020-04-03 01:03:11 +02:00
Viljami Kuosmanen 6aa30f213a openapi: add jsonp support + test 2020-04-03 01:03:11 +02:00
Daniel Krol ac9d7f80cc tests: add tests showing that the color chooser is not initialized with the user's color
When opening the color chooser after a page load, the selected color is always
gray, and not the user's color.
2020-04-01 02:34:56 +02:00
John McLear 6c12a7fb1f tests: backend tests for utf8 & emojis support 2020-03-31 02:11:25 +02:00
John McLear 352b432ed1 tests: in backend tests, use POST instead of GET for setText() and setHTML()
This is allowed starting from fc661ee13a ("core: allow URL parameters and POST
bodies to co-exist"), which landed in Etherpad 1.8.0. For the discussion, see
issue #3568.
2020-03-31 02:11:25 +02:00
muxator b2dc446740 tests: typo in a comment in the backend tests 2020-03-31 02:11:25 +02:00
muxator 4a17443a2e tests: future proof travis/runner.sh and make it more robust
This change only slightly modifies the bahaviour of travis/runner.sh, but:

1. speeds up the tests, because it does not install dependencies before running
   them. Dependencies are already installed by .travis.yml in its "install"
   section;
2. if for some reason Etherpad does not start, there is a sudden failure,
   instead of launching the front end tests anyway, and then having to wait 10
   minutes for them to time out;
3. it is compatible with a different way of installing etherpad dependencies
   ("npm ci" instead of "npm install"), whereas the previous one broke. This
   will probably be introduced in a while, so this change future-proofs for it
   (see #3778).
4. it is more robust, because it detects more reliably the paths, and changes
   between them correctly;

Please note that the script now requires bash instead of a generic posix shell.
This may break on platforms which default to a different shell (FreeBSD, MacOS?)
2020-03-29 23:59:28 +02:00
John McLear 8f2ad7a0e8 tests: use latest Safari in Saucelab front end tests
I verified that, as of today, "latest" Safari version works on Saucelabs.
2020-03-26 23:26:25 +01:00
John McLear 3c78ada8da tests: disable a scroll test that needs to be looked at 2020-03-24 23:24:38 +01:00
John McLear ee47bac7b0 tests: increase timeout 2020-03-24 23:24:38 +01:00
John McLear 7cf911c330 tests: don't run specific tests in Edge that simulate enter keypress
Because I can't get enter keypress to simulate properly despite trying various
approaches.
2020-03-24 23:24:38 +01:00
John McLear 90da21df35 tests: some scroll tests fixed 2020-03-24 23:24:38 +01:00
John McLear fc1d1fca2b tests: fix redo 2020-03-24 23:24:38 +01:00
John McLear 675c839d92 tests: use helper for evttype to reduce duplicate code 2020-03-24 23:24:38 +01:00
John McLear be9afc7955 tests: re-enable test for undo 2020-03-24 23:24:38 +01:00
John McLear 93ee98ea4b tests: remove white space from getSelection(). This HACK fixes Firefox tests
This is a bit of a hack, because it appears that getSelection() behaviour is
not consistent across browsers.
2020-03-24 23:24:38 +01:00
John McLear d05e02a681 tests: increase helper timeout 2020-03-24 23:24:38 +01:00
John McLear f7783e5f2a tests: Firefox suport for undo keypress 2020-03-24 23:24:38 +01:00
John McLear d8c4dd7e77 tests: fix IE undo test 2020-03-24 23:24:38 +01:00
John McLear 58e1e2d16f tests: hopefully fixed all tests to be working in edge 2020-03-24 23:24:38 +01:00
muxator 04e9fc3a2f formatting: bulk remove trailing whitespaces on frontend tests
This is a followup on 312c72c364, which did the same on the main code base,
and is preliminary work for tidying up John's changes in the following commits.

No functional changes.

Command:
    find tests/frontend -name '*.js' -type f -print0 | xargs -0 sed --in-place 's/[[:space:]]*$//'
2020-03-24 23:24:38 +01:00
John McLear 88d05d3e66 tests: configure the OS/Browsers versions on which tests will be run
For all the supported operating systems, the latest version of each browser is
supported, with the Exception of Win 8 / IE 10, which has an explicit version
pinned.
2020-03-23 23:51:51 +01:00
John McLear 3085f46f32 tests: explicit tunnel version URI in sauce_tunnel.sh
For an explanation, see bf0bb58c70.
2020-03-23 23:51:51 +01:00
muxator f6436be486 tests: quote bash variables in sauce_tunnel.sh 2020-03-23 23:51:51 +01:00
muxator c382ba35c9 tests: backed out changeset 155a895604
This was a preparatory commit for 3292429ab3 (which introduced a bug, see
issue #3728) and modified the tests for issue #3620.

Commit 155a895604 per se did not introduce any bugs, but was difficult to
inspect because of its size. For this, the corresponding PR (#3622) should not
have been accepted.

--HG--
branch : revert-3622
2020-03-19 02:53:41 +01:00
Tom Briles 155a895604 Test for Issue-3620: space in the HTML for an unordered list creates an extra list item 2020-03-15 11:35:08 +00:00
Pierre Prinetti 92f07a544b ci: test basic application response of the docker build
Note by muxator:
This commit introduced a copied & modified version of the testing files
loadSettings.js and pad.js.

It's Christmas night, and we want to shipt this feature, so I merged it anyway,
adding a note in both the original and copied files so that hopefully someone
in the distant future is going to merge them back again.
2019-12-25 00:28:38 +01:00
muxator bf0bb58c70 ci: no need to include java
The dependency on java was introduced in 2012 (c021cf52d8) to start
Sauce-Connect from sauce labs.

Probably at the time it was a runtime dependency, but it is no longer the case
today. It is possible that java was already not needed when db003a1460 changed
from downloading Sauce-Connect-latest.zip to sc-latest-linux.tar.gz.

Moreover, I am quite sure tests/frontend/travis/sauce_tunnel.sh no longer works
today, because tests/frontend/travis/sauce_tunnel.sh downloads from an url that
gives HTTP/404 now: sc-latest-linux.tar.gz if no longer a valid file name, we
would need to explicitly download a specific version.
2019-12-25 00:28:38 +01:00
muxator fe0cf4bdb0 tests: reorganize some files, because we are going to copy & paste them.
In the following commits Pierre is going to copy & modify some files.
This commit prepares the source files in order to minimize those differences,
so we can re-unify them as soon as possible.

No functional changes.
2019-12-25 00:28:38 +01:00
muxator 312c72c364 formatting: bulk remove trailing whitespaces
Do not touch vendorized files (e.g. libraries that were imported from external
projects).

No functional changes.

Command:
    find . -name '*.<EXTENSION>' -type f -print0 | xargs -0 sed -i 's/[[:space:]]*$//'
2019-10-20 02:09:22 +02:00
Ray Bellis fc661ee13a core: allow URL parameters and POST bodies to co-exist.
Node 8.14.0 prohibits HTTP headers that exceed 8 KB (source:
https://nodejs.org/en/blog/vulnerability/november-2018-security-releases/#denial-of-service-with-large-http-headers-cve-2018-12121).

This patch allows for the parameters within the body of an HTTP POST request to
be used in addition to those within the URL (and will override them).

Closes #3568.

---
Muxator 2019-10-19:
- this commit was cherry-picked from 882b93487f
- it was modified to include the necessary changes in the documentation
2019-06-27 00:52:53 +02:00
muxator 705cc6f5e4 Change everywhere the link to https://etherpad.org (it was plain http) 2019-04-16 00:54:54 +02:00
Ray Bellis 4622309dc2 TidyHtml.js: convert to promises
test case uses "nodeify" to convert the calls to TidyHtml back
into nodeback because it integrates better with the test framework
2019-01-31 13:42:41 +00:00
muxator b34fc2de2b use Date.now() instead of new Date().getTime()
This is documented to be more performant.

The substitution was made on frontend code, too (i.e., the one in /static),
because Date.now() is supported since IE 9, and we are life supporting only
IE 11.

Commands:
  find . -name *.js | xargs sed --in-place "s/new Date().getTime()/Date.now()/g"
  find . -name *.js | xargs sed --in-place "s/(new Date()).getTime()/Date.now()/g"

Not done on jQuery.
2019-02-26 23:25:15 +01:00
muxator 6d36bb2c53 node8: we can safely use os.tmpdir()
Since we are requiring node >= 8, we can safely use native functionalities.
2019-02-19 22:01:12 +01:00
Luiza Pagliari 8b7f7d49c0 tests: make sure author is switched on authorship test
Original implementation of authorship test assumed a simple pad reload
would switch the author -- and it actually did on Chrome. But other
browsers might keep the author id on cookie.

To force the author switch, expire the cookie before reloading the pad.

Fixes: #3435
2018-09-02 13:10:27 +02:00
muxator b466acd881 Merge test fixes for import/export. Fixes #3425.
Now we have a working test for #3268 (fe08d2a1db).
2018-08-09 18:54:55 +02:00
ilmar 718b175524 tests: show that Etherpad is not able to import & export back a mixed lists
This commit replaces an old test with a new, different one.
Reasons for removing the old test:

- the old list test was introduced in cadb83a with an explicit attempt to import
  an invalid HTML and see if it could recover from it
- in 5967e08 the code base finally managed to export a meaningful HTML (but we
  do not know if other bugs were introduced in pursuing this)
- the old test seemed to aim at attaining resiliency, but correctness should be
  addressed before that

Modified by muxator. See discussion in:
https://github.com/ether/etherpad-lite/pull/3268#issuecomment-411185713
2018-08-06 23:15:48 +03:00
muxator 379690abbf tests: backend tests are now run with "npm test" instead of a custom bash script 2018-07-28 23:54:51 +02:00
muxator cb8275fc4b docs: trivial corrections to test documentation 2018-07-28 23:54:51 +02:00
muxator 42e0646327 Merge Firefox frontend test fixes
The fix was done on another branch to show that it completely solves tests
failures introduced by 2be873e3c7.

All remaining failures in this branch are due to other changes made after
**1.6.6**, namely from fe08d2a1db included onwards.
2018-07-21 14:16:20 +02:00
muxator 4580537537 tests: fix frontend tests on firefox
These changes make the frontend tests send keydown instead of keypress in
firefox, in accordance with #3413 (Use keydown instead of keypress on Firefox).

The percentage of passing frontend in Firefox 61 on this revision is 100%.
2018-07-20 23:58:47 +02:00