eclipse-theia / theia

Eclipse Theia is a cloud & desktop IDE framework implemented in TypeScript.
http://theia-ide.org
Eclipse Public License 2.0
20.06k stars 2.5k forks source link

Cannot open a secondary editor from a playwright test using the TheiaApp instance #13969

Open zole40 opened 3 months ago

zole40 commented 3 months ago

Bug Description:

Cannot open a secondary editor from a playwright test using the TheiaApp instance because it uses the wrong menu item label Expected label: https://github.com/eclipse-theia/theia/blob/266fa0b2a9cf2649ed9b34c8b71b786806e787b4/packages/navigator/src/browser/navigator-contribution.ts#L388 Actual label in TheiaApp: https://github.com/eclipse-theia/theia/blob/266fa0b2a9cf2649ed9b34c8b71b786806e787b4/examples/playwright/src/theia-app.ts#L126

Steps to Reproduce:

  1. Create a new playwright test
  2. Load a workspace using TheiaAppLoader
  3. Open a non text file with the Text editor
  4. It runs to a timeout

Additional Information

import {TheiaAppLoader, TheiaTextEditor, TheiaWorkspace} from "@theia/playwright";
import {test} from "@playwright/test";

test.describe('Open secondary editor', () => {
    test.beforeAll(async ({playwright, browser}) => {
        const ws = new TheiaWorkspace(['workspace']);

        const app = await TheiaAppLoader.load({playwright, browser}, ws)

        const filePath = 'test.png';
        await app.openEditor(filePath, TheiaTextEditor, 'Text Editor');
    })
    test("Check", () => {
         expect(true).toBeTruthy();
    })
});
zole40 commented 3 months ago

I tried to make a fix for it, and I realized it was only a misleading label that should be the same on both files.

The "Open with..." menu item used to have a submenu for editors, but it no longer does. Now it opens the command panel, right or did I miss something?