-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
v-ivanchen_microsoft
committed
Nov 27, 2023
1 parent
60d3bfb
commit cb86d6c
Showing
4 changed files
with
121 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
packages/tests/src/ui-test/samples/sample-remotedebug-chef-bot.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,36 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
/** | ||
* @author Ivan Chen <[email protected]> | ||
*/ | ||
|
||
import { TemplateProject } from "../../utils/constants"; | ||
import { CaseFactory } from "./sampleCaseFactory"; | ||
import { SampledebugContext } from "./sampledebugContext"; | ||
import * as path from "path"; | ||
import * as fs from "fs"; | ||
|
||
class ChefBotTestCase extends CaseFactory { | ||
public override async onAfterCreate( | ||
sampledebugContext: SampledebugContext, | ||
env: "local" | "dev" | ||
): Promise<void> { | ||
const envFile = path.resolve( | ||
sampledebugContext.projectPath, | ||
"env", | ||
`.env.${env}` | ||
); | ||
let OPENAI_API_KEY = fs.readFileSync(envFile, "utf-8"); | ||
OPENAI_API_KEY += "\nSECRET_OPENAI_API_KEY=yourapikey"; | ||
fs.writeFileSync(envFile, OPENAI_API_KEY); | ||
console.log(`add OPENAI_API_KEY ${OPENAI_API_KEY} to .env.${env} file`); | ||
} | ||
} | ||
|
||
new ChefBotTestCase( | ||
TemplateProject.ChefBot, | ||
24409842, | ||
"[email protected]", | ||
"dev" | ||
).test(); |
20 changes: 20 additions & 0 deletions
20
packages/tests/src/ui-test/samples/sample-remotedebug-dice-roller.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,20 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
/** | ||
* @author Ivan Chen <[email protected]> | ||
*/ | ||
|
||
import { TemplateProject } from "../../utils/constants"; | ||
import { CaseFactory } from "./sampleCaseFactory"; | ||
|
||
class DiceRollerTestCase extends CaseFactory {} | ||
|
||
new DiceRollerTestCase( | ||
TemplateProject.GraphConnectorBot, | ||
24121529, | ||
"[email protected]", | ||
"dev", | ||
[], | ||
{ skipValidation: true } | ||
).test(); |
27 changes: 27 additions & 0 deletions
27
packages/tests/src/ui-test/samples/sample-remotedebug-graph-connector-bot.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, ValidationContent } from "../../utils/constants"; | ||
import { validateBot } from "../../utils/playwrightOperation"; | ||
import { CaseFactory } from "./sampleCaseFactory"; | ||
|
||
class GraphConnectorBotTestCase extends CaseFactory { | ||
override async onValidate(page: Page): Promise<void> { | ||
return await validateBot(page, { | ||
botCommand: "welcome", | ||
expected: ValidationContent.GraphBot, | ||
}); | ||
} | ||
} | ||
|
||
new GraphConnectorBotTestCase( | ||
TemplateProject.GraphConnectorBot, | ||
25960851, | ||
"[email protected]", | ||
"dev" | ||
).test(); |
38 changes: 38 additions & 0 deletions
38
packages/tests/src/ui-test/samples/sample-remotedebug-large-scale-notification.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,38 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
/** | ||
* @author Ivan Chen <[email protected]> | ||
*/ | ||
|
||
import { TemplateProject } from "../../utils/constants"; | ||
import { CaseFactory } from "./sampleCaseFactory"; | ||
import { SampledebugContext } from "./sampledebugContext"; | ||
import * as path from "path"; | ||
import * as fs from "fs"; | ||
|
||
class BotSSOTestCase extends CaseFactory { | ||
public override async onAfterCreate( | ||
sampledebugContext: SampledebugContext, | ||
env: "local" | "dev" | ||
): Promise<void> { | ||
const envFile = path.resolve( | ||
sampledebugContext.projectPath, | ||
"env", | ||
`.env.${env}` | ||
); | ||
let ENDPOINT = fs.readFileSync(envFile, "utf-8"); | ||
ENDPOINT += "\nSERVICE_BUS_QUEUE_NAME=test-service-bus"; | ||
fs.writeFileSync(envFile, ENDPOINT); | ||
console.log(`add endpoint ${ENDPOINT} to .env.${env} file`); | ||
} | ||
} | ||
|
||
new BotSSOTestCase( | ||
TemplateProject.LargeScaleBot, | ||
25960873, | ||
"[email protected]", | ||
"dev", | ||
[], | ||
{ skipInit: true } | ||
).test(); |