-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add open extension list method
- Loading branch information
Ivan_Chen
committed
Jun 17, 2024
1 parent
4f7e958
commit f50a13f
Showing
2 changed files
with
62 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]> | ||
*/ | ||
|
@@ -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); | ||
|
@@ -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( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]> | ||
*/ | ||
|
@@ -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); | ||
|
@@ -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( | ||
|