Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

editor.getText() fails in headless mode #125

Open
haberdashPI opened this issue Jun 26, 2024 · 1 comment
Open

editor.getText() fails in headless mode #125

haberdashPI opened this issue Jun 26, 2024 · 1 comment
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@haberdashPI
Copy link

haberdashPI commented Jun 26, 2024

In one of my tests, I'm trying to evaluate the impact of a command on the contents of a text document. Right now I just have some console.log statements peppered throughout the test so I can debug what's going on:

        const workbench = await browser.getWorkbench();
        const editorView = await workbench.getEditorView();
        const tab = await editorView.getActiveTab();
        const editor = await editorView.openEditor(await tab?.getTitle()!) as TextEditor;
        console.log("[DEBUG]: "+(await editor.getTitle()));

When I'm using a headless browser (as follows) I get an empty string for the above [DEBUG] statement:

        "goog:chromeOptions": {
            args: ['headless'],
        },

Commenting out the args: ['headless'] command causes console.log to print out the expected file contents.

@christian-bromann
Copy link
Contributor

Thanks for reporting. I wonder if we could enhance the getTitle method to also check for html content if getText returns an empty string. I think I've seen similar issues with Chrome Headless and getting visible text elsewhere. Any help investigating this issue or possible fix are appreciated.

@christian-bromann christian-bromann added bug Something isn't working help wanted Extra attention is needed labels Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants