diff --git a/browser_tests/tests/mobileViewport.spec.ts b/browser_tests/tests/mobileViewport.spec.ts new file mode 100644 index 000000000..925bdacac --- /dev/null +++ b/browser_tests/tests/mobileViewport.spec.ts @@ -0,0 +1,35 @@ +import { expect } from '@playwright/test' + +import { comfyPageFixture as test } from '../fixtures/ComfyPage' + +test.describe('Mobile viewport', () => { + test.beforeEach(async ({ comfyPage }) => { + await comfyPage.setSetting('Comfy.UseNewMenu', 'Top') + }) + + test('@mobile App UI is not hidden under mobile browser UI', async ({ + comfyPage + }) => { + const viewportSize = await comfyPage.page.viewportSize() + + // Top menu is visible + const topMenu = comfyPage.page.locator('.comfyui-menu') + await expect(topMenu).toBeVisible() + + // Top menu is not cut off from the tpo + const topMenuBox = await topMenu.boundingBox() + expect(topMenuBox?.y).toBeGreaterThanOrEqual(0) + + // Graph is visible + const graphView = comfyPage.page.locator('.lgraphcanvas') + await expect(graphView).toBeVisible() + + // Graph is not cut off from the bottom + const graphViewBox = await graphView.boundingBox() + expect(graphViewBox).not.toBeNull() + expect(viewportSize).not.toBeNull() + expect(graphViewBox!.y + graphViewBox!.height).toBeLessThanOrEqual( + viewportSize!.height + ) + }) +}) diff --git a/eslint.config.js b/eslint.config.js index 2b8b77f3c..38500e1d7 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -13,7 +13,8 @@ export default [ ignores: [ 'src/scripts/*', 'src/extensions/core/*', - 'src/types/vue-shim.d.ts' + 'src/types/vue-shim.d.ts', + 'browser_tests/**/*' ] }, { diff --git a/tsconfig.json b/tsconfig.json index 592a2ba6d..aacf1d99d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -35,6 +35,7 @@ "src/**/*.vue", "src/types/**/*.d.ts", "tests-ui/**/*", - "global.d.ts" + "global.d.ts", + "eslint.config.js" ] }