-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* test: add ui test cases --------- Co-authored-by: v-ivanchen_microsoft <[email protected]>
- Loading branch information
1 parent
9dac42e
commit 36ed5f5
Showing
6 changed files
with
209 additions
and
5 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
28 changes: 28 additions & 0 deletions
28
packages/tests/src/ui-test/samples/sample-remotedebug-bot-sso.test.ts
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
/** | ||
* @author Ivan Chen <[email protected]> | ||
*/ | ||
|
||
import { Page } from "playwright"; | ||
import { TemplateProject } from "../../utils/constants"; | ||
import { validateBot } from "../../utils/playwrightOperation"; | ||
import { CaseFactory } from "./sampleCaseFactory"; | ||
import { Env } from "../../utils/env"; | ||
|
||
class BotSSOTestCase extends CaseFactory { | ||
override async onValidate(page: Page): Promise<void> { | ||
return await validateBot(page, { | ||
botCommand: "show", | ||
expected: Env.displayName, | ||
}); | ||
} | ||
} | ||
|
||
new BotSSOTestCase( | ||
TemplateProject.HelloWorldBotSSO, | ||
14571876, | ||
"[email protected]", | ||
"dev" | ||
).test(); |
48 changes: 48 additions & 0 deletions
48
packages/tests/src/ui-test/samples/sample-remotedebug-react-retail-dashboard.test.ts
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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
/** | ||
* @author Ivan Chen <[email protected]> | ||
*/ | ||
|
||
import { TemplateProject } from "../../utils/constants"; | ||
import { CaseFactory } from "./sampleCaseFactory"; | ||
import { Page } from "playwright"; | ||
import { initTeamsPage } from "../../utils/playwrightOperation"; | ||
import { SampledebugContext } from "./sampledebugContext"; | ||
import { Env } from "../../utils/env"; | ||
|
||
class RetailDashboardTestCase extends CaseFactory { | ||
public override async onInitPage( | ||
sampledebugContext: SampledebugContext, | ||
teamsAppId: string, | ||
options?: { | ||
teamsAppName: string; | ||
type: string; | ||
} | ||
): Promise<Page> { | ||
return await initTeamsPage( | ||
sampledebugContext.context!, | ||
teamsAppId, | ||
Env.username, | ||
Env.password, | ||
{ | ||
teamsAppName: options?.teamsAppName, | ||
type: options?.type, | ||
} | ||
); | ||
} | ||
} | ||
|
||
new RetailDashboardTestCase( | ||
TemplateProject.RetailDashboard, | ||
25051150, | ||
"[email protected]", | ||
"dev", | ||
[], | ||
{ | ||
teamsAppName: "react-retail-dashboard-dev", | ||
type: "spfx", | ||
skipValidation: true, | ||
} | ||
).test(); |
48 changes: 48 additions & 0 deletions
48
packages/tests/src/ui-test/samples/sample-remotedebug-spfx-productivity-dashboard.test.ts
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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
/** | ||
* @author Ivan Chen <[email protected]> | ||
*/ | ||
|
||
import { Page } from "playwright"; | ||
import { TemplateProject, LocalDebugTaskLabel } from "../../utils/constants"; | ||
import { initTeamsPage } from "../../utils/playwrightOperation"; | ||
import { CaseFactory } from "./sampleCaseFactory"; | ||
import { SampledebugContext } from "./sampledebugContext"; | ||
import { Env } from "../../utils/env"; | ||
|
||
class SpfxProductivityTestCase extends CaseFactory { | ||
public override async onInitPage( | ||
sampledebugContext: SampledebugContext, | ||
teamsAppId: string, | ||
options?: { | ||
teamsAppName: string; | ||
type: string; | ||
} | ||
): Promise<Page> { | ||
return await initTeamsPage( | ||
sampledebugContext.context!, | ||
teamsAppId, | ||
Env.username, | ||
Env.password, | ||
{ | ||
teamsAppName: options?.teamsAppName, | ||
type: options?.type, | ||
} | ||
); | ||
} | ||
} | ||
|
||
new SpfxProductivityTestCase( | ||
TemplateProject.SpfxProductivity, | ||
24753065, | ||
"[email protected]", | ||
"local", | ||
[LocalDebugTaskLabel.GulpServe], | ||
{ | ||
teamsAppName: "SPFx productivity dashboard", | ||
type: "spfx", | ||
skipValidation: true, | ||
} | ||
).test(); |
27 changes: 27 additions & 0 deletions
27
packages/tests/src/ui-test/samples/sample-remotedebug-sso-tab-via-apim-proxy.test.ts
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
/** | ||
* @author Ivan Chen <[email protected]> | ||
*/ | ||
|
||
import { Page } from "playwright"; | ||
import { TemplateProject } from "../../utils/constants"; | ||
import { validateTabApim } from "../../utils/playwrightOperation"; | ||
import { CaseFactory } from "./sampleCaseFactory"; | ||
import { Env } from "../../utils/env"; | ||
|
||
class SsotabApimTestCase extends CaseFactory { | ||
override async onValidate(page: Page): Promise<void> { | ||
return await validateTabApim(page, { | ||
displayName: Env.displayName, | ||
}); | ||
} | ||
} | ||
|
||
new SsotabApimTestCase( | ||
TemplateProject.TabSSOApimProxy, | ||
25191534, | ||
"[email protected]", | ||
"dev" | ||
).test(); |
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