From 1ac81fbd97fc5adef676b042b14c50e1f5cc3ee7 Mon Sep 17 00:00:00 2001 From: Ivan_Chen Date: Tue, 3 Dec 2024 16:50:40 +0800 Subject: [PATCH 1/9] test: update sample large notification case --- packages/tests/scripts/randomCases.json | 1 - .../sample-localdebug-large-scale-notification.test.ts | 7 ++++++- packages/tests/src/utils/playwrightOperation.ts | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/tests/scripts/randomCases.json b/packages/tests/scripts/randomCases.json index 5b20220478..5033f1f765 100644 --- a/packages/tests/scripts/randomCases.json +++ b/packages/tests/scripts/randomCases.json @@ -114,7 +114,6 @@ "sample-localdebug-hello-world-tab-outlook", "sample-localdebug-one-productivity-hub", "sample-localdebug-assistant-dashboard", - "sample-localdebug-large-scale-notification", "sample-localdebug-todo-list-sql", "sample-remotedebug-share-now", "sample-remotedebug-todo-list-sql", diff --git a/packages/tests/src/ui-test/samples/sample-localdebug-large-scale-notification.test.ts b/packages/tests/src/ui-test/samples/sample-localdebug-large-scale-notification.test.ts index 75049b0c4b..7732a8abf0 100644 --- a/packages/tests/src/ui-test/samples/sample-localdebug-large-scale-notification.test.ts +++ b/packages/tests/src/ui-test/samples/sample-localdebug-large-scale-notification.test.ts @@ -5,6 +5,7 @@ * @author Ivan Chen */ +// this test case diposed due to cancel local debug import { Page } from "playwright"; import { TemplateProject, LocalDebugTaskLabel } from "../../utils/constants"; import { CaseFactory } from "./sampleCaseFactory"; @@ -41,6 +42,10 @@ class LargeNotiTestCase extends CaseFactory { "env", `.env.${env}.user` ); + // create envuserfile + if (!fs.existsSync(envUserFile)) { + fs.writeFileSync(envUserFile, ""); + } let envUserFileString = fs.readFileSync(envUserFile, "utf-8"); envUserFileString += `\nSECRET_STORAGE_ACCOUNT_KEY=${process.env["STORAGE_ACCOUNT_KEY"]}`; fs.writeFileSync(envUserFile, envUserFileString); @@ -92,4 +97,4 @@ new LargeNotiTestCase( { debug: "ttk", } -).test(); +); diff --git a/packages/tests/src/utils/playwrightOperation.ts b/packages/tests/src/utils/playwrightOperation.ts index 5cd1717c8d..e0b26a3f7e 100644 --- a/packages/tests/src/utils/playwrightOperation.ts +++ b/packages/tests/src/utils/playwrightOperation.ts @@ -2728,7 +2728,7 @@ export async function validateLargeNotificationBot( console.log(e); } try { - await frame?.waitForSelector('p:has-text("Hello World")'); + await frame?.waitForSelector('p:has-text("New Event Occurred!")'); } catch (e) { throw e; } From ac95022aaab31d9eca9c837d030e86341c2db569 Mon Sep 17 00:00:00 2001 From: Ivan_Chen Date: Wed, 4 Dec 2024 09:34:24 +0800 Subject: [PATCH 2/9] test: skip warning during debug session --- packages/tests/src/ui-test/samples/sampleCaseFactory.ts | 6 +++++- packages/tests/src/utils/constants.ts | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/tests/src/ui-test/samples/sampleCaseFactory.ts b/packages/tests/src/ui-test/samples/sampleCaseFactory.ts index 6b2604598c..273726ed63 100644 --- a/packages/tests/src/ui-test/samples/sampleCaseFactory.ts +++ b/packages/tests/src/ui-test/samples/sampleCaseFactory.ts @@ -389,7 +389,11 @@ export abstract class CaseFactory { LocalDebugError.ElementNotInteractableError ) || // skip timeout - errorMsg.includes(LocalDebugError.TimeoutError) + errorMsg.includes(LocalDebugError.TimeoutError) || + // skip warning error + errorMsg.includes( + LocalDebugError.CompiledWithWarningError + ) ) { console.log("[skip error] ", error); } else { diff --git a/packages/tests/src/utils/constants.ts b/packages/tests/src/utils/constants.ts index 7a4571a377..d8c73d794f 100644 --- a/packages/tests/src/utils/constants.ts +++ b/packages/tests/src/utils/constants.ts @@ -441,6 +441,7 @@ export enum LocalDebugError { WarningError = "Warning", WarningCapError = "WARNING", DeprecatedError = "npm warn deprecated", + CompiledWithWarningError = "Compiled with warnings", } export class LocalDebugTaskInfo { From a57b6a6ba8a11f7af19939aecd015ef30099977e Mon Sep 17 00:00:00 2001 From: Ivan_Chen Date: Wed, 4 Dec 2024 10:42:39 +0800 Subject: [PATCH 3/9] test: skip warning during debug session --- .../src/ui-test/samples/sampleCaseFactory.ts | 6 +- .../tests/src/utils/playwrightOperation.ts | 78 +++++++++---------- packages/tests/src/utils/vscodeOperation.ts | 54 ++++++++++--- 3 files changed, 83 insertions(+), 55 deletions(-) diff --git a/packages/tests/src/ui-test/samples/sampleCaseFactory.ts b/packages/tests/src/ui-test/samples/sampleCaseFactory.ts index 273726ed63..6b2604598c 100644 --- a/packages/tests/src/ui-test/samples/sampleCaseFactory.ts +++ b/packages/tests/src/ui-test/samples/sampleCaseFactory.ts @@ -389,11 +389,7 @@ export abstract class CaseFactory { LocalDebugError.ElementNotInteractableError ) || // skip timeout - errorMsg.includes(LocalDebugError.TimeoutError) || - // skip warning error - errorMsg.includes( - LocalDebugError.CompiledWithWarningError - ) + errorMsg.includes(LocalDebugError.TimeoutError) ) { console.log("[skip error] ", error); } else { diff --git a/packages/tests/src/utils/playwrightOperation.ts b/packages/tests/src/utils/playwrightOperation.ts index e0b26a3f7e..993a599cad 100644 --- a/packages/tests/src/utils/playwrightOperation.ts +++ b/packages/tests/src/utils/playwrightOperation.ts @@ -2328,45 +2328,45 @@ export async function validateBasicDashboardTab(page: Page) { export async function validateDashboardTab(page: Page) { try { - await RetryHandler.retry(async () => { - console.log("Before popup"); - const popup = await page.waitForEvent("popup"); - console.log("after popup"); - if (popup && !popup?.isClosed()) { - await popup - .click('button:has-text("Reload")', { - timeout: Timeout.playwrightConsentPageReload, - }) - .catch(() => {}); - console.log("click Accept button"); - await page.waitForTimeout(Timeout.longTimeWait); - try { - // input password - console.log(`fill in password`); - await popup.fill( - "input.input[type='password'][name='passwd']", - Env.password - ); - // sign in - await Promise.all([ - popup.click("input.button[type='submit'][value='Sign in']"), - popup.waitForNavigation(), - ]); - await popup.click("input.button[type='submit'][value='Accept']"); - try { - await popup?.close(); - } catch (error) { - console.log("popup is closed"); - } - } catch (error) { - await popup.screenshot({ - path: getPlaywrightScreenshotPath("login_error"), - fullPage: true, - }); - throw error; - } - } - }); + // await RetryHandler.retry(async () => { + // console.log("Before popup"); + // const popup = await page.waitForEvent("popup"); + // console.log("after popup"); + // if (popup && !popup?.isClosed()) { + // await popup + // .click('button:has-text("Reload")', { + // timeout: Timeout.playwrightConsentPageReload, + // }) + // .catch(() => {}); + // console.log("click Accept button"); + // await page.waitForTimeout(Timeout.longTimeWait); + // try { + // // input password + // console.log(`fill in password`); + // await popup.fill( + // "input.input[type='password'][name='passwd']", + // Env.password + // ); + // // sign in + // await Promise.all([ + // popup.click("input.button[type='submit'][value='Sign in']"), + // popup.waitForNavigation(), + // ]); + // await popup.click("input.button[type='submit'][value='Accept']"); + // try { + // await popup?.close(); + // } catch (error) { + // console.log("popup is closed"); + // } + // } catch (error) { + // await popup.screenshot({ + // path: getPlaywrightScreenshotPath("login_error"), + // fullPage: true, + // }); + // throw error; + // } + // } + // }); console.log("start to verify dashboard tab"); await page.waitForTimeout(Timeout.longTimeWait); const frameElementHandle = await page.waitForSelector( diff --git a/packages/tests/src/utils/vscodeOperation.ts b/packages/tests/src/utils/vscodeOperation.ts index 4b6a0255ec..c95be371fb 100644 --- a/packages/tests/src/utils/vscodeOperation.ts +++ b/packages/tests/src/utils/vscodeOperation.ts @@ -25,6 +25,7 @@ import { Timeout, CreateProjectQuestion, AppType, + LocalDebugError, } from "./constants"; import { RetryHandler } from "./retryHandler"; import isWsl from "is-wsl"; @@ -1221,25 +1222,61 @@ export async function findWordFromTerminal(word: string): Promise { By.css(".simple-find-part") ); for (const searchBox of searchBoxs) { + searchInput = await searchBox.findElement(By.className("input")); + closeBtn = await searchBox.findElement(By.css(".codicon-widget-close")); try { - searchInput = await searchBox.findElement(By.className("input")); - closeBtn = await searchBox.findElement(By.css(".codicon-widget-close")); + // find if there has some warning errors await searchInput.clear(); - await searchInput.sendKeys("Failed "); - console.log("send key: Failed"); + await searchInput.sendKeys("Compiled with warnings"); + console.log("send key: Compiled with warnings"); } catch (error) { console.log("[Pending]: Input error, try to find next..."); continue; } await VSBrowser.instance.driver.sleep(Timeout.webView); - // verify error message + // verify warning error message result = await ( await searchBox.findElement(By.className("matchesCount")) ).getText(); if (result.includes("No results")) { - console.log("no error message found."); + console.log("no warning error message found."); + // find if there has some errors + try { + await searchInput.clear(); + await searchInput.sendKeys("Failed "); + console.log("send key: Failed"); + } catch (error) { + console.log("[Pending]: Input error, try to find next..."); + continue; + } + await VSBrowser.instance.driver.sleep(Timeout.webView); + // verify error message + result = await ( + await searchBox.findElement(By.className("matchesCount")) + ).getText(); + if (result.includes("No results")) { + console.log("no error message found."); + // verify success message + await searchInput.clear(); + await searchInput.sendKeys(word); + console.log("send key: ", word); + await VSBrowser.instance.driver.sleep(Timeout.webView); + result = await ( + await searchBox.findElement(By.className("matchesCount")) + ).getText(); + if (result.includes("No results") == false) { + console.log("[Pass]: verify " + word + " success !!!"); + return true; + } + } else { + await VSBrowser.instance.takeScreenshot( + getScreenshotName("debug failed") + ); + assert.fail("[failed] error message found !!!"); + } + } else { // verify success message await searchInput.clear(); await searchInput.sendKeys(word); @@ -1252,11 +1289,6 @@ export async function findWordFromTerminal(word: string): Promise { console.log("[Pass]: verify " + word + " success !!!"); return true; } - } else { - await VSBrowser.instance.takeScreenshot( - getScreenshotName("debug failed") - ); - assert.fail("[failed] error message found !!!"); } } return false; From b21969daf61ec6ef98e143d893eb832eef065cc5 Mon Sep 17 00:00:00 2001 From: Ivan_Chen Date: Wed, 4 Dec 2024 10:46:19 +0800 Subject: [PATCH 4/9] test: skip warning during debug session --- .../sample-remotedebug-dashboard.test.ts | 2 +- .../tests/src/utils/playwrightOperation.ts | 86 ++++++++++--------- 2 files changed, 47 insertions(+), 41 deletions(-) diff --git a/packages/tests/src/ui-test/samples/sample-remotedebug-dashboard.test.ts b/packages/tests/src/ui-test/samples/sample-remotedebug-dashboard.test.ts index f02b549a5b..6689406975 100644 --- a/packages/tests/src/ui-test/samples/sample-remotedebug-dashboard.test.ts +++ b/packages/tests/src/ui-test/samples/sample-remotedebug-dashboard.test.ts @@ -12,7 +12,7 @@ import { CaseFactory } from "./sampleCaseFactory"; class DashboardTestCase extends CaseFactory { override async onValidate(page: Page): Promise { - return await validateDashboardTab(page); + return await validateDashboardTab(page, "dev"); } } diff --git a/packages/tests/src/utils/playwrightOperation.ts b/packages/tests/src/utils/playwrightOperation.ts index 993a599cad..1cb53628f2 100644 --- a/packages/tests/src/utils/playwrightOperation.ts +++ b/packages/tests/src/utils/playwrightOperation.ts @@ -2326,47 +2326,53 @@ export async function validateBasicDashboardTab(page: Page) { } } -export async function validateDashboardTab(page: Page) { +export async function validateDashboardTab( + page: Page, + env: "local" | "dev" = "local" +) { try { - // await RetryHandler.retry(async () => { - // console.log("Before popup"); - // const popup = await page.waitForEvent("popup"); - // console.log("after popup"); - // if (popup && !popup?.isClosed()) { - // await popup - // .click('button:has-text("Reload")', { - // timeout: Timeout.playwrightConsentPageReload, - // }) - // .catch(() => {}); - // console.log("click Accept button"); - // await page.waitForTimeout(Timeout.longTimeWait); - // try { - // // input password - // console.log(`fill in password`); - // await popup.fill( - // "input.input[type='password'][name='passwd']", - // Env.password - // ); - // // sign in - // await Promise.all([ - // popup.click("input.button[type='submit'][value='Sign in']"), - // popup.waitForNavigation(), - // ]); - // await popup.click("input.button[type='submit'][value='Accept']"); - // try { - // await popup?.close(); - // } catch (error) { - // console.log("popup is closed"); - // } - // } catch (error) { - // await popup.screenshot({ - // path: getPlaywrightScreenshotPath("login_error"), - // fullPage: true, - // }); - // throw error; - // } - // } - // }); + if (env === "dev") { + await RetryHandler.retry(async () => { + console.log("Before popup"); + const popup = await page.waitForEvent("popup"); + console.log("after popup"); + if (popup && !popup?.isClosed()) { + await popup + .click('button:has-text("Reload")', { + timeout: Timeout.playwrightConsentPageReload, + }) + .catch(() => {}); + console.log("click Accept button"); + await page.waitForTimeout(Timeout.longTimeWait); + try { + // input password + console.log(`fill in password`); + await popup.fill( + "input.input[type='password'][name='passwd']", + Env.password + ); + // sign in + await Promise.all([ + popup.click("input.button[type='submit'][value='Sign in']"), + popup.waitForNavigation(), + ]); + await popup.click("input.button[type='submit'][value='Accept']"); + try { + await popup?.close(); + } catch (error) { + console.log("popup is closed"); + } + } catch (error) { + await popup.screenshot({ + path: getPlaywrightScreenshotPath("login_error"), + fullPage: true, + }); + throw error; + } + } + }); + } + console.log("start to verify dashboard tab"); await page.waitForTimeout(Timeout.longTimeWait); const frameElementHandle = await page.waitForSelector( From 90b75aebd4f1b50faed6e82a2f417c27501f7205 Mon Sep 17 00:00:00 2001 From: Ivan_Chen Date: Wed, 4 Dec 2024 10:48:54 +0800 Subject: [PATCH 5/9] test: update debug random os --- packages/tests/scripts/randomCases.json | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/packages/tests/scripts/randomCases.json b/packages/tests/scripts/randomCases.json index 5033f1f765..e66159d2bd 100644 --- a/packages/tests/scripts/randomCases.json +++ b/packages/tests/scripts/randomCases.json @@ -35,23 +35,6 @@ "sample-remotedebug-outlook-signature", "sample-localdebug-reddit-link", "sample-remotedebug-reddit-link", - "sample-localdebug-intelligent-data-chart", - "sample-remotedebug-intelligent-data-chart" - ] - }, - { - "os": { - "windows-latest": { - "node-18": [] - }, - "ubuntu-latest": { - "node-18": [] - }, - "macos-latest": { - "node-18": [] - } - }, - "cases": [ "sample-localdebug-chef-bot", "sample-remotedebug-chef-bot" ] @@ -73,7 +56,9 @@ "sample-localdebug-contact-exporter", "sample-localdebug-hello-world-meeting", "sample-localdebug-food-catalog", - "sample-remotedebug-food-catalog" + "sample-remotedebug-food-catalog", + "sample-localdebug-intelligent-data-chart", + "sample-remotedebug-intelligent-data-chart" ] }, { From 96f424a2e3b4aaf42a8d34b1181d624768863f60 Mon Sep 17 00:00:00 2001 From: Ivan_Chen Date: Wed, 4 Dec 2024 10:59:18 +0800 Subject: [PATCH 6/9] test: update debug random os --- packages/tests/src/utils/vscodeOperation.ts | 63 +++++++-------------- 1 file changed, 22 insertions(+), 41 deletions(-) diff --git a/packages/tests/src/utils/vscodeOperation.ts b/packages/tests/src/utils/vscodeOperation.ts index c95be371fb..98c9555fbb 100644 --- a/packages/tests/src/utils/vscodeOperation.ts +++ b/packages/tests/src/utils/vscodeOperation.ts @@ -25,7 +25,6 @@ import { Timeout, CreateProjectQuestion, AppType, - LocalDebugError, } from "./constants"; import { RetryHandler } from "./retryHandler"; import isWsl from "is-wsl"; @@ -1222,73 +1221,55 @@ export async function findWordFromTerminal(word: string): Promise { By.css(".simple-find-part") ); for (const searchBox of searchBoxs) { - searchInput = await searchBox.findElement(By.className("input")); - closeBtn = await searchBox.findElement(By.css(".codicon-widget-close")); try { - // find if there has some warning errors + searchInput = await searchBox.findElement(By.className("input")); + closeBtn = await searchBox.findElement(By.css(".codicon-widget-close")); await searchInput.clear(); - await searchInput.sendKeys("Compiled with warnings"); - console.log("send key: Compiled with warnings"); + await searchInput.sendKeys("Failed "); + console.log("send key: Failed"); } catch (error) { console.log("[Pending]: Input error, try to find next..."); continue; } await VSBrowser.instance.driver.sleep(Timeout.webView); - // verify warning error message + // verify error message result = await ( await searchBox.findElement(By.className("matchesCount")) ).getText(); if (result.includes("No results")) { - console.log("no warning error message found."); - - // find if there has some errors + console.log("no error message found."); + } else { try { await searchInput.clear(); - await searchInput.sendKeys("Failed "); - console.log("send key: Failed"); + await searchInput.sendKeys("Compiled with warnings"); + console.log("send key: Compiled with warnings"); } catch (error) { console.log("[Pending]: Input error, try to find next..."); continue; } - await VSBrowser.instance.driver.sleep(Timeout.webView); - // verify error message + // verify warning error message result = await ( await searchBox.findElement(By.className("matchesCount")) ).getText(); if (result.includes("No results")) { - console.log("no error message found."); - // verify success message - await searchInput.clear(); - await searchInput.sendKeys(word); - console.log("send key: ", word); - await VSBrowser.instance.driver.sleep(Timeout.webView); - result = await ( - await searchBox.findElement(By.className("matchesCount")) - ).getText(); - if (result.includes("No results") == false) { - console.log("[Pass]: verify " + word + " success !!!"); - return true; - } - } else { await VSBrowser.instance.takeScreenshot( getScreenshotName("debug failed") ); assert.fail("[failed] error message found !!!"); } - } else { - // verify success message - await searchInput.clear(); - await searchInput.sendKeys(word); - console.log("send key: ", word); - await VSBrowser.instance.driver.sleep(Timeout.webView); - result = await ( - await searchBox.findElement(By.className("matchesCount")) - ).getText(); - if (result.includes("No results") == false) { - console.log("[Pass]: verify " + word + " success !!!"); - return true; - } + } + // verify success message + await searchInput.clear(); + await searchInput.sendKeys(word); + console.log("send key: ", word); + await VSBrowser.instance.driver.sleep(Timeout.webView); + result = await ( + await searchBox.findElement(By.className("matchesCount")) + ).getText(); + if (result.includes("No results") == false) { + console.log("[Pass]: verify " + word + " success !!!"); + return true; } } return false; From d12033b1ce880fd5fb141527813b864133739a62 Mon Sep 17 00:00:00 2001 From: Ivan_Chen Date: Wed, 4 Dec 2024 11:10:08 +0800 Subject: [PATCH 7/9] test: update debug random os --- .../sample-remotedebug-dashboard.test.ts | 2 +- .../tests/src/utils/playwrightOperation.ts | 77 +++++++++---------- 2 files changed, 37 insertions(+), 42 deletions(-) diff --git a/packages/tests/src/ui-test/samples/sample-remotedebug-dashboard.test.ts b/packages/tests/src/ui-test/samples/sample-remotedebug-dashboard.test.ts index 6689406975..f02b549a5b 100644 --- a/packages/tests/src/ui-test/samples/sample-remotedebug-dashboard.test.ts +++ b/packages/tests/src/ui-test/samples/sample-remotedebug-dashboard.test.ts @@ -12,7 +12,7 @@ import { CaseFactory } from "./sampleCaseFactory"; class DashboardTestCase extends CaseFactory { override async onValidate(page: Page): Promise { - return await validateDashboardTab(page, "dev"); + return await validateDashboardTab(page); } } diff --git a/packages/tests/src/utils/playwrightOperation.ts b/packages/tests/src/utils/playwrightOperation.ts index 1cb53628f2..8d70b742f1 100644 --- a/packages/tests/src/utils/playwrightOperation.ts +++ b/packages/tests/src/utils/playwrightOperation.ts @@ -2326,52 +2326,47 @@ export async function validateBasicDashboardTab(page: Page) { } } -export async function validateDashboardTab( - page: Page, - env: "local" | "dev" = "local" -) { +export async function validateDashboardTab(page: Page) { try { - if (env === "dev") { - await RetryHandler.retry(async () => { - console.log("Before popup"); - const popup = await page.waitForEvent("popup"); - console.log("after popup"); - if (popup && !popup?.isClosed()) { - await popup - .click('button:has-text("Reload")', { - timeout: Timeout.playwrightConsentPageReload, - }) - .catch(() => {}); - console.log("click Accept button"); - await page.waitForTimeout(Timeout.longTimeWait); + await RetryHandler.retry(async () => { + console.log("Before popup"); + const popup = await page.waitForEvent("popup"); + console.log("after popup"); + if (popup && !popup?.isClosed()) { + await popup + .click('button:has-text("Reload")', { + timeout: Timeout.playwrightConsentPageReload, + }) + .catch(() => {}); + console.log("click Accept button"); + await page.waitForTimeout(Timeout.longTimeWait); + try { + // input password + console.log(`fill in password`); + await popup.fill( + "input.input[type='password'][name='passwd']", + Env.password + ); + // sign in + await Promise.all([ + popup.click("input.button[type='submit'][value='Sign in']"), + popup.waitForNavigation(), + ]); + await popup.click("input.button[type='submit'][value='Accept']"); try { - // input password - console.log(`fill in password`); - await popup.fill( - "input.input[type='password'][name='passwd']", - Env.password - ); - // sign in - await Promise.all([ - popup.click("input.button[type='submit'][value='Sign in']"), - popup.waitForNavigation(), - ]); - await popup.click("input.button[type='submit'][value='Accept']"); - try { - await popup?.close(); - } catch (error) { - console.log("popup is closed"); - } + await popup?.close(); } catch (error) { - await popup.screenshot({ - path: getPlaywrightScreenshotPath("login_error"), - fullPage: true, - }); - throw error; + console.log("popup is closed"); } + } catch (error) { + await popup.screenshot({ + path: getPlaywrightScreenshotPath("login_error"), + fullPage: true, + }); + throw error; } - }); - } + } + }); console.log("start to verify dashboard tab"); await page.waitForTimeout(Timeout.longTimeWait); From 6414e23d161dff1cbee83d53bcec9e85c6be4df5 Mon Sep 17 00:00:00 2001 From: Ivan_Chen Date: Wed, 4 Dec 2024 11:31:54 +0800 Subject: [PATCH 8/9] test: update debug random os --- packages/tests/src/utils/vscodeOperation.ts | 37 ++++++++++++++------- 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/packages/tests/src/utils/vscodeOperation.ts b/packages/tests/src/utils/vscodeOperation.ts index 98c9555fbb..720bf16323 100644 --- a/packages/tests/src/utils/vscodeOperation.ts +++ b/packages/tests/src/utils/vscodeOperation.ts @@ -1239,6 +1239,19 @@ export async function findWordFromTerminal(word: string): Promise { ).getText(); if (result.includes("No results")) { console.log("no error message found."); + + // verify success message + await searchInput.clear(); + await searchInput.sendKeys(word); + console.log("send key: ", word); + await VSBrowser.instance.driver.sleep(Timeout.webView); + result = await ( + await searchBox.findElement(By.className("matchesCount")) + ).getText(); + if (result.includes("No results") == false) { + console.log("[Pass]: verify " + word + " success !!!"); + return true; + } } else { try { await searchInput.clear(); @@ -1258,18 +1271,18 @@ export async function findWordFromTerminal(word: string): Promise { ); assert.fail("[failed] error message found !!!"); } - } - // verify success message - await searchInput.clear(); - await searchInput.sendKeys(word); - console.log("send key: ", word); - await VSBrowser.instance.driver.sleep(Timeout.webView); - result = await ( - await searchBox.findElement(By.className("matchesCount")) - ).getText(); - if (result.includes("No results") == false) { - console.log("[Pass]: verify " + word + " success !!!"); - return true; + // verify success message + await searchInput.clear(); + await searchInput.sendKeys("No issues found"); + console.log("send key: ", "No issues found."); + await VSBrowser.instance.driver.sleep(Timeout.webView); + result = await ( + await searchBox.findElement(By.className("matchesCount")) + ).getText(); + if (result.includes("No results") == false) { + console.log("[Pass]: verify " + word + " success !!!"); + return true; + } } } return false; From 41175c3079509e4201ef4a2518e10aab1adcde28 Mon Sep 17 00:00:00 2001 From: Ivan_Chen Date: Wed, 4 Dec 2024 11:36:54 +0800 Subject: [PATCH 9/9] test: update dashboard sample --- .../src/ui-test/samples/sample-localdebug-dashboard.test.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/tests/src/ui-test/samples/sample-localdebug-dashboard.test.ts b/packages/tests/src/ui-test/samples/sample-localdebug-dashboard.test.ts index 643c567dd1..556a86fbde 100644 --- a/packages/tests/src/ui-test/samples/sample-localdebug-dashboard.test.ts +++ b/packages/tests/src/ui-test/samples/sample-localdebug-dashboard.test.ts @@ -48,6 +48,5 @@ new DashboardTestCase( ], { dashboardFlag: true, - debug: "cli", } ).test();