Skip to content

Commit 7533ed4

Browse files
committed
test: fix for selenium
1 parent 3ef2bc2 commit 7533ed4

File tree

4 files changed

+38
-62
lines changed

4 files changed

+38
-62
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"babel-jest": "^24.8.0",
5252
"babel-plugin-dynamic-import-node": "^2.3.0",
5353
"browserstack-local": "^1.4.0",
54-
"chromedriver": "^75.1.0",
54+
"chromedriver": "^73.0.0",
5555
"codecov": "^3.5.0",
5656
"eslint": "^6.0.1",
5757
"eslint-config-standard": "^13.0.1",

src/webpage.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ export default class Webpage {
101101
function (selector, fn, args) {
102102
var el = document.querySelector(selector)
103103
if (!el) {
104-
return undefined
104+
// undefined would be better but selenium returns null for undefined
105+
return null
105106
}
106107

107108
return (new (Function.bind.apply(Function, fn))()).apply(null, [el].concat(args))

test/e2e/basic.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ describe(browserString, () => {
240240
})
241241

242242
test('Doesnt fail on non-existing elements', async () => {
243-
await expect(page.getText('.non-existing-element-class')).resolves.toBeUndefined()
243+
await expect(page.getText('.non-existing-element-class')).resolves.toBeNull()
244244
await expect(page.getTexts('.non-existing-element-class')).resolves.toEqual([])
245245
})
246246

yarn.lock

Lines changed: 34 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,20 +1017,6 @@
10171017
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f"
10181018
integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==
10191019

1020-
"@types/events@*":
1021-
version "3.0.0"
1022-
resolved "https://registry.yarnpkg.com/@types/events/-/events-3.0.0.tgz#2862f3f58a9a7f7c3e78d79f130dd4d71c25c2a7"
1023-
integrity sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==
1024-
1025-
"@types/glob@^7.1.1":
1026-
version "7.1.1"
1027-
resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.1.tgz#aa59a1c6e3fbc421e07ccd31a944c30eba521575"
1028-
integrity sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w==
1029-
dependencies:
1030-
"@types/events" "*"
1031-
"@types/minimatch" "*"
1032-
"@types/node" "*"
1033-
10341020
"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0":
10351021
version "2.0.1"
10361022
resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz#42995b446db9a48a11a07ec083499a860e9138ff"
@@ -1051,11 +1037,6 @@
10511037
"@types/istanbul-lib-coverage" "*"
10521038
"@types/istanbul-lib-report" "*"
10531039

1054-
"@types/minimatch@*":
1055-
version "3.0.3"
1056-
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d"
1057-
integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==
1058-
10591040
"@types/node@*":
10601041
version "11.11.3"
10611042
resolved "https://registry.yarnpkg.com/@types/node/-/node-11.11.3.tgz#7c6b0f8eaf16ae530795de2ad1b85d34bf2f5c58"
@@ -1733,12 +1714,12 @@ chownr@^1.0.1, chownr@^1.1.1:
17331714
resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.1.tgz#54726b8b8fff4df053c42187e801fb4412df1494"
17341715
integrity sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==
17351716

1736-
chromedriver@^75.1.0:
1737-
version "75.1.0"
1738-
resolved "https://registry.yarnpkg.com/chromedriver/-/chromedriver-75.1.0.tgz#edfef5d7a9b16b6f8a12ddb58cbac76ae52732fd"
1739-
integrity sha512-N2P0fg6FS4c+tTG0R7cCOD5qiVo+E6uAz6xVjmbZesYv1xs1iGdcCUo0IqOY+ppD/4OOObG+XWV1CFWXT6UIgA==
1717+
chromedriver@^73.0.0:
1718+
version "73.0.0"
1719+
resolved "https://registry.yarnpkg.com/chromedriver/-/chromedriver-73.0.0.tgz#1bb987c82735d0bc08eb179ea0792462f2e7eaf3"
1720+
integrity sha512-RnZOTgAa3prPmA1QDHtrsEhppDGiosND5O/0ukWwGuU+EglCBHvYl1x3Mh/YypMIkmydRyq50XPrNYZadsM6rQ==
17401721
dependencies:
1741-
del "^4.1.1"
1722+
del "^3.0.0"
17421723
extract-zip "^1.6.7"
17431724
mkdirp "^0.5.1"
17441725
request "^2.88.0"
@@ -2250,18 +2231,17 @@ define-property@^2.0.2:
22502231
is-descriptor "^1.0.2"
22512232
isobject "^3.0.1"
22522233

2253-
del@^4.1.1:
2254-
version "4.1.1"
2255-
resolved "https://registry.yarnpkg.com/del/-/del-4.1.1.tgz#9e8f117222ea44a31ff3a156c049b99052a9f0b4"
2256-
integrity sha512-QwGuEUouP2kVwQenAsOof5Fv8K9t3D8Ca8NxcXKrIpEHjTXK5J2nXLdP+ALI1cgv8wj7KuwBhTwBkOZSJKM5XQ==
2234+
del@^3.0.0:
2235+
version "3.0.0"
2236+
resolved "https://registry.yarnpkg.com/del/-/del-3.0.0.tgz#53ecf699ffcbcb39637691ab13baf160819766e5"
2237+
integrity sha1-U+z2mf/LyzljdpGrE7rxYIGXZuU=
22572238
dependencies:
2258-
"@types/glob" "^7.1.1"
22592239
globby "^6.1.0"
2260-
is-path-cwd "^2.0.0"
2261-
is-path-in-cwd "^2.0.0"
2262-
p-map "^2.0.0"
2263-
pify "^4.0.1"
2264-
rimraf "^2.6.3"
2240+
is-path-cwd "^1.0.0"
2241+
is-path-in-cwd "^1.0.0"
2242+
p-map "^1.1.1"
2243+
pify "^3.0.0"
2244+
rimraf "^2.2.8"
22652245

22662246
delayed-stream@~1.0.0:
22672247
version "1.0.0"
@@ -3554,24 +3534,24 @@ is-obj@^1.0.0:
35543534
resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f"
35553535
integrity sha1-PkcprB9f3gJc19g6iW2rn09n2w8=
35563536

3557-
is-path-cwd@^2.0.0:
3558-
version "2.2.0"
3559-
resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-2.2.0.tgz#67d43b82664a7b5191fd9119127eb300048a9fdb"
3560-
integrity sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ==
3537+
is-path-cwd@^1.0.0:
3538+
version "1.0.0"
3539+
resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d"
3540+
integrity sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=
35613541

3562-
is-path-in-cwd@^2.0.0:
3563-
version "2.1.0"
3564-
resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-2.1.0.tgz#bfe2dca26c69f397265a4009963602935a053acb"
3565-
integrity sha512-rNocXHgipO+rvnP6dk3zI20RpOtrAM/kzbB258Uw5BWr3TpXi861yzjo16Dn4hUox07iw5AyeMLHWsujkjzvRQ==
3542+
is-path-in-cwd@^1.0.0:
3543+
version "1.0.1"
3544+
resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz#5ac48b345ef675339bd6c7a48a912110b241cf52"
3545+
integrity sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==
35663546
dependencies:
3567-
is-path-inside "^2.1.0"
3547+
is-path-inside "^1.0.0"
35683548

3569-
is-path-inside@^2.1.0:
3570-
version "2.1.0"
3571-
resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-2.1.0.tgz#7c9810587d659a40d27bcdb4d5616eab059494b2"
3572-
integrity sha512-wiyhTzfDWsvwAW53OBWF5zuvaOGlZ6PwYxAbPVDhpm+gM09xKQGjBq/8uYN12aDvMxnAnq3dxTyoSoRNmg5YFg==
3549+
is-path-inside@^1.0.0:
3550+
version "1.0.1"
3551+
resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.1.tgz#8ef5b7de50437a3fdca6b4e865ef7aa55cb48036"
3552+
integrity sha1-jvW33lBDej/cprToZe96pVy0gDY=
35733553
dependencies:
3574-
path-is-inside "^1.0.2"
3554+
path-is-inside "^1.0.1"
35753555

35763556
is-plain-obj@^1.0.0, is-plain-obj@^1.1.0:
35773557
version "1.1.0"
@@ -4984,10 +4964,10 @@ p-locate@^3.0.0:
49844964
dependencies:
49854965
p-limit "^2.0.0"
49864966

4987-
p-map@^2.0.0:
4988-
version "2.1.0"
4989-
resolved "https://registry.yarnpkg.com/p-map/-/p-map-2.1.0.tgz#310928feef9c9ecc65b68b17693018a665cea175"
4990-
integrity sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==
4967+
p-map@^1.1.1:
4968+
version "1.2.0"
4969+
resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.2.0.tgz#e4e94f311eabbc8633a1e79908165fca26241b6b"
4970+
integrity sha512-r6zKACMNhjPJMTl8KcFH4li//gkrXWfbD6feV8l6doRHlzljFWGJ2AP6iKaCJXyZmAUMOPtvbW7EXkbWO/pLEA==
49914971

49924972
p-reduce@^1.0.0:
49934973
version "1.0.0"
@@ -5073,7 +5053,7 @@ path-is-absolute@^1.0.0, path-is-absolute@^1.0.1:
50735053
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
50745054
integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18=
50755055

5076-
path-is-inside@^1.0.2:
5056+
path-is-inside@^1.0.1:
50775057
version "1.0.2"
50785058
resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53"
50795059
integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=
@@ -5138,11 +5118,6 @@ pify@^3.0.0:
51385118
resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176"
51395119
integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=
51405120

5141-
pify@^4.0.1:
5142-
version "4.0.1"
5143-
resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231"
5144-
integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==
5145-
51465121
pinkie-promise@^2.0.0:
51475122
version "2.0.1"
51485123
resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa"
@@ -5645,7 +5620,7 @@ ret@~0.1.10:
56455620
resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc"
56465621
integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==
56475622

5648-
rimraf@2.6.3, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2.6.3:
5623+
rimraf@2.6.3, rimraf@^2.2.8, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2.6.3:
56495624
version "2.6.3"
56505625
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab"
56515626
integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==

0 commit comments

Comments
 (0)