Skip to content

Commit

Permalink
test: add open extension list method
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan_Chen committed Jun 17, 2024
1 parent 4f7e958 commit f50a13f
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

/**
* @author Kuojian Lu <[email protected]>
*/
Expand All @@ -9,10 +12,15 @@ import {
validateReactTab,
} from "../../utils/playwrightOperation";
import { LocalDebugTestContext } from "./localdebugContext";
import { Timeout, LocalDebugTaskLabel } from "../../utils/constants";
import {
Timeout,
LocalDebugTaskLabel,
LocalDebugError,
} from "../../utils/constants";
import { Env } from "../../utils/env";
import { it } from "../../utils/it";
import { validateFileExist } from "../../utils/commonUtils";
import { expect } from "chai";

describe("Local Debug M365 Tests", function () {
this.timeout(Timeout.testCase);
Expand Down Expand Up @@ -47,15 +55,29 @@ describe("Local Debug M365 Tests", function () {

await startDebugging("Debug in Teams (Chrome)");

await waitForTerminal(
LocalDebugTaskLabel.StartBackend,
"Worker process started and initialized"
);
try {
await waitForTerminal(
LocalDebugTaskLabel.StartBackend,
"Worker process started and initialized"
);

await waitForTerminal(
LocalDebugTaskLabel.StartFrontend,
"Compiled successfully!"
);
await waitForTerminal(
LocalDebugTaskLabel.StartFrontend,
"Compiled successfully!"
);
} catch (error) {
const errorMsg = error.toString();
if (
// skip can't find element
errorMsg.includes(LocalDebugError.ElementNotInteractableError) ||
// skip timeout
errorMsg.includes(LocalDebugError.TimeoutError)
) {
console.log("[skip error] ", error);
} else {
expect.fail(errorMsg);
}
}

const teamsAppId = await localDebugTestContext.getTeamsAppId();
const page = await initPage(
Expand Down
40 changes: 31 additions & 9 deletions packages/tests/src/ui-test/localdebug/localdebug-obo-tab.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

/**
* @author Kuojian Lu <[email protected]>
*/
Expand All @@ -9,10 +12,15 @@ import {
validateReactTab,
} from "../../utils/playwrightOperation";
import { LocalDebugTestContext } from "./localdebugContext";
import { Timeout, LocalDebugTaskLabel } from "../../utils/constants";
import {
Timeout,
LocalDebugTaskLabel,
LocalDebugError,
} from "../../utils/constants";
import { Env } from "../../utils/env";
import { it } from "../../utils/it";
import { validateFileExist } from "../../utils/commonUtils";
import { expect } from "chai";

describe("Local Debug M365 Tests", function () {
this.timeout(Timeout.testCase);
Expand Down Expand Up @@ -47,15 +55,29 @@ describe("Local Debug M365 Tests", function () {

await startDebugging("Debug in Teams (Chrome)");

await waitForTerminal(
LocalDebugTaskLabel.StartBackend,
"Worker process started and initialized"
);
try {
await waitForTerminal(
LocalDebugTaskLabel.StartBackend,
"Worker process started and initialized"
);

await waitForTerminal(
LocalDebugTaskLabel.StartFrontend,
"Compiled successfully!"
);
await waitForTerminal(
LocalDebugTaskLabel.StartFrontend,
"Compiled successfully!"
);
} catch (error) {
const errorMsg = error.toString();
if (
// skip can't find element
errorMsg.includes(LocalDebugError.ElementNotInteractableError) ||
// skip timeout
errorMsg.includes(LocalDebugError.TimeoutError)
) {
console.log("[skip error] ", error);
} else {
expect.fail(errorMsg);
}
}

const teamsAppId = await localDebugTestContext.getTeamsAppId();
const page = await initPage(
Expand Down

0 comments on commit f50a13f

Please sign in to comment.