Skip to content

Commit

Permalink
Stabilize error-is-clickable test (#15606)
Browse files Browse the repository at this point in the history
This attempts to stabilize the `error-is-clickable` test since it has been flaking recently

Closes: #15585
  • Loading branch information
ijjk authored Jul 29, 2020
1 parent 2c9c07f commit 3960783
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions test/integration/error-is-clickable/test/index.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* 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 { join } from 'path'

Expand All @@ -21,14 +21,16 @@ describe('Clickable error link', () => {
it('Shows error which is clickable and redirects', async () => {
const browser = await webdriver(appPort, '/first')

await hasRedbox(browser)

await browser.eval(`(function () {
document.querySelector("nextjs-portal")
.shadowRoot
.querySelector("#nextjs__container_errors_desc > a").click()
})()
`)
const url = await browser.url()
document.querySelector("nextjs-portal")
.shadowRoot
.querySelector("#nextjs__container_errors_desc > a").click()
})()
`)

const url = await browser.url()
expect(url).toBe('https://nextjs.org/')
})
})

0 comments on commit 3960783

Please sign in to comment.