Skip to content

Commit

Permalink
fix(datadirect-puppeteer): Authenticated.fork() to new page
Browse files Browse the repository at this point in the history
  • Loading branch information
battis committed Jan 3, 2025
1 parent b41bc90 commit 169fd96
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,9 @@ export class Authenticated extends Base {
return await new Authenticated(this.page).ready();
}

public async fork(
path: URL | string,
timeout = Authenticated.DefaultTimeout
) {
public async fork(path: URL | string) {
await this.ready();
const url = await this.url();
const fork = await this.clone();
const ready = await fork.authenticating.acquire();
await fork.goto(new URL(path, url));
await fork.appLoaded(timeout, ready);
return fork;
const base = await super.fork(path);
return await new Authenticated(base.page).ready();
}
}
2 changes: 1 addition & 1 deletion packages/datadirect-puppeteer/src/PuppeteerSession/Base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class Base {

public async clone() {
await this.ready();
return new Base(this.page);
return await new Base(this.page).ready();
}

public async fork(path: URL | string) {
Expand Down

0 comments on commit 169fd96

Please sign in to comment.