Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add navigation test specific for Safari 10 (#10616)
* Add testing in Safari 10.1 on merge * Add nav test specific for Safari 10
- Loading branch information
Showing
6 changed files
with
85 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import Link from 'next/link' | ||
|
||
export default () => ( | ||
<> | ||
<Link href="/"> | ||
<a id="to-index">Index</a> | ||
</Link> | ||
</> | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import Link from 'next/link' | ||
|
||
export default () => ( | ||
<> | ||
<Link href="/another"> | ||
<a id="to-another">Another</a> | ||
</Link> | ||
</> | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* eslint-env jest */ | ||
/* global jasmine */ | ||
import { | ||
nextBuild, | ||
findPort, | ||
nextStart, | ||
killApp, | ||
waitFor, | ||
} from 'next-test-utils' | ||
import webdriver from 'next-webdriver' | ||
import { join } from 'path' | ||
|
||
const appDir = join(__dirname, '../') | ||
let appPort | ||
let app | ||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 1 | ||
|
||
describe('Production Usage', () => { | ||
beforeAll(async () => { | ||
await nextBuild(appDir) | ||
appPort = await findPort() | ||
app = await nextStart(appDir, appPort) | ||
}) | ||
afterAll(() => killApp(app)) | ||
|
||
it('should navigate forward and back correctly', async () => { | ||
const browser = await webdriver(appPort, '/') | ||
await browser.eval('window.beforeNav = true') | ||
await browser.elementByCss('#to-another').click() | ||
// waitForElement doesn't seem to work properly in safari 10 | ||
await waitFor(2000) | ||
expect(await browser.eval('window.beforeNav')).toBe(true) | ||
await browser.elementByCss('#to-index').click() | ||
await waitFor(2000) | ||
expect(await browser.eval('window.beforeNav')).toBe(true) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters