Commit graph

10 commits

Author SHA1 Message Date
libraryupgrader 702677220d build: Updating eslint-config-wikimedia to 0.28.0
The following rules are failing and were disabled:
* modules/ve-mw/tests:
  * implicit-arrow-linebreak

Change-Id: If857233c0de24c8cf619dbb1347ebb375f3ab1ba
2024-06-04 03:40:00 +00:00
daniel 1a5a52440c api-testing: Add test for switching from source to visual mode
Bug: T321862
Depends-On: Id611e6e022bf8d9d774ca1a3a214220ada713285
Change-Id: I685e4bcef9b1c398265afdf375b478643ab74cdd
2022-11-01 13:22:51 +00:00
daniel adc017f73f Pick ParsoidClient implementation based on etag.
When receiving HTML from a VE session, process it with the same kind of
ParsoidClient that was originally used to generate the HTML. If we were
to use a different implementation, the ETag wouldn't match, so we would
fail to find the stashed data-parsoid map, and the edit would fail.

Bug: T320704
Change-Id: I3b73431fccacecb4ad88b82f8f5675b1042e03ce
2022-10-20 08:52:20 +00:00
daniel 35cb550747 Local implementation of ParsoidClient (DirectParsoidClient)
* DirectParsoidClient makes use of parsoid directly for performing
transformations on both wikitext and/or HTML contents.

* Also, it's used to fetch HTML from parsoid's parser cache. Before,
this operation was done via RESTBase but now it's being fetched in
core's parsoid parser cache.

* This patch also enables VE clients to transform HTML to
Wikitext when switching from HTML to source mode on. It
makes use of the HtmlInputTransformHelper to perform this
transformation.

* Now, VE client can make use of core code for switching
between HTML to source mode and back without RESTBase.

Change-Id: I5c7cfcc4086d8da7905897194d8601aa07418b59
2022-10-11 18:34:06 +01:00
daniel 7f9573f994 api-testing: Add assertions to e2e tests
This adds assertions for the return values of the following pactions:
metadata, parse, parsefragment.

It also adds a test that asserts that edits are not possible with
an invalid token.

Change-Id: Idb453d3561a46930afb5366c1a96787895fc8e40
2022-10-04 19:36:39 +00:00
Derick Alangi 1746b76129 ApiVisualEditor: Remove parsedoc VE paction
This VE paction was removed in I90d775dd71d5f5a61d651b63d946ab60a27e2ca3
so this code can be deleted per Bartosz, so this patch removes the code.

NOTE: A merged API test that uses this is also removed along side.

Change-Id: I4ff75df57fd58f508ef7212486e52cb11a7cfb57
2022-10-03 14:12:35 +01:00
Emeka Chukwukere 2749611071
api-testing: Add more visualeditoredit e2e tests
This patch adds more tests covering the `visualeditoredit` action
API.

Change-Id: I3a20afdb4a146672e272a87eafe8203c384e3405
2022-09-30 00:16:28 +01:00
Emeka Chukwukere db6cc66749 api-testing: Add test for creating and saving a page
Testing the visualeditoredit action API for VisualEditor.

Change-Id: I951ecf1c71e2ee66e3d1fc15a29b312b8fe9956e
2022-09-29 21:23:59 +01:00
Emeka Chukwukere 5b5ed387c9 Add basic end-to-end tests for action=visualeditor
Bug: T318403
Change-Id: I7a607edc69d8fcf51a634ce0f536548979eef95b
2022-09-28 18:28:05 +02:00
daniel 1c7468191b Add api-testing script to package.json
The test file is just a placeholder for now, so we can enable the CI job.
Actual tests will follow in a separate patch.

Bug: T318403
Change-Id: I8105f49f8898c8ebfd80eb898d30a49e58db5b25
2022-09-27 13:15:39 +00:00