Skip to content

Commit

Permalink
fix: contractFieldHistory wait
Browse files Browse the repository at this point in the history
  • Loading branch information
alanjaouen committed Oct 17, 2024
1 parent cd36292 commit 43028f5
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/commands/texei/org/contractfieldhistory/fix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,20 @@ export default class Fix extends SfCommand<OrgContractFieldHistoryResult> {
headless: !(process.env.BROWSER_DEBUG === 'true'),
});
const page = await browser.newPage();
const waitForNavigationOptions: puppeteer.WaitForOptions = { waitUntil: ['domcontentloaded', 'networkidle2'] };

await page.goto(
`${instanceUrl}/secur/frontdoor.jsp?sid=${
flags['target-org'].getConnection(flags['api-version']).accessToken
}&startURL=${encodeURIComponent(POST_LOGIN_PATH)}`,
{ waitUntil: ['domcontentloaded', 'networkidle0'] }
waitForNavigationOptions
);
const navigationPromise = page.waitForNavigation();

this.debug('DEBUG Opening Contract Field History Tracking page');
await page.goto(`${instanceUrl}/ui/setup/layout/FieldHistoryTracking?pEntity=Contract`);
await navigationPromise;
await page.goto(`${instanceUrl}/ui/setup/layout/FieldHistoryTracking?pEntity=Contract`, waitForNavigationOptions);

this.debug("DEBUG Clicking 'Save' button");
await page.click('table > tbody > tr > #topButtonRow > .btn:nth-child(1)');
await navigationPromise;
await page.waitForNavigation(waitForNavigationOptions);

this.debug('DEBUG Closing browser');
await browser.close();
Expand Down

0 comments on commit 43028f5

Please sign in to comment.