From eddca70a674e1924a578ee16da5bf4b30cf9cdc4 Mon Sep 17 00:00:00 2001 From: NadeemYaseen Date: Wed, 6 Nov 2024 10:13:06 -0800 Subject: [PATCH] run e2e without backend --- .github/workflows/rpe_test.yml | 2 +- tests/e2e/fle.test.js | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/rpe_test.yml b/.github/workflows/rpe_test.yml index af7069c4..b7a598e4 100644 --- a/.github/workflows/rpe_test.yml +++ b/.github/workflows/rpe_test.yml @@ -89,7 +89,7 @@ jobs: - name: E2E Playwright tests on Linux latest & MacOS if: ${{ matrix.os == 'ubuntu-latest' }} - run: npm run compile && xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npx playwright test + run: npm run compile && xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npx playwright test -- fle.test.js - name: Run ESLint only on ubuntu-latest if: ${{ matrix.os == 'ubuntu-latest' }} diff --git a/tests/e2e/fle.test.js b/tests/e2e/fle.test.js index 27a7b015..570a4343 100644 --- a/tests/e2e/fle.test.js +++ b/tests/e2e/fle.test.js @@ -1,25 +1,25 @@ -// const { _electron: electron } = require('playwright'); -// const { test, expect } = require('@playwright/test'); + const { _electron: electron } = require('playwright'); + const { test, expect } = require('@playwright/test'); -// test('Launch Electron app and click on FLE block', async () => { -// const app = await electron.launch({ args: ['main.js'] }); + test('Launch Electron app and click on FLE block', async () => { + const app = await electron.launch({ args: ['main.js'] }); -// const window = await app.firstWindow(); + const window = await app.firstWindow(); -// // selecting the device (MPW1 Gemini) + // selecting the device (MPW1 Gemini) // const deviceDropdown = await window.waitForSelector('#deviceId'); // await deviceDropdown.selectOption('MPW1'); // await new Promise((resolve) => setTimeout(resolve, 2000)); -// const fleBlock = await window.waitForSelector('#app > div > div.top-row-container > div.main-table-container.main-border > div.top-l2 > div.top-l2-col2 > div.top-l2-col2-elem > div > div:nth-child(2) > div:nth-child(2) > div'); -// await fleBlock.click(); + const fleBlock = await window.waitForSelector('#app > div > div.top-row-container > div.main-table-container.main-border > div.top-l2 > div.top-l2-col2 > div.top-l2-col2-elem > div > div:nth-child(2) > div:nth-child(2) > div'); + await fleBlock.click(); -// const flePowerVisible = await window.isVisible('div.title-comp-total-text'); -// expect(flePowerVisible).toBeTruthy(); + const flePowerVisible = await window.isVisible('div.title-comp-total-text'); + expect(flePowerVisible).toBeTruthy(); -// console.log('FLE block clicked and verified.'); + console.log('FLE block clicked and verified.'); -// await new Promise((resolve) => setTimeout(resolve, 5000)); + await new Promise((resolve) => setTimeout(resolve, 5000)); -// await app.close(); -// }); + await app.close(); + });