diff --git a/tests/e2e/page-objects/base_editor.ts b/tests/e2e/page-objects/base_editor.ts index 167d33fbe..e96168d98 100644 --- a/tests/e2e/page-objects/base_editor.ts +++ b/tests/e2e/page-objects/base_editor.ts @@ -1,4 +1,4 @@ -import { Page, Locator, expect, FrameLocator } from '@playwright/test' +import { Page, Locator, test, expect, FrameLocator } from '@playwright/test' import Toolbar from '../enums/toolbar' import type Equation from '../interfaces/equation' import TrackChangesOptions from '../enums/track_changes_options' @@ -507,6 +507,7 @@ export default abstract class BaseEditor extends BasePage { const equationElement = this.getEquationElement(equation) let editDivElement: Locator + const isCkeditor5Firefox = this.getName() === 'ckeditor5' && test.info().project.name === 'firefox' if (this.iframe) { editDivElement = this.page.frameLocator(this.iframe).locator(this.editField) @@ -519,11 +520,13 @@ export default abstract class BaseEditor extends BasePage { if (equationBox && editDivBox) { await this.page.mouse.move(equationBox.x + equationBox.width / 2, equationBox.y + equationBox.height / 2) - //await this.page.mouse.click(equationBox.x + equationBox.width / 2, equationBox.y + equationBox.height / 2) await this.pause(500) await this.page.mouse.down() await this.pause(500) - await this.page.mouse.move(editDivBox.x, editDivBox.y) + await this.page.mouse.move( + isCkeditor5Firefox ? editDivBox.x + 5 : editDivBox.x, + isCkeditor5Firefox ? editDivBox.y + 5 : editDivBox.y + ) await this.pause(500) await this.page.mouse.up() } diff --git a/tests/e2e/tests/editor/copy_cut_drop.spec.ts b/tests/e2e/tests/editor/copy_cut_drop.spec.ts index 293e06cf9..e8efbdfdb 100644 --- a/tests/e2e/tests/editor/copy_cut_drop.spec.ts +++ b/tests/e2e/tests/editor/copy_cut_drop.spec.ts @@ -12,7 +12,7 @@ for (const editorName of editors) { // TODO: review some flaky tests }, () => { test(`MTHTML-95 Copy-paste math formula with ${editorName} editor`, async ({ page }) => { const { editor, wirisEditor } = await setupEditor(page, editorName) - + await editor.open() await editor.clear() await editor.openWirisEditor(Toolbar.MATH) @@ -24,7 +24,7 @@ for (const editorName of editors) { // TODO: review some flaky tests await editor.copyAllEditorContent() await editor.clear() await editor.paste() - + const equationsInHTMLEditor = await editor.getEquations() const isEquationCopied = equationsInHTMLEditor.every((equation: Equation) => equation.altText === Equations.singleNumber.altText) && (equationsInHTMLEditor.length === 1) expect(isEquationCopied).toBeTruthy() @@ -32,7 +32,7 @@ for (const editorName of editors) { // TODO: review some flaky tests test(`MTHTML-96 Cut-paste math formula with ${editorName} editor`, async ({ page }) => { const { editor, wirisEditor } = await setupEditor(page, editorName) - + await editor.open() await editor.clear() await editor.openWirisEditor(Toolbar.MATH) @@ -43,22 +43,15 @@ for (const editorName of editors) { // TODO: review some flaky tests await editor.cutAllEditorContent() await editor.paste() - + const equationsInHTMLEditor = await editor.getEquations() const isEquationCut = equationsInHTMLEditor.every((equation: Equation) => equation.altText === Equations.singleNumber.altText) && (equationsInHTMLEditor.length === 1) expect(isEquationCut).toBeTruthy() }) test(`MTHTML-86 Drag-drop math formula with ${editorName} editor`, async ({ page }) => { - test.fixme((editorName === 'ckeditor5' || editorName === 'generic') && test.info().project.name === 'firefox', `Drag and drop not working for ${editorName} in Firefox`) // TODO: fix drag and drop in Firefox for ckeditor5 and generic editor - - const unsupportedEditors = ['ckeditor4', 'tinymce5', 'tinymce6', 'tinymce7', 'tinymce8'] // WIP - - // Skip test for unsupported editors - test.skip(unsupportedEditors.includes(editorName), `Drag and drop not supported for ${editorName}`) - const { editor, wirisEditor } = await setupEditor(page, editorName) - + await editor.open() await editor.clear() const textToType = 'The equation will be relocated from after this text to before it' @@ -75,4 +68,4 @@ for (const editorName of editors) { // TODO: review some flaky tests expect(isTextAfterEquation).toBeTruthy() }) }) -} \ No newline at end of file +}