diff --git a/integration/__tests__/app.tests.ts b/integration/__tests__/app.tests.ts index eeef7a01f1..72d95fa97d 100644 --- a/integration/__tests__/app.tests.ts +++ b/integration/__tests__/app.tests.ts @@ -5,6 +5,7 @@ cluster and vice versa. */ import { Application } from "spectron" +const spectronKeys = require("spectron-keys") import * as util from "../helpers/utils" import { spawnSync } from "child_process" @@ -54,10 +55,12 @@ describe("Lens integration tests", () => { await app.client.keys(['Shift', 'Meta']) }) - it.skip('shows "preferences"', async () => { - await app.client.keys(['Meta', ',']) + it('shows "preferences"', async () => { + await app.client.keys(spectronKeys.mapAccelerator("Control+F2")) // attempt to activate the menu bar (I know this is macos only, trying anything) + await app.client.keys(spectronKeys.mapAccelerator("Control")) // "key up" the Control key + await app.client.keys(spectronKeys.mapAccelerator("CommandOrControl+,")) // Preferences accelerator await app.client.waitUntilTextExists("h2", "Preferences") - await app.client.keys('Meta') + await app.client.keys(spectronKeys.mapAccelerator("CommandOrControl")) // "key up" the CommandOrControl key }) it.skip('quits Lens"', async () => { diff --git a/package.json b/package.json index 43c5c31359..7cd4260961 100644 --- a/package.json +++ b/package.json @@ -310,6 +310,7 @@ "react-window": "^1.8.5", "sass-loader": "^8.0.2", "spectron": "11.0.0", + "spectron-keys": "0.0.1", "style-loader": "^1.2.1", "terser-webpack-plugin": "^3.0.3", "ts-jest": "^26.1.0", diff --git a/yarn.lock b/yarn.lock index a8dcc87642..bedd3e2ffd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10665,6 +10665,11 @@ spdy@^4.0.2: select-hose "^2.0.0" spdy-transport "^3.0.0" +spectron-keys@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/spectron-keys/-/spectron-keys-0.0.1.tgz#45c3aa535e85fe5f5c71fd18cfa43927826f65db" + integrity sha1-RcOqU16F/l9ccf0Yz6Q5J4JvZds= + spectron@11.0.0: version "11.0.0" resolved "https://registry.yarnpkg.com/spectron/-/spectron-11.0.0.tgz#79d785e6b8898638e77b5186711e3910ed4ca09b"