Skip to content

Commit

Permalink
test: wait for debug to stop (#12525)
Browse files Browse the repository at this point in the history
  • Loading branch information
hellyzh authored Oct 16, 2024
1 parent ade4e13 commit f0d320c
Showing 1 changed file with 21 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/
import * as path from "path";
import {
clearNotifications,
startDebugging,
stopDebugging,
waitForTerminal,
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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);
Expand Down

0 comments on commit f0d320c

Please sign in to comment.