-
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.
Showing
3 changed files
with
37 additions
and
2 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 |
---|---|---|
|
@@ -49,6 +49,9 @@ | |
}, | ||
"ubuntu-latest": { | ||
"node-18": [] | ||
}, | ||
"macos-latest": { | ||
"node-18": [] | ||
} | ||
}, | ||
"cases": [ | ||
|
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,9 +5,15 @@ | |
* @author Ivan Chen <[email protected]> | ||
*/ | ||
|
||
import { TemplateProject, LocalDebugTaskLabel } from "../../utils/constants"; | ||
import { Page } from "playwright"; | ||
import { | ||
TemplateProject, | ||
LocalDebugTaskLabel, | ||
ValidationContent, | ||
} from "../../utils/constants"; | ||
import { CaseFactory } from "./sampleCaseFactory"; | ||
import { SampledebugContext } from "./sampledebugContext"; | ||
import { validateWelcomeAndReplyBot } from "../../utils/playwrightOperation"; | ||
import * as path from "path"; | ||
import * as fs from "fs"; | ||
import * as os from "os"; | ||
|
@@ -27,6 +33,22 @@ class ChefBotTestCase extends CaseFactory { | |
fs.writeFileSync(envFile, OPENAI_API_KEY); | ||
console.log(`add OPENAI_API_KEY ${OPENAI_API_KEY} to .env.${env} file`); | ||
} | ||
override async onValidate(page: Page): Promise<void> { | ||
console.log("Moked api key. Only verify happy path..."); | ||
return await validateWelcomeAndReplyBot(page, { | ||
hasCommandReplyValidation: true, | ||
botCommand: "helloWorld", | ||
expectedReplyMessage: ValidationContent.AiBotErrorMessage, | ||
}); | ||
} | ||
public override async onCliValidate(page: Page): Promise<void> { | ||
console.log("Mocked api key. Only verify happy path..."); | ||
return await validateWelcomeAndReplyBot(page, { | ||
hasCommandReplyValidation: true, | ||
botCommand: "helloWorld", | ||
expectedReplyMessage: ValidationContent.AiBotErrorMessage, | ||
}); | ||
} | ||
} | ||
|
||
new ChefBotTestCase( | ||
|
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,9 +5,11 @@ | |
* @author Ivan Chen <[email protected]> | ||
*/ | ||
|
||
import { TemplateProject } from "../../utils/constants"; | ||
import { Page } from "playwright"; | ||
import { TemplateProject, ValidationContent } from "../../utils/constants"; | ||
import { CaseFactory } from "./sampleCaseFactory"; | ||
import { SampledebugContext } from "./sampledebugContext"; | ||
import { validateWelcomeAndReplyBot } from "../../utils/playwrightOperation"; | ||
import * as path from "path"; | ||
import * as fs from "fs"; | ||
import * as os from "os"; | ||
|
@@ -27,6 +29,14 @@ class ChefBotTestCase extends CaseFactory { | |
fs.writeFileSync(envFile, OPENAI_API_KEY); | ||
console.log(`add OPENAI_API_KEY ${OPENAI_API_KEY} to .env.${env} file`); | ||
} | ||
override async onValidate(page: Page): Promise<void> { | ||
console.log("Mocked api key. Only verify happy path..."); | ||
return await validateWelcomeAndReplyBot(page, { | ||
hasCommandReplyValidation: true, | ||
botCommand: "helloWorld", | ||
expectedReplyMessage: ValidationContent.AiBotErrorMessage, | ||
}); | ||
} | ||
} | ||
|
||
new ChefBotTestCase( | ||
|