Skip to content

Commit

Permalink
test: update to open a sample view (#12943)
Browse files Browse the repository at this point in the history
* test: update to open a sample view

* test: update to create outlook add in
  • Loading branch information
hellyzh authored Dec 19, 2024
1 parent 24cc1df commit 4a44746
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
11 changes: 7 additions & 4 deletions packages/tests/src/ui-test/treeview/treeview-invalidname.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
} from "../../utils/vscodeOperation";
import { it } from "../../utils/it";
import * as os from "os";
import { RetryHandler } from "../../utils/retryHandler";

describe("New project Tests", function () {
this.timeout(Timeout.testCase);
Expand Down Expand Up @@ -47,10 +48,12 @@ describe("New project Tests", function () {
},
async function () {
const driver = VSBrowser.instance.driver;
await execCommandIfExist(
CommandPaletteCommands.CreateProjectCommand,
Timeout.webView
);
await RetryHandler.retry(async () => {
await execCommandIfExist(
CommandPaletteCommands.CreateProjectCommand,
Timeout.webView
);
});
const input = await InputBox.create();
// if exist click it
await input.selectQuickPick(CreateProjectQuestion.Tab);
Expand Down
11 changes: 7 additions & 4 deletions packages/tests/src/ui-test/treeview/treeview-samples.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { cleanUpLocalProject } from "../../utils/cleanHelper";
import { it } from "../../utils/it";
import { assert } from "chai";
import { join } from "path";
import { RetryHandler } from "../../utils/retryHandler";

describe("Create sample project and open sample view to download sample Tests", function () {
this.timeout(Timeout.testCase);
Expand Down Expand Up @@ -59,10 +60,12 @@ describe("Create sample project and open sample view to download sample Tests",
console.log("close editor tab");
await new EditorView().closeAllEditors();
console.log("open new sample tab from tree view");
await execCommandIfExist(
CommandPaletteCommands.SamplesCommand,
Timeout.webView
);
await RetryHandler.retry(async () => {
await execCommandIfExist(
CommandPaletteCommands.SamplesCommand,
Timeout.webView
);
});
const webView = new WebView();
console.log("find title");
await driver.sleep(Timeout.webView);
Expand Down
4 changes: 2 additions & 2 deletions packages/tests/src/utils/vscodeOperation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -801,15 +801,15 @@ export async function createNewProject(
}
case "addin": {
await input.selectQuickPick(CreateProjectQuestion.OfficeAddin);
await input.selectQuickPick("Taskpane");
await input.selectQuickPick("Task pane");
await driver.sleep(Timeout.input);
break;
}
case "importaddin": {
const importPath: string =
testRootFolder + "\\..\\src\\ui-test\\treeview\\office-xml-addin";
await input.selectQuickPick(CreateProjectQuestion.OfficeAddin);
await input.selectQuickPick("Import an Existing Outlook Add-in");
await input.selectQuickPick("Import an Existing Outlook Add-ins");

console.log("choose import path: ", importPath);
await input.selectQuickPick("Browse...");
Expand Down

0 comments on commit 4a44746

Please sign in to comment.