Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: wait for debug to stop #12525

Merged
merged 1 commit into from
Oct 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading