From e06f76a6bb11b51b9965bf7340a2f5fe708c9cb2 Mon Sep 17 00:00:00 2001 From: lee-at-zoo-corp Date: Fri, 4 Apr 2025 02:37:15 -0400 Subject: [PATCH] Qualify fail function --- e2e/playwright/native-file-menu.spec.ts | 76 ++++++++++++------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/e2e/playwright/native-file-menu.spec.ts b/e2e/playwright/native-file-menu.spec.ts index 698c6295d..990f32854 100644 --- a/e2e/playwright/native-file-menu.spec.ts +++ b/e2e/playwright/native-file-menu.spec.ts @@ -14,11 +14,11 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => { await page.waitForTimeout(100) // wait for createModelingPageMenu() to run await tronApp.electron.evaluate(async ({ app }) => { if (!app || !app.applicationMenu) { - fail() + test.fail() } const newProject = app.applicationMenu.getMenuItemById('File.New project') - if (!newProject) fail() + if (!newProject) test.fail() newProject.click() }) // Check that the command bar is opened @@ -35,11 +35,11 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => { // Run electron snippet to find the Menu! await page.waitForTimeout(100) // wait for createModelingPageMenu() to run await tronApp.electron.evaluate(async ({ app }) => { - if (!app || !app.applicationMenu) fail() + if (!app || !app.applicationMenu) test.fail() const openProject = app.applicationMenu.getMenuItemById('File.Open project') if (!openProject) { - fail() + test.fail() } openProject.click() }) @@ -57,17 +57,17 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => { cmdBar, page, }) => { - if (!tronApp) fail() + if (!tronApp) test.fail() // Run electron snippet to find the Menu! await page.waitForTimeout(100) // wait for createModelingPageMenu() to run await tronApp.electron.evaluate(async ({ app }) => { if (!app || !app.applicationMenu) { - fail() + test.fail() } const userSettings = app.applicationMenu.getMenuItemById( 'File.Preferences.User settings' ) - if (!userSettings) fail() + if (!userSettings) test.fail() userSettings.click() }) const settings = page.getByTestId('settings-dialog-panel') @@ -84,17 +84,17 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => { page, }) => { if (!tronApp) { - fail() + test.fail() } // Run electron snippet to find the Menu! await page.waitForTimeout(100) // wait for createModelingPageMenu() to run await tronApp.electron.evaluate(async ({ app }) => { - if (!app || !app.applicationMenu) fail() + if (!app || !app.applicationMenu) test.fail() const keybindings = app.applicationMenu.getMenuItemById( 'File.Preferences.Keybindings' ) if (!keybindings) { - fail() + test.fail() } keybindings.click() }) @@ -109,17 +109,17 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => { cmdBar, page, }) => { - if (!tronApp) fail() + if (!tronApp) test.fail() // Run electron snippet to find the Menu! await page.waitForTimeout(100) // wait for createModelingPageMenu() to run await tronApp.electron.evaluate(async ({ app }) => { if (!app || !app.applicationMenu) { - fail() + test.fail() } const menu = app.applicationMenu.getMenuItemById( 'File.Preferences.User default units' ) - if (!menu) fail() + if (!menu) test.fail() menu.click() }) const settings = page.getByTestId('settings-dialog-panel') @@ -132,12 +132,12 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => { // Run electron snippet to find the Menu! await page.waitForTimeout(100) // wait for createModelingPageMenu() to run await tronApp.electron.evaluate(async ({ app }) => { - if (!app || !app.applicationMenu) fail() + if (!app || !app.applicationMenu) test.fail() const menu = app.applicationMenu.getMenuItemById( 'File.Preferences.Theme' ) if (!menu) { - fail() + test.fail() } menu.click() }) @@ -155,17 +155,17 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => { cmdBar, page, }) => { - if (!tronApp) fail() + if (!tronApp) test.fail() // Run electron snippet to find the Menu! await page.waitForTimeout(100) // wait for createModelingPageMenu() to run await tronApp.electron.evaluate(async ({ app }) => { if (!app || !app.applicationMenu) { - fail() + test.fail() } const menu = app.applicationMenu.getMenuItemById( 'File.Preferences.Theme color' ) - if (!menu) fail() + if (!menu) test.fail() menu.click() }) const settings = page.getByTestId('settings-dialog-panel') @@ -182,10 +182,10 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => { // Run electron snippet to find the Menu! await page.waitForTimeout(100) // wait for createModelingPageMenu() to run await tronApp.electron.evaluate(async ({ app }) => { - if (!app || !app.applicationMenu) fail() + if (!app || !app.applicationMenu) test.fail() const menu = app.applicationMenu.getMenuItemById('File.Sign out') if (!menu) { - fail() + test.fail() } // FIXME: Add back when you can actually sign out // menu.click() @@ -204,12 +204,12 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => { await page.waitForTimeout(100) // wait for createModelingPageMenu() to run await tronApp.electron.evaluate(async ({ app }) => { if (!app || !app.applicationMenu) { - fail() + test.fail() } const menu = app.applicationMenu.getMenuItemById( 'Edit.Rename project' ) - if (!menu) fail() + if (!menu) test.fail() menu.click() }) // Check the placeholder project name exists @@ -224,12 +224,12 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => { // Run electron snippet to find the Menu! await page.waitForTimeout(100) // wait for createModelingPageMenu() to run await tronApp.electron.evaluate(async ({ app }) => { - if (!app || !app.applicationMenu) fail() + if (!app || !app.applicationMenu) test.fail() const menu = app.applicationMenu.getMenuItemById( 'Edit.Delete project' ) if (!menu) { - fail() + test.fail() } menu.click() }) @@ -244,17 +244,17 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => { cmdBar, page, }) => { - if (!tronApp) fail() + if (!tronApp) test.fail() // Run electron snippet to find the Menu! await page.waitForTimeout(100) // wait for createModelingPageMenu() to run await tronApp.electron.evaluate(async ({ app }) => { if (!app || !app.applicationMenu) { - fail() + test.fail() } const menu = app.applicationMenu.getMenuItemById( 'Edit.Change project directory' ) - if (!menu) fail() + if (!menu) test.fail() menu.click() }) const settings = page.getByTestId('settings-dialog-panel') @@ -273,12 +273,12 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => { // Run electron snippet to find the Menu! await page.waitForTimeout(100) // wait for createModelingPageMenu() to run await tronApp.electron.evaluate(async ({ app }) => { - if (!app || !app.applicationMenu) fail() + if (!app || !app.applicationMenu) test.fail() const menu = app.applicationMenu.getMenuItemById( 'View.Command Palette...' ) if (!menu) { - fail() + test.fail() } menu.click() }) @@ -294,12 +294,12 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => { await page.waitForTimeout(100) // wait for createModelingPageMenu() to run await tronApp.electron.evaluate(async ({ app }) => { if (!app || !app.applicationMenu) { - fail() + test.fail() } const menu = app.applicationMenu.getMenuItemById( 'Help.Show all commands' ) - if (!menu) fail() + if (!menu) test.fail() menu.click() }) // Check the placeholder project name exists @@ -311,12 +311,12 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => { // Run electron snippet to find the Menu! await page.waitForTimeout(100) // wait for createModelingPageMenu() to run await tronApp.electron.evaluate(async ({ app }) => { - if (!app || !app.applicationMenu) fail() + if (!app || !app.applicationMenu) test.fail() const menu = app.applicationMenu.getMenuItemById( 'Help.KCL code samples' ) if (!menu) { - fail() + test.fail() } }) }) @@ -325,17 +325,17 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => { cmdBar, page, }) => { - if (!tronApp) fail() + if (!tronApp) test.fail() // Run electron snippet to find the Menu! await page.waitForTimeout(100) // wait for createModelingPageMenu() to run await tronApp.electron.evaluate(async ({ app }) => { if (!app || !app.applicationMenu) { - fail() + test.fail() } const menu = app.applicationMenu.getMenuItemById( 'Help.Refresh and report a bug' ) - if (!menu) fail() + if (!menu) test.fail() menu.click() }) // Core dump and refresh magic number timeout @@ -350,12 +350,12 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => { // Run electron snippet to find the Menu! await page.waitForTimeout(100) // wait for createModelingPageMenu() to run await tronApp.electron.evaluate(async ({ app }) => { - if (!app || !app.applicationMenu) fail() + if (!app || !app.applicationMenu) test.fail() const menu = app.applicationMenu.getMenuItemById( 'Help.Reset onboarding' ) if (!menu) { - fail() + test.fail() } menu.click() })