Skip to content

Commit

Permalink
fix(leadfoot): webdriver fixes for IE and Firefox
Browse files Browse the repository at this point in the history
- Hardcode usesWebDriverTimeouts and brokenZeroTimeout for IE11
- Handle 422 'Invalid command' responses from Firefox on BrowserStack
  • Loading branch information
jason0x43 committed Aug 16, 2020
1 parent c77a865 commit 1ee3cdc
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 29 deletions.
58 changes: 29 additions & 29 deletions packages/leadfoot/docs/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -19346,7 +19346,7 @@
"sources": [
{
"fileName": "packages/leadfoot/src/Server.ts",
"line": 423,
"line": 435,
"character": 15
}
]
Expand Down Expand Up @@ -19464,7 +19464,7 @@
"sources": [
{
"fileName": "packages/leadfoot/src/Server.ts",
"line": 393,
"line": 405,
"character": 8
}
]
Expand Down Expand Up @@ -19519,7 +19519,7 @@
"sources": [
{
"fileName": "packages/leadfoot/src/Server.ts",
"line": 2072,
"line": 2092,
"character": 15
}
]
Expand Down Expand Up @@ -19637,7 +19637,7 @@
"sources": [
{
"fileName": "packages/leadfoot/src/Server.ts",
"line": 375,
"line": 387,
"character": 5
}
]
Expand Down Expand Up @@ -19693,7 +19693,7 @@
"sources": [
{
"fileName": "packages/leadfoot/src/Server.ts",
"line": 2065,
"line": 2085,
"character": 24
}
]
Expand Down Expand Up @@ -19737,7 +19737,7 @@
"sources": [
{
"fileName": "packages/leadfoot/src/Server.ts",
"line": 2039,
"line": 2059,
"character": 13
}
]
Expand Down Expand Up @@ -19778,7 +19778,7 @@
"sources": [
{
"fileName": "packages/leadfoot/src/Server.ts",
"line": 408,
"line": 420,
"character": 11
}
]
Expand Down Expand Up @@ -19896,7 +19896,7 @@
"sources": [
{
"fileName": "packages/leadfoot/src/Server.ts",
"line": 384,
"line": 396,
"character": 6
}
]
Expand Down Expand Up @@ -19959,7 +19959,7 @@
"sources": [
{
"fileName": "packages/leadfoot/src/Server.ts",
"line": 2237,
"line": 2257,
"character": 6
}
],
Expand All @@ -19977,7 +19977,7 @@
"sources": [
{
"fileName": "packages/leadfoot/src/Server.ts",
"line": 2236,
"line": 2256,
"character": 10
}
],
Expand All @@ -20000,7 +20000,7 @@
"sources": [
{
"fileName": "packages/leadfoot/src/Server.ts",
"line": 2235,
"line": 2255,
"character": 22
}
]
Expand Down Expand Up @@ -20043,7 +20043,7 @@
"sources": [
{
"fileName": "packages/leadfoot/src/Server.ts",
"line": 2077,
"line": 2097,
"character": 51
}
],
Expand All @@ -20065,7 +20065,7 @@
"sources": [
{
"fileName": "packages/leadfoot/src/Server.ts",
"line": 2077,
"line": 2097,
"character": 60
}
],
Expand All @@ -20087,7 +20087,7 @@
"sources": [
{
"fileName": "packages/leadfoot/src/Server.ts",
"line": 2077,
"line": 2097,
"character": 52
}
]
Expand All @@ -20103,7 +20103,7 @@
"sources": [
{
"fileName": "packages/leadfoot/src/Server.ts",
"line": 2077,
"line": 2097,
"character": 35
}
],
Expand All @@ -20126,7 +20126,7 @@
"sources": [
{
"fileName": "packages/leadfoot/src/Server.ts",
"line": 2077,
"line": 2097,
"character": 28
}
]
Expand All @@ -20143,7 +20143,7 @@
"sources": [
{
"fileName": "packages/leadfoot/src/Server.ts",
"line": 2077,
"line": 2097,
"character": 21
}
]
Expand Down Expand Up @@ -20184,7 +20184,7 @@
"sources": [
{
"fileName": "packages/leadfoot/src/Server.ts",
"line": 2105,
"line": 2125,
"character": 18
}
]
Expand Down Expand Up @@ -20225,7 +20225,7 @@
"sources": [
{
"fileName": "packages/leadfoot/src/Server.ts",
"line": 2110,
"line": 2130,
"character": 26
}
]
Expand Down Expand Up @@ -20310,7 +20310,7 @@
"sources": [
{
"fileName": "packages/leadfoot/src/Server.ts",
"line": 2115,
"line": 2135,
"character": 17
}
]
Expand Down Expand Up @@ -20403,7 +20403,7 @@
"sources": [
{
"fileName": "packages/leadfoot/src/Server.ts",
"line": 2180,
"line": 2200,
"character": 25
}
]
Expand Down Expand Up @@ -20496,7 +20496,7 @@
"sources": [
{
"fileName": "packages/leadfoot/src/Server.ts",
"line": 2154,
"line": 2174,
"character": 34
}
]
Expand Down Expand Up @@ -20537,7 +20537,7 @@
"sources": [
{
"fileName": "packages/leadfoot/src/Server.ts",
"line": 2127,
"line": 2147,
"character": 14
}
]
Expand Down Expand Up @@ -20578,7 +20578,7 @@
"sources": [
{
"fileName": "packages/leadfoot/src/Server.ts",
"line": 2132,
"line": 2152,
"character": 14
}
]
Expand Down Expand Up @@ -20671,7 +20671,7 @@
"sources": [
{
"fileName": "packages/leadfoot/src/Server.ts",
"line": 2141,
"line": 2161,
"character": 24
}
]
Expand Down Expand Up @@ -20764,7 +20764,7 @@
"sources": [
{
"fileName": "packages/leadfoot/src/Server.ts",
"line": 2167,
"line": 2187,
"character": 24
}
]
Expand Down Expand Up @@ -20852,7 +20852,7 @@
"sources": [
{
"fileName": "packages/leadfoot/src/Server.ts",
"line": 2198,
"line": 2218,
"character": 23
}
]
Expand All @@ -20879,7 +20879,7 @@
"sources": [
{
"fileName": "packages/leadfoot/src/Server.ts",
"line": 2223,
"line": 2243,
"character": 13
}
]
Expand Down Expand Up @@ -20926,7 +20926,7 @@
"sources": [
{
"fileName": "packages/leadfoot/src/Server.ts",
"line": 2231,
"line": 2251,
"character": 20
}
]
Expand Down
20 changes: 20 additions & 0 deletions packages/leadfoot/src/Server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,18 @@ export default class Server {
data.status = 9;
}

// At least BrowserStack in Aug 2020 responds with HTTP 422
// and a message value of "Invalid Command" for at least
// some unknown commands. These errors are more properly
// represented to end-users using the Selenium status
// UnknownCommand, so we make the appropriate coercion here
if (
response.status === 422 &&
data.value?.message === 'Invalid Command'
) {
data.status = 9;
}

// At least FirefoxDriver 2.40.0 responds with HTTP status
// codes other than Not Implemented and a Selenium status
// UnknownError for commands that are not implemented;
Expand Down Expand Up @@ -792,6 +804,14 @@ export default class Server {
// At least IE11 will hang during this check, although option
// selection does work with it
updates.brokenOptionSelect = false;

// At least IE11 will fail this feature test because it only supports
// the POST endpoint for timeouts
updates.usesWebDriverTimeouts = true;

// At least IE11 will fail this feature test because it only supports
// the POST endpoint for timeouts
updates.brokenZeroTimeout = true;
}

// It is not possible to test this since the feature tests runs in
Expand Down

0 comments on commit 1ee3cdc

Please sign in to comment.