Unverified Commit 39607839 authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Stabilize error-is-clickable test (#15606)

This attempts to stabilize the `error-is-clickable` test since it has been flaking recently

Closes: https://github.com/vercel/next.js/issues/15585
parent 2c9c07f9
/* eslint-env jest */ /* eslint-env jest */
import { findPort, killApp, launchApp } from 'next-test-utils' import { findPort, killApp, launchApp, hasRedbox } from 'next-test-utils'
import webdriver from 'next-webdriver' import webdriver from 'next-webdriver'
import { join } from 'path' import { join } from 'path'
...@@ -21,14 +21,16 @@ describe('Clickable error link', () => { ...@@ -21,14 +21,16 @@ describe('Clickable error link', () => {
it('Shows error which is clickable and redirects', async () => { it('Shows error which is clickable and redirects', async () => {
const browser = await webdriver(appPort, '/first') const browser = await webdriver(appPort, '/first')
await hasRedbox(browser)
await browser.eval(`(function () { await browser.eval(`(function () {
document.querySelector("nextjs-portal") document.querySelector("nextjs-portal")
.shadowRoot .shadowRoot
.querySelector("#nextjs__container_errors_desc > a").click() .querySelector("#nextjs__container_errors_desc > a").click()
})() })()
`) `)
const url = await browser.url()
const url = await browser.url()
expect(url).toBe('https://nextjs.org/') expect(url).toBe('https://nextjs.org/')
}) })
}) })
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment