Skip to content

Commit

Permalink
frontend tests: increase default timeout for loading notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
fonsp committed Oct 22, 2023
1 parent bc4726f commit 487755a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion test/frontend/__tests__/published_to_js.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe("published_to_js", () => {
})

it("Should correctly show published_to_js in cell output, and in logs", async () => {
await importNotebook(page, "published_to_js.jl")
await importNotebook(page, "published_to_js.jl", { timeout: 120 * 1000 })

let output_of_published = await page.evaluate(() => {
return document.querySelector("#to_cell_output")?.textContent
Expand Down
8 changes: 4 additions & 4 deletions test/frontend/helpers/pluto.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,19 @@ export const createNewNotebook = async (page) => {
* @param {Page} page
* @param {string} notebookName`
*/
export const importNotebook = async (page, notebookName, { permissionToRunCode = true } = {}) => {
export const importNotebook = async (page, notebookName, { permissionToRunCode = true, timeout = 60000 } = {}) => {
// Copy notebook before using it, so we don't mess it up with test changes
const notebookPath = getFixtureNotebookPath(notebookName)
const artifactsPath = getTemporaryNotebookPath()
fs.copyFileSync(notebookPath, artifactsPath)
await openPathOrURLNotebook(page, artifactsPath, { permissionToRunCode })
await openPathOrURLNotebook(page, artifactsPath, { permissionToRunCode, timeout })
}

/**
* @param {Page} page
* @param {string} path_or_url
*/
export const openPathOrURLNotebook = async (page, path_or_url, { permissionToRunCode = true } = {}) => {
export const openPathOrURLNotebook = async (page, path_or_url, { permissionToRunCode = true, timeout = 60000 } = {}) => {
await page.waitForFunction(() => document.querySelector(`.not_yet_ready`) == null)

const openFileInputSelector = "pluto-filepicker"
Expand All @@ -113,7 +113,7 @@ export const openPathOrURLNotebook = async (page, path_or_url, { permissionToRun
// Give permission to run code in this notebook
if (permissionToRunCode) await restartProcess(page)
await page.waitForTimeout(1000)
await waitForPlutoToCalmDown(page)
await waitForPlutoToCalmDown(page, { polling: "raf", timeout })
}

/**
Expand Down

0 comments on commit 487755a

Please sign in to comment.