Skip to content

Commit 2ac6291

Browse files
committed
fix UI test failures
Signed-off-by: Morgan Chang <shin19991207@gmail.com>
1 parent be19e0e commit 2ac6291

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

test/ui-test/autocompletionTest.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ export function autocompletionTest(): void {
4343

4444
after(async function () {
4545
this.timeout(5000);
46-
await editor.save();
46+
if (editor) {
47+
await editor.save();
48+
}
4749
await new EditorView().closeAllEditors();
4850
deleteFileInHomeDir(yamlFileName);
4951
});

test/ui-test/util/utility.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export async function createCustomFile(path: string): Promise<TextEditor> {
1515
await input.confirm();
1616
await input.confirm();
1717
const editor = new TextEditor();
18-
editor.save();
18+
await editor.save();
1919
input = await InputBox.create();
2020
await input.setText(path);
2121
await input.confirm();
@@ -34,7 +34,9 @@ export function deleteFileInHomeDir(filename: string): void {
3434
}
3535

3636
export async function getSchemaLabel(text: string): Promise<WebElement | undefined> {
37-
const schemalabel = await new StatusBar().findElements(By.xpath('.//a[@aria-label="' + text + ', Select JSON Schemas"]'));
37+
const schemalabel = await new StatusBar().findElements(
38+
By.xpath('.//a[contains(@aria-label, "' + text + '") and contains(@aria-label, "Select JSON Schema")]')
39+
);
3840
return schemalabel[0];
3941
}
4042

0 commit comments

Comments
 (0)