test: deprecate webdriver test in favor of auto qa using CUA (#5825)
This commit is contained in:
parent
c03f6fcc3a
commit
5241557a74
12
.github/workflows/jan-linter-and-test.yml
vendored
12
.github/workflows/jan-linter-and-test.yml
vendored
@ -114,10 +114,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
|
|
||||||
- name: Install tauri-driver dependencies
|
|
||||||
run: |
|
|
||||||
cargo install tauri-driver --locked
|
|
||||||
|
|
||||||
# Clean cache, continue on error
|
# Clean cache, continue on error
|
||||||
- name: 'Cleanup cache'
|
- name: 'Cleanup cache'
|
||||||
shell: powershell
|
shell: powershell
|
||||||
@ -154,10 +150,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
|
|
||||||
- name: Install tauri-driver dependencies
|
|
||||||
run: |
|
|
||||||
cargo install tauri-driver --locked
|
|
||||||
|
|
||||||
- name: 'Cleanup cache'
|
- name: 'Cleanup cache'
|
||||||
shell: powershell
|
shell: powershell
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
@ -202,10 +194,6 @@ jobs:
|
|||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install -y libglib2.0-dev libatk1.0-dev libpango1.0-dev libgtk-3-dev libsoup-3.0-dev libwebkit2gtk-4.1-dev librsvg2-dev libfuse2 webkit2gtk-driver
|
sudo apt install -y libglib2.0-dev libatk1.0-dev libpango1.0-dev libgtk-3-dev libsoup-3.0-dev libwebkit2gtk-4.1-dev librsvg2-dev libfuse2 webkit2gtk-driver
|
||||||
|
|
||||||
- name: Install tauri-driver dependencies
|
|
||||||
run: |
|
|
||||||
cargo install tauri-driver --locked
|
|
||||||
|
|
||||||
- name: 'Cleanup cache'
|
- name: 'Cleanup cache'
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
1
Makefile
1
Makefile
@ -42,7 +42,6 @@ lint: install-and-build
|
|||||||
# Testing
|
# Testing
|
||||||
test: lint
|
test: lint
|
||||||
yarn test
|
yarn test
|
||||||
yarn test:e2e
|
|
||||||
|
|
||||||
# Builds and publishes the app
|
# Builds and publishes the app
|
||||||
build-and-publish: install-and-build
|
build-and-publish: install-and-build
|
||||||
|
|||||||
1
tests-e2e-js/.gitignore
vendored
1
tests-e2e-js/.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
dist
|
|
||||||
@ -1,23 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "tests-e2-js",
|
|
||||||
"version": "0.0.0",
|
|
||||||
"private": true,
|
|
||||||
"type": "module",
|
|
||||||
"main": "src/main.ts",
|
|
||||||
"scripts": {
|
|
||||||
"build": "tsc",
|
|
||||||
"test": "node --test --test-force-exit --loader ts-node/esm ./src/main.ts"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"@tauri-e2e/selenium": "0.2.2",
|
|
||||||
"log4js": "^6.9.1",
|
|
||||||
"selenium-webdriver": "^4.22.0",
|
|
||||||
"ts-node": "^10.9.2"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@types/node": "^20.14.9",
|
|
||||||
"@types/selenium-webdriver": "^4.1.28",
|
|
||||||
"tsimp": "^2.0.11",
|
|
||||||
"typescript": "^5.5.2"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,51 +0,0 @@
|
|||||||
import assert from 'node:assert'
|
|
||||||
import { ChildProcess } from 'node:child_process'
|
|
||||||
import { afterEach, beforeEach, describe, test } from 'node:test'
|
|
||||||
import { By, until, WebDriver } from 'selenium-webdriver'
|
|
||||||
import * as e2e from '@tauri-e2e/selenium'
|
|
||||||
import { default as log4js } from 'log4js'
|
|
||||||
|
|
||||||
let logger = log4js.getLogger()
|
|
||||||
logger.level = 'debug'
|
|
||||||
|
|
||||||
process.env.TAURI_WEBDRIVER_LOGLEVEL = 'debug'
|
|
||||||
process.env.TAURI_WEBDRIVER_BINARY = await e2e.install.PlatformDriver()
|
|
||||||
process.env.TAURI_SELENIUM_BINARY = '../src-tauri/target/release/Jan.exe'
|
|
||||||
process.env.SELENIUM_REMOTE_URL = 'http://127.0.0.1:6655'
|
|
||||||
|
|
||||||
//@ts-ignore fuck you javascript
|
|
||||||
e2e.setLogger(logger)
|
|
||||||
|
|
||||||
describe('Tauri E2E tests', async () => {
|
|
||||||
let driver: WebDriver
|
|
||||||
let webDriver: ChildProcess
|
|
||||||
|
|
||||||
beforeEach(async () => {
|
|
||||||
// Spawn WebDriver process.
|
|
||||||
webDriver = await e2e.launch.spawnWebDriver()
|
|
||||||
// wait 1 second
|
|
||||||
await new Promise((r) => setTimeout(r, 1000))
|
|
||||||
// Create driver session.
|
|
||||||
driver = new e2e.selenium.Builder().build()
|
|
||||||
// Wait for the body element to be present
|
|
||||||
// await driver.wait(until.elementLocated({ css: 'body' }))
|
|
||||||
})
|
|
||||||
|
|
||||||
afterEach(async () => {
|
|
||||||
await e2e.selenium.cleanupSession(driver)
|
|
||||||
e2e.launch.killWebDriver(webDriver)
|
|
||||||
})
|
|
||||||
|
|
||||||
test('Find hub', async () => {
|
|
||||||
const hub = until.elementLocated(By.css('[data-test-id="menu-common:hub"'))
|
|
||||||
// console.log('GG', hub)
|
|
||||||
// @ts-ignore
|
|
||||||
await driver.wait(hub.fn, 120000)
|
|
||||||
|
|
||||||
const menuElement = await driver.findElement({
|
|
||||||
css: '[data-test-id="menu-common:hub"]',
|
|
||||||
})
|
|
||||||
assert(menuElement !== null, 'Hub menu element should be available')
|
|
||||||
await menuElement.isDisplayed()
|
|
||||||
})
|
|
||||||
})
|
|
||||||
@ -1,21 +0,0 @@
|
|||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
"outDir": "./dist",
|
|
||||||
"rootDir": "./src",
|
|
||||||
"target": "ESNext",
|
|
||||||
"module": "ESNext",
|
|
||||||
"moduleResolution": "Bundler",
|
|
||||||
"esModuleInterop": true,
|
|
||||||
"forceConsistentCasingInFileNames": true,
|
|
||||||
"strict": true,
|
|
||||||
"declaration": true,
|
|
||||||
"declarationMap": true
|
|
||||||
},
|
|
||||||
"include": [
|
|
||||||
"src/*.ts"
|
|
||||||
],
|
|
||||||
"exclude": [
|
|
||||||
"node_modules",
|
|
||||||
"dist"
|
|
||||||
],
|
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user