mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 22:23:42 +01:00
[server-pro] tests: reduce flakiness of editor tests (#23963)
- Swap order of "oldContent" and "static" (apparently that makes the
selection more reliable...)
- Turn off spellchecking outside the spellchecking test (avoid DOM
changes from added underline on misspelled words)
- Swap order of opening file and switching to doc under test:
The cy.findByText('static') was occasionally triggering an unhandled
error in codemirror when it ran while the editor was getting swapped.
(something along the lines of "cannot select out-of-dom range")
- Align source and visual editor tests, use ".findByText(oldContent)"
- Double down on waiting for doc switch to finish loading
GitOrigin-RevId: 8b201a6d78a60e3cfa92c22198f63e705d8880ec
This commit is contained in:
@@ -184,6 +184,9 @@ export function waitForMainDocToLoad() {
|
||||
export function openFile(fileName: string, waitFor: string) {
|
||||
// force: The file-tree pane is too narrow to display the full name.
|
||||
cy.findByTestId('file-tree').findByText(fileName).click({ force: true })
|
||||
|
||||
// wait until we've switched to the selected file
|
||||
cy.findByText('Loading…').should('not.exist')
|
||||
cy.findByText(waitFor)
|
||||
}
|
||||
|
||||
@@ -201,6 +204,7 @@ export function createNewFile() {
|
||||
cy.findByTestId('file-tree').findByText(fileName).click({ force: true })
|
||||
|
||||
// wait until we've switched to the newly created empty file
|
||||
cy.findByText('Loading…').should('not.exist')
|
||||
cy.get('.cm-line').should('have.length', 1)
|
||||
|
||||
return fileName
|
||||
|
||||
Reference in New Issue
Block a user