Skip to content

Commit 002f63c

Browse files
committed
Merge branch 'main' into rework-with-lib
2 parents 692c748 + 84300bd commit 002f63c

File tree

14 files changed

+1541
-4
lines changed

14 files changed

+1541
-4
lines changed

.bleep

Lines changed: 0 additions & 1 deletion
This file was deleted.

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export async function launchTest(options) {
139139

140140
export default function browserAgent() {
141141
program
142-
.name('browser-agent')
142+
.name('telescope')
143143
.description('Cross-browser synthetic testing agent')
144144
.requiredOption('-u, --url <url>', 'URL to run tests against')
145145
.addOption(

lib/testRunner.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,16 @@ class TestRunner {
162162
* Triggers the navigation based on the passed in url, grabs a screenshot, and closes the context and browser
163163
*/
164164
async doNavigation() {
165-
await this.page.goto(this.testURL, { waitUntil: 'networkidle' });
165+
try {
166+
await this.page.goto(this.testURL, { waitUntil: 'networkidle' });
167+
} catch (err) {
168+
// If navigation timed out, set the context offline and continue.
169+
if (err && (err.name === 'TimeoutError' || /Timeout/.test(err.message))) {
170+
await this.page.context().setOffline(true);
171+
} else {
172+
throw err;
173+
}
174+
}
166175
// grab our screenshot
167176
await this.page.screenshot({
168177
path: this.paths['results'] + '/screenshot.png',
@@ -496,7 +505,6 @@ class TestRunner {
496505
const config = readFileSync(configFileName, 'utf8').toString();
497506
return { folder: folder.name, config: JSON.parse(config) };
498507
} catch (err) {
499-
console.error(`Failed to parse ${configFileName}:`, err);
500508
return null;
501509
}
502510
})

0 commit comments

Comments
 (0)