mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Switch integration tests to get application menus by IDs (#3912)
This commit is contained in:
1 parent
724b9450a6
commit
e10c13cdf4
6 files changed
+73
-165
No files matched your search
@@ -25,16 +25,24 @@
|
||||
TEST_NAMESPACE namespace. This is done to minimize destructive impact of the cluster tests on an existing minikube
|
||||
cluster and vice versa.
|
||||
*/
|
||||
import type { Page } from "playwright";
|
||||
import type { ElectronApplication, Page } from "playwright";
|
||||
import * as utils from "../helpers/utils";
|
||||
|
||||
describe("preferences page tests", () => {
|
||||
let window: Page, cleanup: () => Promise<void>;
|
||||
|
||||
beforeEach(async () => {
|
||||
({ window, cleanup } = await utils.start());
|
||||
let app: ElectronApplication;
|
||||
|
||||
({ window, cleanup, app } = await utils.start());
|
||||
await utils.clickWelcomeButton(window);
|
||||
await window.keyboard.press("Meta+,");
|
||||
|
||||
await app.evaluate(async ({ app }) => {
|
||||
await app.applicationMenu
|
||||
.getMenuItemById(process.platform === "darwin" ? "root" : "file")
|
||||
.submenu.getMenuItemById("preferences")
|
||||
.click();
|
||||
});
|
||||
}, 10*60*1000);
|
||||
|
||||
afterEach(async () => {
|
||||
|
||||
@@ -19,14 +19,14 @@
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
import type { Page } from "playwright";
|
||||
import type { ElectronApplication, Page } from "playwright";
|
||||
import * as utils from "../helpers/utils";
|
||||
|
||||
describe("Lens command palette", () => {
|
||||
let window: Page, cleanup: () => Promise<void>;
|
||||
let window: Page, cleanup: () => Promise<void>, app: ElectronApplication;
|
||||
|
||||
beforeEach(async () => {
|
||||
({ window, cleanup } = await utils.start());
|
||||
({ window, cleanup, app } = await utils.start());
|
||||
await utils.clickWelcomeButton(window);
|
||||
}, 10*60*1000);
|
||||
|
||||
@@ -35,8 +35,13 @@ describe("Lens command palette", () => {
|
||||
}, 10*60*1000);
|
||||
|
||||
describe("menu", () => {
|
||||
it("opens command dialog from keyboard shortcut", async () => {
|
||||
await window.keyboard.press("Meta+Shift+p");
|
||||
it("opens command dialog from menu", async () => {
|
||||
await app.evaluate(async ({ app }) => {
|
||||
await app.applicationMenu
|
||||
.getMenuItemById("view")
|
||||
.submenu.getMenuItemById("command-palette")
|
||||
.click();
|
||||
});
|
||||
await window.waitForSelector(".Select__option >> text=Hotbar: Switch");
|
||||
}, 10*60*1000);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user