From bee41f9ca44629c0fcc69c198f187e6becb32b14 Mon Sep 17 00:00:00 2001 From: 4gray Date: Sat, 29 Jan 2022 23:04:03 +0100 Subject: [PATCH] test: remove spectron config --- e2e/common-setup.ts | 37 ------------------------------------- e2e/main.e2e.ts | 26 -------------------------- 2 files changed, 63 deletions(-) delete mode 100644 e2e/common-setup.ts delete mode 100644 e2e/main.e2e.ts diff --git a/e2e/common-setup.ts b/e2e/common-setup.ts deleted file mode 100644 index a6b93d2f9..000000000 --- a/e2e/common-setup.ts +++ /dev/null @@ -1,37 +0,0 @@ -const Application = require('spectron').Application; -const electronPath = require('electron'); // Require Electron from the binaries included in node_modules. -const path = require('path'); - -export default function setup(): void { - beforeEach(async function () { - this.app = new Application({ - // Your electron path can be any binary - // i.e for OSX an example path could be '/Applications/MyApp.app/Contents/MacOS/MyApp' - // But for the sake of the example we fetch it from our node_modules. - path: electronPath, - - // Assuming you have the following directory structure - - // |__ my project - // |__ ... - // |__ main.js - // |__ package.json - // |__ index.html - // |__ ... - // |__ test - // |__ spec.js <- You are here! ~ Well you should be. - - // The following line tells spectron to look and use the main.js file - // and the package.json located 1 level above. - args: [path.join(__dirname, '..')], - webdriverOptions: {}, - }); - await this.app.start(); - }); - - afterEach(function () { - if (this.app && this.app.isRunning()) { - return this.app.stop(); - } - }); -} diff --git a/e2e/main.e2e.ts b/e2e/main.e2e.ts deleted file mode 100644 index bc86978c8..000000000 --- a/e2e/main.e2e.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { expect } from 'chai'; -import { SpectronClient } from 'spectron'; - -import commonSetup from './common-setup'; - -describe('iptvnator App', function () { - commonSetup.apply(this); - - let client: SpectronClient; - - beforeEach(function () { - client = this.app.client; - }); - - it('creates initial windows', async function () { - const count = await client.getWindowCount(); - expect(count).to.equal(2); - }); - - it('should contain name of the app', async function () { - this.app.client.windowByIndex(1); - const elem = await client.$('.title'); - const text = await elem.getText(); - expect(text).to.equal('IPTVnator'); - }); -});