Граф коммитов

58 Коммитов

Автор SHA1 Сообщение Дата
Vinicius Reis afe74b4450
(#2184): add callouts cypress tests
Signed-off-by: Vinicius Reis <vinicius.reis@nextcloud.com>
2022-03-14 11:38:29 -03:00
Vinicius Reis 0ee23b93d8
(#2184): add eslint-plugin-cypress
also remove dependency vulnerability

Signed-off-by: Vinicius Reis <vinicius.reis@nextcloud.com>
2022-03-14 11:38:29 -03:00
Julien Veyssier 76abf29f8c
test attachment folder feature with shared files
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
2022-03-11 12:21:12 +01:00
Julien Veyssier b534208eb7
wait for requests/animations rather than arbitrary number of seconds
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
2022-03-11 09:59:34 +01:00
Julien Veyssier e6574b970a
test attachment dir content after upload, move, copy, delete
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
2022-03-10 18:29:57 +01:00
Max 31fa342803
fix: workspace with Readme.md open details.
Do not show the spinning wheel unless the file actually changed.

* Resolves #2215.
* Targets: master.

Opening Readme.md in the sidebar triggers a PROPFIND.
We parse its response just like the initial file list load.
Readme.md is part of the response and our handler attempts to open it.

Only set the vm.ready if the file actually changed.
Only a changed file will make the editor load again.
Only then will it set ready to true and stop the spinning wheel.

Signed-off-by: Max <max@nextcloud.com>
2022-03-03 15:54:13 +01:00
Max 6af910fe41
ui: use list icon for tasklists
Using `mdiOrderBoolAscendingVariant` as suggested in #2018.

Fixes #2018 together with the previous commit.

Signed-off-by: Max <max@nextcloud.com>
2022-03-02 13:26:11 +01:00
Max 0afc3236c2
fix: indicator of the task list.
See #2018.

Use tiptap TaskList and TaskItem.

Markdown-it happily mixes tasks and bullet points in the same list.
Tiptap lists are strictly separated.

Split bullet and tasks into BulletList and TaskList in markdown-io.

Just like this will turn into three different lists:

* one
- two
+ three

This will now also turn into three different lists
with the middle one being a task list:

* first list
* [ ] todo
* [x] done
* third list

Signed-off-by: Max <max@nextcloud.com>
2022-03-02 13:26:11 +01:00
Max 69a9acce3a
test: load markdown with commands from .md file
Signed-off-by: Max <max@nextcloud.com>
2022-03-02 13:26:10 +01:00
Max 1d323fdcdc
test: runCommands to run all commands included in Markdown
This allows specifying what steps to perform in a test inside the test data.

Signed-off-by: Max <max@nextcloud.com>
2022-03-02 13:26:10 +01:00
Max 7a83446de3
test: loadMarkdown to initialize editor content
Signed-off-by: Max <max@nextcloud.com>
2022-03-02 13:26:09 +01:00
Max 9279b45c47
test: expect markdown
Signed-off-by: Max <max@nextcloud.com>
2022-03-02 13:26:09 +01:00
Max 2c88d9bd15
test: iterate over elements with Todo text
Signed-off-by: Max <max@nextcloud.com>
2022-03-02 13:26:09 +01:00
Max 8bc08c7234
test: todo lists and others
Signed-off-by: Max <max@nextcloud.com>
2022-03-02 13:26:08 +01:00
Max bc22e3335e
test: closing the non-viewer modal in shared folder
This is a regression tests for #2104.

Signed-off-by: Max <max@nextcloud.com>
2022-03-02 10:46:15 +01:00
Max 2891fd0255
fix: do not try to send steps to a read only doc
Cypress tests were failing because they triggered editor.focus on a read only doc.
Focus seems to cause sendable steps - maybe because the current cursor changes.

Prevent this on various levels:
* Do not autofocus read only docs.
* Do not send steps to read only docs.
* Handle server response with 403 without content gracefully when sending steps.

The last originated here:
https://github.com/nextcloud/text/blob/master/lib/Service/ApiService.php#L158
So wither the session was not valid or the document read only.

Not entirely sure what best to do in this situation.
Logging to console.error for now.

Signed-off-by: Max <max@nextcloud.com>
2022-03-02 08:21:15 +01:00
Max 8bd6b0c4d6
test: workspace in public share
Also remove all the timeouts and error workarounds from share tests.
We increase the timeout in CI for all commands
and that works quite well so far.

Signed-off-by: Max <max@nextcloud.com>
2022-03-02 08:19:29 +01:00
Max f2384f4f89
test: do not force_language for cypress
Currently only few tests are language dependent.
Run tests without a preset language on the server
and fix the language in the tests in question.

Signed-off-by: Max <max@nextcloud.com>
2022-03-02 08:19:28 +01:00
Max d3315bf32a
fix: workspace with alternative file names
Signed-off-by: Max <max@nextcloud.com>
2022-03-02 08:19:16 +01:00
Max 7782f4ddfb
use filelist PROPFIND for loading workspace
See #2171.

Even though this is meant to improve load times
I did not observe any improvements locally.

I suspect that is because the workspace was loaded in parallel with the PROPFIND anyway.
Experience may differ in production environments obviously.

It is still one request less and the code also seems more clean.

Signed-off-by: Max <max@nextcloud.com>
2022-03-02 08:18:04 +01:00
Azul edfbb70f15
upgrade: tiptap v2
Migrate the entire editor to tiptap v2.

Some changes were introduces that go beyond just using the new tiptap API:

*Collaboration*

Port tiptap1 collaboration.
We still want to use our session and sync mechanism.

*Serialization*

Add Markdown extension to handle serialization.
Tiptap config extensions are not automatically added
to the prosemirror schema anymore.
The extension adds the `toMarkdown` config value to the prosemirror schema.

With the new naming scheme tiptap nodes for a number of elements
do not match the prosemirror names.
Camelcase the marks and nodes from `defaultMarkdownSerializer`
so they match the tiptap names.

*Menubar*

* Specify args for isActive function directly rather than setting a function.
* Make use of the editor instance inside the MenuBar component.
* Use the editor rather than slots for command, focused etc.
* disable icons based on editor.can
* Show menubar as long as submenus are open.
  When opening a submenu of the menubar
  keep track of the open menu even for the image and the remaining action menu.
  Also refocus the editor whenever a submenu is closed.

*MenuBubble*

Let tippy handle the positioning

Tippy is really good at positioning the menu bubble.
Remove all our workarounds and let it do its thing.

In order for this to work the content of the MenuBubble
actually needs to live inside the tippy-content.

Tippy bases its calculations on the width of tippy-content.
So if we have the content hanging in a separate div
with absolute positioning
tippy-content will be 0x0 px and not represent the actual width
of the menu bubble.

*Upgrade image node and ImageView.*

Quite a bit of the syntax changed.
We now need a wrapping `<node-view-wrapper>` element.
Pretty good docs at https://tiptap.dev/guide/node-views/vue#render-a-vue-component

We also need to handle the async action.
It will run the action on it's own.
So in `clickIcon()` we need to test if the action returned anything.

Tiptap v1 had inline images.
v2 keeps them outside of paragraphs by default.
Configure Image node to use inline images as markdownit creates inline images right now.

*Trailing Node*

Tiptap v2 does not ship the trailing node extension anymore.
Included the one from the demos and turned it from typescript into javascript.

*Tests*

In order to isolate some problems tests were added.
The tests in Undeline.spec.js were green right from the beginning.
They are not related to the fix and only helped isolate the problem.

Also introduced a cypress test for Lists
that tests the editor
without rendering the page and logging in.
It is very fast and fairly easy to write.

*Refactorings*

* Split marks into separate files.

Signed-off-by: Max <max@nextcloud.com>
2022-02-09 09:42:41 +01:00
Julien Veyssier d1d27f88df
don't open the viewer before deleting the user in images cypress tests
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
2022-02-07 13:25:37 +01:00
Max 05cc17102f
handle __ as underline when loading markdown files
Signed-off-by: Max <max@nextcloud.com>
2022-01-24 12:35:20 +01:00
Azul 9a07509183
fix: 2020 let heading menu overflow workspace
* roll back parts of #1903 that broke it again.
* Calculate top of menububble based on scrollHeight of content-wrapper.
* Always display menububble below selected line.
  This will make it less likely to conflict with the menubar
  or mobile copy and paste toolbars.
* Add cypress tests for the workspace.

Signed-off-by: Azul <azul@riseup.net>
2022-01-13 14:23:07 +01:00
Julien Veyssier f7706ff00b
factorize image upload cypress tests
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
2022-01-10 17:50:38 +01:00
Julien Veyssier 4e83f339af
refs #2049 do a proper image check with file name returned in request response
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
2022-01-07 15:48:04 +01:00
Julien Veyssier ef37bbc202
refs #2049 refactor cypress image tests
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
2022-01-07 14:39:39 +01:00
Julien Veyssier 6a338dbfd3
refs #2049 add cypress test for local image upload
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
2022-01-07 12:58:10 +01:00
Julien Veyssier de69b33a26
refs #2049 add deleteUser command
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
2022-01-07 11:38:00 +01:00
Julien Veyssier 0e74b10dd0
refs #2049 cypress test: insert image from link
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
2022-01-07 10:53:14 +01:00
Julien Veyssier 3f1813437a
refs #2049 cypress test: insert image from files
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
2022-01-07 10:53:00 +01:00
Azul 02cfe27808 cypress: inspect the viewer in one test
Open the test.md file once and then check all the things.

Signed-off-by: Azul <azul@riseup.net>
2021-12-30 16:15:12 +01:00
Azul 1e5259bdf7 fix: cypress login with new session feature
Use the new session feature to create and reuse sessions:
https://docs.cypress.io/api/commands/session

The first time `login` with a given name is called
the steps described in the login function are performed
and cookies and localstorage are cached.

The next time `login` is called with the same name
cookies and localStorage are restored and used again.

This allows us to keep fast test runs
while still separating the tests more cleanly.

The old logout command was broken because of the way
we used `Cypress.Cookies.defaults({ preserve })` before:

Cypress runs all the `cy.*` commands during initialization
and builds a list of commands that are then executed during the tests.
However `Cypress.Cookies.defaults` is evaluated when preparing the list
not while performing the actual steps.

Signed-off-by: Azul <azul@riseup.net>
2021-12-30 16:12:24 +01:00
Azul ee2f2d0386 fix: more robust script to run cypress locally
* Use `BASH_SOURCE` rather than `PWD` to retrieve `CYPRESS_DIR`
  independently of where the script was called from.
* Ensure docker-compose is called inside the `CYPRESS_DIR`.
* Respect `CYPRESS_baseUrl` when set in environment.
* Check if server is already running at `CYPRESS_baseUrl`
  before starting one with `docker-compose`
* Exit if the server does not start,
  even if `docker-compose logs` also fails.

Signed-off-by: Azul <azul@riseup.net>
2021-12-30 13:35:26 +01:00
Julius Härtl 44f29af359
Avoid failing tests due to page reload conditions causing exceptions
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2021-10-25 09:41:52 +02:00
Azul 6112b7257a
fix: cypress icon close selector
The markup of the close icon has changed.

See f7bcfd0464
for a similar fix to the viewer itself.

Signed-off-by: Azul <azul@riseup.net>
2021-08-02 10:48:05 +02:00
Julius Härtl ab11643a52
Remove incompatible cypress plugin
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2021-07-14 14:54:44 +02:00
Julius Härtl ed7c054c9d
Merge pull request #1306 from nextcloud/azul/fix/cypress
cypress: use master branch of nextcloud server
2020-12-28 12:47:22 +01:00
Azul 32ec0a2204 cypress: use master branch of nextcloud server
The `bugfix/noid/initial-stte-cspv3` branch has been merged into master in
https://github.com/nextcloud/server/pull/22636 .

It does not exist anymore which will cause issues when trying to run the cypress tests.

Remove the `$BRANCH` environment variable from the docker-compose.yml.
2020-12-26 18:39:49 +01:00
Julius Härtl 4163a2d459
Properly check for nonexisting viewer
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-12-22 09:35:55 +01:00
Julius Härtl d475172309
Attempt to fix flaky cypress tests
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-11-17 11:11:44 +01:00
Julius Härtl 9ebd8eaced
Remove extra wait
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-11-17 09:30:29 +01:00
Julius Härtl 13d9bce480
Wait for file list
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-11-17 09:01:10 +01:00
Julius Härtl 776afefc88
Viewer now has a different action icon
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-11-17 09:01:10 +01:00
Julius Härtl c341aa215b
Adjust viewer id
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-11-17 09:01:10 +01:00
Julius Härtl baa900546c
Fix sidebar checkbox selector
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-11-17 09:01:10 +01:00
Julius Härtl 35c26dd5e4
Use bugfix branch on server
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-11-17 09:01:10 +01:00
Julius Härtl eaf6af7f8b
Fix preserve cookie parameter
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-11-17 09:01:10 +01:00
Julius Härtl bddf1750d2
Fix sidebar tests
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-08-11 10:57:26 +02:00
Julius Härtl c4e0754f5c
Fix cypress branch
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-07-10 08:05:22 +02:00