Commit Graph

23 Commits

Author SHA1 Message Date
Richard Hansen c8e0916e1a tests: Spy on socket.io messages as early as possible 2021-11-01 01:54:28 -04:00
Richard Hansen e28c9ffc97 tests: Support injecting hook functions during pad load 2021-11-01 01:54:28 -04:00
Richard Hansen 653dbb3449 tests: Wait for pad init before returning from `helper.aNewPad()`
This should make it easier to avoid race conditions.
2021-09-28 04:18:24 -04:00
Richard Hansen ff39eeafca tests: Factor out duplicate `getFrameJQuery()` 2021-07-25 02:23:50 +02:00
Richard Hansen 42026ff771 tests: Add a comment explaining why `Promise.all()` is not used 2021-07-25 02:23:50 +02:00
Richard Hansen 01184cd1aa tests: Remove unnecessary `includeJquery` parameter 2021-07-25 02:23:50 +02:00
webzwo0i 62093adce5 tests: refactor inclusion of jquery and sendkeys via script tags
Readability is increased by explicitly checking if jquery/sendkeys was
already loaded before evaluating it in the context of ace_inner and the
enclosing container (pad.html). Note that sendkeys is no longer
evaluated in the context of ace_outer, as this isn't needed

Also removes some IE 8/9 legacy code
2021-07-21 01:53:05 +02:00
Richard Hansen 20df34bb67 tests: Promisify `helper.init()` 2021-06-05 03:50:36 -04:00
Richard Hansen e144434571 tests: Use relative paths in `helper.init()`
This avoids problems if Etherpad is served under a path like
`/etherpad`.
2021-06-05 03:49:12 -04:00
Richard Hansen 7cbb3f565d tests: Speed up `helper.edit()` and `helper.clearPad()` 2021-04-02 15:46:27 +02:00
Richard Hansen 2776946627 tests: Use cookie libraries to manipulate cookies 2021-04-01 14:31:56 +02:00
Richard Hansen 137fa89d2a tests: Always set cookie path to / (to match non-test behavior) 2021-04-01 14:31:56 +02:00
Richard Hansen 5666c34061 tests: Fix encoding of prefs cookie 2021-04-01 14:31:56 +02:00
Richard Hansen 718da6fc1b tests: New `helper.aNewPad()` (promisified `newPad()`) 2021-03-29 18:40:05 -04:00
Richard Hansen ec76a6548f tests: Make the `helper.newPad()` callback optional 2021-03-29 18:40:05 -04:00
Richard Hansen 27b35699ea tests: Fix `helper.newPad()` retries
* Pass retry count in options object so that each pad has its own
    retry count.
  * Delete useless `origPadName` variable.
2021-03-29 18:40:05 -04:00
John McLear 1b8cd0747d
Move vendor libraries to /vendors folder and exclude from LGTM 2021-02-21 15:07:39 +00:00
Richard Hansen 09e9c36098 tests: Accept async condition functions for `helper.waitFor()` 2021-02-13 08:12:53 +00:00
Richard Hansen 8dca4cb16f tests: Give `helper.waitFor()` timeout errors a useful stack trace 2021-02-13 08:12:53 +00:00
Richard Hansen 1c8a913411 lint: Delete unnecessary `eslint-disable-line` comment 2021-02-13 08:12:53 +00:00
Richard Hansen eb9d5bb470 lint: `src/tests/frontend/helper.js` and friends 2021-02-13 00:46:30 -05:00
John McLear 2b112ac851
tests: Admin Frontend Test Coverage(#4717)
Covers all frontend admin operations, runs separated in CI.
2021-02-07 11:32:57 +00:00
John McLear 2ea8ea1275 restructure: move bin/ and tests/ to src/
Also add symlinks from the old `bin/` and `tests/` locations to avoid
breaking scripts and other tools.

Motivations:

  * Scripts and tests no longer have to do dubious things like:

        require('ep_etherpad-lite/node_modules/foo')

    to access packages installed as dependencies in
    `src/package.json`.

  * Plugins can access the backend test helper library in a non-hacky
    way:

        require('ep_etherpad-lite/tests/backend/common')

  * We can delete the top-level `package.json` without breaking our
    ability to lint the files in `bin/` and `tests/`.

    Deleting the top-level `package.json` has downsides: It will cause
    `npm` to print warnings whenever plugins are installed, npm will
    no longer be able to enforce a plugin's peer dependency on
    ep_etherpad-lite, and npm will keep deleting the
    `node_modules/ep_etherpad-lite` symlink that points to `../src`.

    But there are significant upsides to deleting the top-level
    `package.json`: It will drastically speed up plugin installation
    because `npm` doesn't have to recursively walk the dependencies in
    `src/package.json`. Also, deleting the top-level `package.json`
    avoids npm's horrible dependency hoisting behavior (where it moves
    stuff from `src/node_modules/` to the top-level `node_modules/`
    directory). Dependency hoisting causes numerous mysterious
    problems such as silent failures in `npm outdated` and `npm
    update`. Dependency hoisting also breaks plugins that do:

        require('ep_etherpad-lite/node_modules/foo')
2021-02-04 17:15:08 -05:00
Renamed from tests/frontend/helper.js (Browse further)