diff --git a/packages/tests/src/ui-test/localdebug/localdebug-tab-regen-appid.test.ts b/packages/tests/src/ui-test/localdebug/localdebug-tab-regen-appid.test.ts index 292d4c013c..59ebead040 100644 --- a/packages/tests/src/ui-test/localdebug/localdebug-tab-regen-appid.test.ts +++ b/packages/tests/src/ui-test/localdebug/localdebug-tab-regen-appid.test.ts @@ -6,6 +6,7 @@ */ import * as path from "path"; import { + clearNotifications, startDebugging, stopDebugging, waitForTerminal, @@ -72,9 +73,11 @@ describe("Local Debug Tests", function () { await cleanAppStudio(localDebugTestContext.appName); - await startDebugging(DebugItemSelect.DebugInTeamsUsingChrome); + await driver.sleep(Timeout.shortTimeLoading); try { + await clearNotifications(); + await startDebugging(DebugItemSelect.DebugInTeamsUsingChrome); await waitForTerminal( LocalDebugTaskLabel.StartApplication, "restify listening to" @@ -86,23 +89,29 @@ describe("Local Debug Tests", function () { "restify listening to" ); } catch { - const dialog = new ModalDialog(); - console.log(`click "Cancel" button for error dialog`); - await dialog.pushButton("Cancel"); - await driver.sleep(Timeout.shortTimeLoading); - console.log( - `Clicked button "Cancel" for failing to attach to main target` - ); - await stopDebugging(); - await driver.sleep(Timeout.stopdebugging); + try { + console.log(`Try to click "Cancel" button for error dialog`); + const dialog = new ModalDialog(); + await dialog.pushButton("Cancel"); + await driver.sleep(Timeout.shortTimeLoading); + console.log( + `Clicked button "Cancel" for failing to attach to main target` + ); + await stopDebugging(); + await driver.sleep(Timeout.stopdebugging); + } catch { + console.log(`No error for failing to attach to main target`); + } + try { await killPort(53000); console.log(`close port 53000 successfully`); } catch (error) { console.log(`close port 53000 failed`); } - await startDebugging(DebugItemSelect.DebugInTeamsUsingChrome); + try { + await startDebugging(DebugItemSelect.DebugInTeamsUsingChrome); await waitForTerminal( LocalDebugTaskLabel.StartApplication, "restify listening to" @@ -114,8 +123,8 @@ describe("Local Debug Tests", function () { "restify listening to" ); } catch { + console.log(`Try to click "Debug Anyway" button for error dialog`); const dialog = new ModalDialog(); - console.log(`click "Debug Anyway" button for error dialog`); await dialog.pushButton("Debug Anyway"); console.log(`Clicked button "Debug Anyway"`); await driver.sleep(Timeout.shortTimeLoading);