Commit graph

375 commits

Author SHA1 Message Date
webzwo0i
951c93fa6d change_user_name test: refactor 2020-12-27 23:40:35 +00:00
John McLear
38c9827161
Feature: Scroll to Line number based on Hash IE http://foo.com/p/bar#L10 will scroll to line 10. (#4554)
Includes test coverage
Co-authored-by: webzwo0i <webzwo0i@c3d2.de>
2020-12-26 22:05:08 +01:00
webzwo0i
790ba72a9e change scroll-behavior to auto
timeslider follow test: ensure there are so much lines in the pad view
below the changed line, so that the changed line will be the first
visible line
2020-12-23 16:18:28 -05:00
Richard Hansen
a44debdcfe Add ' and * to acceptable URL characters
These characters are in the RFC3986 reserved set.

These characters are added to the set of characters that cannot be the
last character of a URL to avoid mislinkification.
2020-12-14 07:03:17 +00:00
Richard Hansen
7d23278ed0 Exclude ?, !, and ) from last character of URL
Now the final character in each of these example strings is no longer
considered part of the URL:
  * Have you seen http://example.com?
  * Look at http://example.com!
  * (see http://example.com)
2020-12-14 07:03:17 +00:00
Richard Hansen
66d0eb9a1f tests: Expand the tests in urls_become_clickable.js 2020-12-14 07:03:17 +00:00
Richard Hansen
1c388ca66e tests: New helper.clearPad method 2020-12-14 07:03:17 +00:00
Richard Hansen
ca01856f94 lint: Fix some straightforward ESLint errors 2020-12-14 07:03:17 +00:00
Richard Hansen
5a8f7cf54e test runner: Simplify getURLParameter() 2020-11-25 19:19:24 +00:00
Richard Hansen
958f7d8966 lint: Fix most ESLint errors in runner.js 2020-11-25 19:19:24 +00:00
Richard Hansen
064fcf8c00 test runner: Pass single argument to append()
This makes the strings easier to read, and it simplifies `append()`.

Also fix some lint errors:
  * Use `const` instead of `var`.
  * Convert `append()` to an arrow function.
  * Wrap long lines.
2020-11-25 19:19:24 +00:00
Richard Hansen
107942ad8a lint: Rerun eslint --fix to nuke trailing function call commas
eslint-config-etherpad 1.0.11 changed the comma-dangle rule to
prohibit trailing commas for function arguments. See:
673ab07acf
Re-run the automated fixes to apply the rule change.

This also fixes a few lint issues in changes that were made after
`eslint --fix` was originally run.
2020-11-25 13:09:14 -05:00
webzwo0i
0a72459b3d frontend tests: fix trailing comma in runner.js 2020-11-25 09:04:34 +00:00
webzwo0i
b98aaf4904
backend tests: change loglevel to WARN (#4514) 2020-11-25 02:20:50 -05:00
Richard Hansen
c673a597f8 tests: Fix what appears to be a typo
This fixes a SonarCloud error.
2020-11-24 20:06:12 +00:00
Richard Hansen
b8d07a42eb lint: Run eslint --fix on bin/ and tests/ 2020-11-24 20:06:12 +00:00
Richard Hansen
7df3ded66f lint: Put opening brace on same line as function
Normally I would let `eslint --fix` do this for me, but there's a bug
that causes:

    const x = function ()
    {
      // ...
    };

to become:

    const x = ()
    => {
      // ...
    };

which ESLint thinks is a syntax error. (It probably is; I don't know
enough about the automatic semicolon insertion rules to be confident.)
2020-11-24 20:06:12 +00:00
Richard Hansen
cc988bd67b lint: Convert CR+LF line endings to LF 2020-11-24 20:06:12 +00:00
webzwo0i
b71b606774
tests: Switch from Travis to Github Actions
Travis placed an unnecessary breaking restriction on our tests and failed to respond within 72 hours to our complaint.  This has forced us to introduce Github Actions to manage our testing.  This is hopefully a temporary measure while Travis either gets itself together or we find a non-Github requirement.
2020-11-24 18:12:41 +00:00
Richard Hansen
1d491c0059 tests: Clean up Travis runner scripts
* Avoid bashisms.
  * Simplify `sed` of `settings.json`.
  * Wrap long lines.
  * Define and use the conventional log functions.
  * Quote variable expansions.
2020-11-22 09:22:14 +00:00
Richard Hansen
c9eb4c72a5 tests: Kill Etherpad and wait for it to exit 2020-11-22 09:22:14 +00:00
Richard Hansen
9abb77e899 tests: Set loglevel to WARN instead of suppressing stdout 2020-11-22 09:22:14 +00:00
John McLear
06e0ff3cd3
tests: Test against Safari 13, drop Safari 12 coverage. 2020-11-19 09:06:57 +00:00
webzwo0i
f6aed0c9cb
Fix truncation in travis (#4479)
* log to travis every five seconds
* travis: kill etherpad process after tests
2020-11-10 06:59:50 +01:00
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