diff --git a/develop/setup/Makefile b/develop/setup/Makefile index 45d710f0a7..6928108bc5 100644 --- a/develop/setup/Makefile +++ b/develop/setup/Makefile @@ -18,11 +18,6 @@ WEBAPPS_FLAGS := # PRODUCT_VERSION=9.4.0 make web-apps-dev PRODUCT_VERSION ?= $(shell cat $(EO_DEV)/VERSION) -# Pass SKIP_MOBILE=1 to skip framework7-react mobile builds (~50s saved). -# Useful when iterating on desktop editor JS/CSS only. -# SKIP_MOBILE=1 make web-apps-dev -SKIP_MOBILE ?= 0 - CHECK_WEBAPPS_DEPS = @test -d $(EO_DEV)/web-apps/build/node_modules || { echo "Run 'make web-apps' first to install dependencies"; exit 1; } # Dev-friendly cache flush: regenerate nginx cache tag and reload, without @@ -62,7 +57,6 @@ web-apps: cd $(EO_DEV)/web-apps/build && \ npm ci && \ BUILD_ROOT=$(EO_ROOT) PRODUCT_VERSION=$(PRODUCT_VERSION) THEME=euro-office \ - SKIP_MOBILE=$(SKIP_MOBILE) \ node scripts/build-pipeline.js $(FLUSH_CACHE) @@ -72,7 +66,6 @@ web-apps-dev: python3 merge_and_check.py && \ cd $(EO_DEV)/web-apps/build && \ BUILD_ROOT=$(EO_ROOT) PRODUCT_VERSION=$(PRODUCT_VERSION) THEME=euro-office \ - SKIP_MOBILE=$(SKIP_MOBILE) \ node scripts/build-pipeline.js $(FLUSH_CACHE) diff --git a/e2e/tests/mobile-editor.spec.ts b/e2e/tests/mobile-editor.spec.ts new file mode 100644 index 0000000000..f0625ea501 --- /dev/null +++ b/e2e/tests/mobile-editor.spec.ts @@ -0,0 +1,45 @@ +import { test, expect } from '@playwright/test'; + +// Canvas id differs by engine: doc/presentation/pdf use #id_viewer, spreadsheet #ws-canvas. +// Visio excluded: create-new has no blank vsdx template (fileExt=vsdx 500s). The build-time +// verify-deploy.mjs check still gates the visio mobile bundle. +const MOBILE_EDITOR_TYPES = [ + { label: 'Document', fileExt: 'docx', canvasSelector: '#id_viewer' }, + { label: 'Spreadsheet', fileExt: 'xlsx', canvasSelector: '#ws-canvas' }, + { label: 'Presentation', fileExt: 'pptx', canvasSelector: '#id_viewer' }, + { label: 'PDF form', fileExt: 'pdf', canvasSelector: '#id_viewer' }, +] as const; + +// Fatal errors surface as an f7 dialog or, for LoadingScriptError, a notification — check both. +// See apps/*/mobile/src/controller/Error.jsx. +const ERROR_SURFACE_SELECTOR = '.dialog.modal-in, .notification.modal-in'; + +// Remit: verify the mobile build is present and actually renders a document (the #258 class of +// failure). Infra faults such as an unresponsive docservice channel are out of scope — the app +// can go false-ready over a dead channel; see cm-findings/DocumentServer/pr-262-ws-hang-false-pass.md. +test.describe('Mobile editor smoke', () => { + test.use({ viewport: { width: 414, height: 896 } }); + + for (const editor of MOBILE_EDITOR_TYPES) { + test(`${editor.label} mobile editor loads`, async ({ page }) => { + // ?type=mobile forces the mobile bundle (bypasses UA sniffing in nodejs/app.js). + await page.goto(`/example/editor?fileExt=${editor.fileExt}&type=mobile`); + + const editorIframe = page.locator('iframe[name="frameEditor"]'); + await expect(editorIframe).toBeAttached({ timeout: 15_000 }); + await expect(editorIframe).toHaveAttribute('src', /type=mobile/); + + // The real "document loaded" signal is the loading skeleton clearing, not the canvas: + // .doc-placeholder (uniform across editors) shows while !isDocReady and is removed when + // the doc loads — the mobile analog of the desktop suite's #loading-mask. #id_viewer alone + // mounts with the SDK bundle before any document loads, so it can't tell "loaded" apart + // from "never loaded". Assert the skeleton appears, then clears, then the shell is clean. + const frame = page.frameLocator('iframe[name="frameEditor"]'); + const placeholder = frame.locator('.doc-placeholder'); + await expect(placeholder.first()).toBeVisible({ timeout: 15_000 }); + await expect(placeholder).toHaveCount(0, { timeout: 30_000 }); + await expect(frame.locator(ERROR_SURFACE_SELECTOR)).toHaveCount(0, { timeout: 5_000 }); + await expect(frame.locator(editor.canvasSelector)).toBeVisible({ timeout: 5_000 }); + }); + } +}); diff --git a/web-apps b/web-apps index be0c7c0eae..04b95b159e 160000 --- a/web-apps +++ b/web-apps @@ -1 +1 @@ -Subproject commit be0c7c0eae6e5ec90894b4d41019070e6a9a7af2 +Subproject commit 04b95b159e34e117dd4e630b6b733119115d836d