-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add retry to validation outlook preview
- Loading branch information
Showing
5 changed files
with
60 additions
and
21 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 |
---|---|---|
|
@@ -5,7 +5,11 @@ | |
* @author Kuojian Lu <[email protected]> | ||
*/ | ||
import * as path from "path"; | ||
import { startDebugging, waitForTerminal } from "../../utils/vscodeOperation"; | ||
import { | ||
clearNotifications, | ||
startDebugging, | ||
waitForTerminal, | ||
} from "../../utils/vscodeOperation"; | ||
import { | ||
initPage, | ||
validateReactOutlookTab, | ||
|
@@ -16,6 +20,7 @@ import { | |
Timeout, | ||
LocalDebugTaskLabel, | ||
LocalDebugError, | ||
LocalDebugTaskResult, | ||
} from "../../utils/constants"; | ||
import { Env } from "../../utils/env"; | ||
import { it } from "../../utils/it"; | ||
|
@@ -60,12 +65,12 @@ describe("Local Debug M365 Tests", function () { | |
try { | ||
await waitForTerminal( | ||
LocalDebugTaskLabel.StartBackend, | ||
"Worker process started and initialized" | ||
LocalDebugTaskResult.FunctionStarted | ||
); | ||
|
||
await clearNotifications(); | ||
await waitForTerminal( | ||
LocalDebugTaskLabel.StartFrontend, | ||
"Compiled successfully!" | ||
LocalDebugTaskResult.FrontendReady | ||
); | ||
} catch (error) { | ||
const errorMsg = error.toString(); | ||
|
@@ -91,10 +96,8 @@ describe("Local Debug M365 Tests", function () { | |
await localDebugTestContext.validateLocalStateForTab(); | ||
await validateReactTab(page, Env.displayName, true); | ||
const m365AppId = await localDebugTestContext.getM365AppId(); | ||
await page.goto( | ||
`https://outlook.office.com/host/${m365AppId}/index?login_hint=${Env.username}` | ||
); | ||
await validateReactOutlookTab(page, Env.displayName, true); | ||
const url = `https://outlook.office.com/host/${m365AppId}/index?login_hint=${Env.username}`; | ||
await validateReactOutlookTab(page, url, Env.displayName, true); | ||
} | ||
); | ||
}); |
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 |
---|---|---|
|
@@ -5,7 +5,11 @@ | |
* @author Kuojian Lu <[email protected]> | ||
*/ | ||
import * as path from "path"; | ||
import { startDebugging, waitForTerminal } from "../../utils/vscodeOperation"; | ||
import { | ||
clearNotifications, | ||
startDebugging, | ||
waitForTerminal, | ||
} from "../../utils/vscodeOperation"; | ||
import { | ||
initPage, | ||
validateReactOutlookTab, | ||
|
@@ -16,6 +20,7 @@ import { | |
Timeout, | ||
LocalDebugTaskLabel, | ||
LocalDebugError, | ||
LocalDebugTaskResult, | ||
} from "../../utils/constants"; | ||
import { Env } from "../../utils/env"; | ||
import { it } from "../../utils/it"; | ||
|
@@ -58,12 +63,12 @@ describe("Local Debug M365 Tests", function () { | |
try { | ||
await waitForTerminal( | ||
LocalDebugTaskLabel.StartBackend, | ||
"Worker process started and initialized" | ||
LocalDebugTaskResult.FunctionStarted | ||
); | ||
|
||
await clearNotifications(); | ||
await waitForTerminal( | ||
LocalDebugTaskLabel.StartFrontend, | ||
"Compiled successfully!" | ||
LocalDebugTaskResult.FrontendReady | ||
); | ||
} catch (error) { | ||
const errorMsg = error.toString(); | ||
|
@@ -89,10 +94,8 @@ describe("Local Debug M365 Tests", function () { | |
await localDebugTestContext.validateLocalStateForTab(); | ||
await validateReactTab(page, Env.displayName, true); | ||
const m365AppId = await localDebugTestContext.getM365AppId(); | ||
await page.goto( | ||
`https://outlook.office.com/host/${m365AppId}/index?login_hint=${Env.username}` | ||
); | ||
await validateReactOutlookTab(page, Env.displayName, true); | ||
const url = `https://outlook.office.com/host/${m365AppId}/index?login_hint=${Env.username}`; | ||
await validateReactOutlookTab(page, url, Env.displayName, true); | ||
} | ||
); | ||
}); |
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,10 +1,14 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
/** | ||
* @author Xiaofu Huang <[email protected]> | ||
*/ | ||
import * as path from "path"; | ||
import * as chai from "chai"; | ||
import { VSBrowser } from "vscode-extension-tester"; | ||
import { | ||
clearNotifications, | ||
getNotification, | ||
runDeployAadAppManifest, | ||
startDebugging, | ||
|
@@ -16,6 +20,8 @@ import { | |
Timeout, | ||
LocalDebugTaskLabel, | ||
DebugItemSelect, | ||
LocalDebugTaskResult, | ||
LocalDebugError, | ||
} from "../../utils/constants"; | ||
import { Env } from "../../utils/env"; | ||
import { it } from "../../utils/it"; | ||
|
@@ -54,10 +60,29 @@ describe("Local Debug Tests", function () { | |
|
||
await startDebugging(DebugItemSelect.DebugInTeamsUsingChrome); | ||
|
||
await waitForTerminal( | ||
LocalDebugTaskLabel.StartFrontend, | ||
"Compiled successfully!" | ||
); | ||
try { | ||
await waitForTerminal( | ||
LocalDebugTaskLabel.StartBackend, | ||
LocalDebugTaskResult.FunctionStarted | ||
); | ||
await clearNotifications(); | ||
await waitForTerminal( | ||
LocalDebugTaskLabel.StartFrontend, | ||
LocalDebugTaskResult.FrontendReady | ||
); | ||
} 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 { | ||
chai.expect.fail(errorMsg); | ||
} | ||
} | ||
|
||
await stopDebugging(); | ||
|
||
|
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
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