Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
a8b39889
Unverified
Commit
a8b39889
authored
Feb 20, 2020
by
JJ Kasper
Committed by
GitHub
Feb 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update legacy safari test for GitHub actions (#10618)
parent
3cd45bc3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
20 deletions
+12
-20
index.test.js
test/integration/production-nav/test/index.test.js
+6
-8
jest-environment.js
test/jest-environment.js
+5
-1
next-webdriver.js
test/lib/next-webdriver.js
+1
-11
No files found.
test/integration/production-nav/test/index.test.js
View file @
a8b39889
/* eslint-env jest */
/* global jasmine */
import
{
nextBuild
,
findPort
,
nextStart
,
killApp
,
waitFor
,
}
from
'next-test-utils'
import
{
nextBuild
,
nextStart
,
killApp
,
waitFor
}
from
'next-test-utils'
import
getPort
from
'get-port'
import
webdriver
from
'next-webdriver'
import
{
join
}
from
'path'
...
...
@@ -18,7 +13,10 @@ jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 1
describe
(
'Production Usage'
,
()
=>
{
beforeAll
(
async
()
=>
{
await
nextBuild
(
appDir
)
appPort
=
await
findPort
()
// use compatible port: https://www.browserstack.com/question/664
appPort
=
await
getPort
({
port
:
[
8080
,
8081
,
8888
,
8899
],
})
app
=
await
nextStart
(
appDir
,
appPort
)
})
afterAll
(()
=>
killApp
(
app
))
...
...
test/jest-environment.js
View file @
a8b39889
...
...
@@ -76,7 +76,11 @@ class CustomEnvironment extends NodeEnvironment {
this
.
server
.
close
()
}
if
(
this
.
global
.
wd
)
{
await
this
.
global
.
wd
.
quit
()
try
{
await
this
.
global
.
wd
.
quit
()
}
catch
(
err
)
{
console
.
log
(
`Failed to quit webdriver instance`
,
err
)
}
}
// must come after wd.quit()
if
(
this
.
seleniumServer
)
{
...
...
test/lib/next-webdriver.js
View file @
a8b39889
...
...
@@ -105,16 +105,6 @@ let browser = new Builder()
global
.
wd
=
browser
/*
# Methods to match
- elementByCss
- elementsByCss
- waitForElementByCss
- elementByCss.text
- elementByCss.click
*/
let
initialWindow
let
deviceIP
=
'localhost'
...
...
@@ -166,7 +156,7 @@ export default async (appPort, path, waitHydration = true) => {
if
(
!
initialWindow
)
{
initialWindow
=
await
browser
.
getWindowHandle
()
}
if
(
isBrowserStack
&&
deviceIP
===
'localhost'
)
{
if
(
isBrowserStack
&&
deviceIP
===
'localhost'
&&
!
LEGACY_SAFARI
)
{
await
getDeviceIP
()
}
// browser.switchTo().window() fails with `missing field `handle``
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment