-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #621 from GuillaumeGomez/wait-for-text
Add `wait-for-text-false` command
- Loading branch information
Showing
38 changed files
with
1,096 additions
and
4 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
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
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,51 @@ | ||
instructions = [ | ||
"""const timeLimit = page.getDefaultTimeout(); | ||
const timeAdd = 50; | ||
let allTime = 0; | ||
let assertSize = null; | ||
while (true) { | ||
while (true) { | ||
assertSize = await page.$$(\"a\"); | ||
if (assertSize.length !== 0) { | ||
assertSize = assertSize[0]; | ||
break; | ||
} | ||
await new Promise(r => setTimeout(r, timeAdd)); | ||
if (timeLimit === 0) { | ||
continue; | ||
} | ||
allTime += timeAdd; | ||
if (allTime >= timeLimit) { | ||
throw new Error(\"The CSS selector \\\"a\\\" was not found\"); | ||
} | ||
} | ||
async function checkElemSize(elem) { | ||
return await elem.evaluate(e => { | ||
const innerErrors = []; | ||
const height = e.offsetHeight; | ||
const width = e.offsetWidth; | ||
return innerErrors; | ||
}); | ||
} | ||
const errors = []; | ||
errors.push(...await checkElemSize(assertSize)); | ||
if (errors.length !== 0) { | ||
break; | ||
} | ||
await new Promise(r => setTimeout(r, timeAdd)); | ||
if (timeLimit === 0) { | ||
continue; | ||
} | ||
allTime += timeAdd; | ||
if (allTime >= timeLimit) { | ||
const err = errors.join(\", \"); | ||
throw new Error(\"All checks still pass\"); | ||
} | ||
}""", | ||
] | ||
wait = false | ||
warnings = [ | ||
] | ||
checkResult = 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
instructions = [ | ||
"""const timeLimit = page.getDefaultTimeout(); | ||
const timeAdd = 50; | ||
let allTime = 0; | ||
let assertSize = null; | ||
while (true) { | ||
while (true) { | ||
assertSize = await page.$$(\"a\"); | ||
if (assertSize.length !== 0) { | ||
assertSize = assertSize[0]; | ||
break; | ||
} | ||
await new Promise(r => setTimeout(r, timeAdd)); | ||
if (timeLimit === 0) { | ||
continue; | ||
} | ||
allTime += timeAdd; | ||
if (allTime >= timeLimit) { | ||
throw new Error(\"The CSS selector \\\"a\\\" was not found\"); | ||
} | ||
} | ||
async function checkElemSize(elem) { | ||
return await elem.evaluate(e => { | ||
const innerErrors = []; | ||
const height = e.offsetHeight; | ||
const width = e.offsetWidth; | ||
if (width !== 1) { | ||
innerErrors.push(\"expected a width of `1`, found `\" + width + \"`\"); | ||
} | ||
return innerErrors; | ||
}); | ||
} | ||
const errors = []; | ||
errors.push(...await checkElemSize(assertSize)); | ||
if (errors.length !== 0) { | ||
break; | ||
} | ||
await new Promise(r => setTimeout(r, timeAdd)); | ||
if (timeLimit === 0) { | ||
continue; | ||
} | ||
allTime += timeAdd; | ||
if (allTime >= timeLimit) { | ||
const err = errors.join(\", \"); | ||
throw new Error(\"All checks still pass\"); | ||
} | ||
}""", | ||
] | ||
wait = false | ||
warnings = [ | ||
] | ||
checkResult = 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
instructions = [ | ||
"""const timeLimit = page.getDefaultTimeout(); | ||
const timeAdd = 50; | ||
let allTime = 0; | ||
let assertSize = null; | ||
while (true) { | ||
while (true) { | ||
assertSize = await page.$$(\"a\"); | ||
if (assertSize.length !== 0) { | ||
break; | ||
} | ||
await new Promise(r => setTimeout(r, timeAdd)); | ||
if (timeLimit === 0) { | ||
continue; | ||
} | ||
allTime += timeAdd; | ||
if (allTime >= timeLimit) { | ||
throw new Error(\"The CSS selector \\\"a\\\" was not found\"); | ||
} | ||
} | ||
async function checkElemSize(elem) { | ||
return await elem.evaluate(e => { | ||
const innerErrors = []; | ||
const height = e.offsetHeight; | ||
const width = e.offsetWidth; | ||
if (width !== 1) { | ||
innerErrors.push(\"expected a width of `1`, found `\" + width + \"`\"); | ||
} | ||
return innerErrors; | ||
}); | ||
} | ||
const errors = []; | ||
for (const elem of assertSize) { | ||
errors.push(...await checkElemSize(elem)); | ||
if (errors.length !== 0) { | ||
break; | ||
} | ||
} | ||
if (errors.length !== 0) { | ||
break; | ||
} | ||
await new Promise(r => setTimeout(r, timeAdd)); | ||
if (timeLimit === 0) { | ||
continue; | ||
} | ||
allTime += timeAdd; | ||
if (allTime >= timeLimit) { | ||
const err = errors.join(\", \"); | ||
throw new Error(\"All checks still pass\"); | ||
} | ||
}""", | ||
] | ||
wait = false | ||
warnings = [ | ||
] | ||
checkResult = 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
instructions = [ | ||
"""const timeLimit = page.getDefaultTimeout(); | ||
const timeAdd = 50; | ||
let allTime = 0; | ||
let assertSize = null; | ||
while (true) { | ||
while (true) { | ||
assertSize = await page.$$(\"a\"); | ||
if (assertSize.length !== 0) { | ||
assertSize = assertSize[0]; | ||
break; | ||
} | ||
await new Promise(r => setTimeout(r, timeAdd)); | ||
if (timeLimit === 0) { | ||
continue; | ||
} | ||
allTime += timeAdd; | ||
if (allTime >= timeLimit) { | ||
throw new Error(\"The CSS selector \\\"a\\\" was not found\"); | ||
} | ||
} | ||
async function checkElemSize(elem) { | ||
return await elem.evaluate(e => { | ||
const innerErrors = []; | ||
const height = e.offsetHeight; | ||
const width = e.offsetWidth; | ||
if (height !== 1) { | ||
innerErrors.push(\"expected a height of `1`, found `\" + height + \"`\"); | ||
} | ||
return innerErrors; | ||
}); | ||
} | ||
const errors = []; | ||
errors.push(...await checkElemSize(assertSize)); | ||
if (errors.length !== 0) { | ||
break; | ||
} | ||
await new Promise(r => setTimeout(r, timeAdd)); | ||
if (timeLimit === 0) { | ||
continue; | ||
} | ||
allTime += timeAdd; | ||
if (allTime >= timeLimit) { | ||
const err = errors.join(\", \"); | ||
throw new Error(\"All checks still pass\"); | ||
} | ||
}""", | ||
] | ||
wait = false | ||
warnings = [ | ||
] | ||
checkResult = 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
instructions = [ | ||
"""const timeLimit = page.getDefaultTimeout(); | ||
const timeAdd = 50; | ||
let allTime = 0; | ||
let assertSize = null; | ||
while (true) { | ||
while (true) { | ||
assertSize = await page.$$(\"a\"); | ||
if (assertSize.length !== 0) { | ||
break; | ||
} | ||
await new Promise(r => setTimeout(r, timeAdd)); | ||
if (timeLimit === 0) { | ||
continue; | ||
} | ||
allTime += timeAdd; | ||
if (allTime >= timeLimit) { | ||
throw new Error(\"The CSS selector \\\"a\\\" was not found\"); | ||
} | ||
} | ||
async function checkElemSize(elem) { | ||
return await elem.evaluate(e => { | ||
const innerErrors = []; | ||
const height = e.offsetHeight; | ||
const width = e.offsetWidth; | ||
if (height !== 1) { | ||
innerErrors.push(\"expected a height of `1`, found `\" + height + \"`\"); | ||
} | ||
return innerErrors; | ||
}); | ||
} | ||
const errors = []; | ||
for (const elem of assertSize) { | ||
errors.push(...await checkElemSize(elem)); | ||
if (errors.length !== 0) { | ||
break; | ||
} | ||
} | ||
if (errors.length !== 0) { | ||
break; | ||
} | ||
await new Promise(r => setTimeout(r, timeAdd)); | ||
if (timeLimit === 0) { | ||
continue; | ||
} | ||
allTime += timeAdd; | ||
if (allTime >= timeLimit) { | ||
const err = errors.join(\", \"); | ||
throw new Error(\"All checks still pass\"); | ||
} | ||
}""", | ||
] | ||
wait = false | ||
warnings = [ | ||
] | ||
checkResult = 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
error = """expected a JSON dict, found `\"b\"` (a string) (second element of the tuple)""" |
Oops, something went wrong.