Skip to content

Automated e2e testing #582

@cguedes

Description

@cguedes

First Run & Project Lifecycle

  • Ensure /tmp/web-storage-url/user1/ don't exist
  • Run the application for the first time and see the welcome screen with the logo in the center
  • Open the sample project and verify you can open the existing files
  • Close sample project and see that the list or projects now contains the sample project
  • Create a new project
  • Create some files and edit their content, use shortcut; the menu action in the projects sidebar and the command palette

Editor

  • Confirm that the editor content is auto-saved
  • Verify that we can edit in markdown and use other common shortcuts to make text bold and italic
  • Verify we can have collapsible sections
  • Verify we can move blocks around
  • Verify we can enter block navigation mode by pressing ESC
  • Verify we can navigate, select, and manipulate blocks

Settings

  • Open settings modal via shortcut and icon in the left sidebar
  • Update the AI provider (to Ollama), adjust the Creativity Level and save
  • Restart RefStudio and verify that settings were saved
  • Update back to Open AI

References

  • Verify that an empty project show no references in the side panel
  • Verify that the footer shows References: 0
  • Verify that we can open references editor (table) using: click in the footer item; menu action References -> Open; shortcut cmd + R; icon in the references pane; and Command Palette "Open References";
  • Upload references using 5 methods: empty references panel; References menu; references table button; drag-and-drop PDF files; command palette
  • Verify that footer displays "References Ingestion" loading indicator, that disappear after ingestion finish; and the references counter updated to the number of PDFs added
  • Verify that ingested PDFs are listed in the project sidebar under uploads
  • Verify that ingested references are listed in the references sidebar
  • Verify that clicking on a reference open the reference details page
  • Verify that we can click the pencil to edit: citation key, title, and DOI
  • Verify that clicking on the PDF icon, in the reference details, will open the PDF
  • Verify that ingested references are listed in the references table
  • Verify that we can edit cells in the table to edit references metadata: citation key, title, published date, and authors
  • Verify that we can open the reference details page, from the references table
  • Verify that we can open the reference PDF, from the references table
  • Open a file and type [ to trigger the references popup with all the ingested references, select one
  • Type @ inside a citation element to trigger the references popup to add an additional reference
  • Type extra text (ex: , page 2) inside the citation. You should have something similar to [@domingos; @sculley, page 2]
  • Open Semantic Scholar (S2) Modal using 4 methods: empty references panel; References menu; references table button; command palette
  • Verify that adding a reference with a PDF correctly adds it and that you can open the pdf from the explorer and from the reference view (An Introduction to Machine Learning, from M. Kubát, has a valid PDF)
  • Verify that adding a reference without a PDF correctly adds it
  • Verify that adding a reference then clicking on remove, correctly removes it

Export

  • Verify that exporting references (from the reference panel) creates and opens a references.bib file with all references in the exports directory
  • Verify that exporting references from the references table button exports selected references in references.bib in the exports directory and opens it
  • Verify that saving a file without citation in markdown (from the command palette or from the File menu) creates and opens a markdown file in the exports directory
  • Verify that saving a file with citation in markdown creates a markdown file and a bib file, both in exports directory; the markdown should automatically be opened

Rewriter

  • Open a file and select some text, then open the rewrite panel and see the "Text Selection" contains the selected text
  • Open a file and select some text, then choose "Rewrite Selection...` and see that the rewrite panel opens with the "Text Selection" containing the selected text
  • Confirm that the Rewriter Speech Type and Creativity Level default to the settings values
  • Confirm we can adjust Speech Type and Creativity Level
  • (with Open AI and an empty API Key) press Rewrite and see that an error message pop
  • (with Open AI and a valid API Key) press Rewrite and see the first variation of 3 available, move between variations using > and <
  • Ask for a rewrite, and press Insert to replace the selected text in the editor, or to insert at the cursor without a selection
  • Ask for a rewrite and press the copy icon, observe that a popup with "Variant copied" was shown briefly. Verify that the content is in the system clipboard

ChatBot

  • Open the Chatbot clicking in the right sidebar 🤖 , then close by clicking again, and open using cmd + 0
  • Open the Chatbot using the command palette action Chat with References...
  • Type a question in the text area and press ENTER
  • Type a question in the text area and press Shift+ENTER to create a line break instead of asking the question
  • Verify that the chat bot response is streamed, showing text in chunks

Text Completion

  • Open a file and ensure that we have some text, put the cursor in the end of a paragraph (or anywhere else) and trigger the text completion using: command palette action; shortcut Cmd + J. Verify that ... are shown followed by the proposed text in light grey
  • Cycle between proposed options using cmd + J
  • Accept proposed text using TAB
  • Accept proposed text using
  • Accept proposed text using ENTER

IDE

  • Trigger the command palette using cmd + K
  • List files using cmd + P and open one of the files
  • Verify we can show/hide side panels using drag and shortcuts (cmd + 1, ...)
  • Verify we can adjust panel dimensions
  • Verify we can click to see notifications, and that we can clear them
  • Verify we can move editors between LEFT and RIGHT pane, via context menu and via command pallete
  • Verify we can close all open editors
  • Verify we can view the keyboard shortcuts

Local LLM

  • Install Ollama with llama2, and test the AI features

Example file content

You can use this for the tests. Copy paste and adjust styles using markdown and block navigation and edit.

Ref Studio

Motivation

Foundation model capabilities are rapidly improving and writing support systems are a promising early use case. Because foundation models are better at fluency than factuality, early experiments have focused on creative writing rather than expository, argumentative, or academic writing. Ref Studio will facilitate experimentation with factual writing support systems by providing an open source text editor that integrates foundation models and referenced document contents. 

Features

Ref Studio has three main components focused on writing, references, and AI interactions.

Writing

The writing component is supported by a text editor with basic styling with Markdown syntax, Notion-like blocks that can be collapsed, re-arranged, and display associated annotation widgets, such as cited references.

References

References play a crucial role in scientific document writing. Ref Studio offers a built-in feature for managing references. You have the option to upload your PDF references, which will be analyzed and made easily accessible to assist you throughout the writing process. Additionally, Ref Studio provides a dedicated system interface to efficiently manage your references.

AI Interactions

When editing documents you can ask AI assistance to rewrite parts of the text, and get answers using the chat. Additionally you can also ask for text completion in the editor.

Originally posted by @cguedes in #560 (comment)

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