Skip to content

Add tests to distinguish editor vs viewer #57

@donquixote

Description

@donquixote

Hello @hfiguiere
I would like to add more tests that verify that the embedded editor works.
To do this, I need to distinguish readonly vs edit, using selenium javascript.

You can see examples of this here, https://github.com/CollaboraOnline/collabora-drupal/blob/main/tests/src/ExistingSiteJavascript/CollaboraIntegrationTest.php#L38

What I found so far when opening in a regular browser:

  • There is an element with id="document-container".
  • In readonly mode, this element has a "readonly" class, and no "notebookbar-active" class.
  • In edit mode, this element has a "notebookbar-active" class, and no "readonly" class.

However, for some reason, in a test, the 'readonly' class won't go away when I open in edit mode, even though the "notebookbar-active" class does appear.

Is there a more reliable way to make this distinction?
Ideally a way that appears immediately on page load, without too much waiting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions