Browse Source
Merge pull request #803 from mrfelton/test/combine-e2e-tests
test(e2e): combine e2e test setup/teardown steps
renovate/lint-staged-8.x
Tom Kirkpatrick
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
5 additions and
6 deletions
-
test/e2e/e2e.spec.js
|
|
@ -6,25 +6,25 @@ jest.setTimeout(10000) |
|
|
|
jest.unmock('electron') |
|
|
|
|
|
|
|
describe('main window', function spec() { |
|
|
|
beforeEach(() => { |
|
|
|
beforeAll(async () => { |
|
|
|
this.app = new Application({ |
|
|
|
path: electronPath, |
|
|
|
args: [path.join(__dirname, '..', '..', 'app')] |
|
|
|
}) |
|
|
|
|
|
|
|
return this.app.start() |
|
|
|
await this.app.start() |
|
|
|
await this.app.client.waitUntilWindowLoaded() |
|
|
|
}) |
|
|
|
|
|
|
|
afterEach(() => { |
|
|
|
afterAll(() => { |
|
|
|
if (this.app && this.app.isRunning()) { |
|
|
|
return this.app.stop() |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
it('should open window', async () => { |
|
|
|
const { client, browserWindow } = this.app |
|
|
|
const { browserWindow } = this.app |
|
|
|
|
|
|
|
await client.waitUntilWindowLoaded() |
|
|
|
const title = await browserWindow.getTitle() |
|
|
|
expect(title).toBe('Zap') |
|
|
|
}) |
|
|
@ -32,7 +32,6 @@ describe('main window', function spec() { |
|
|
|
it("should haven't any logs in console of main window", async () => { |
|
|
|
const { client } = this.app |
|
|
|
|
|
|
|
await client.waitUntilWindowLoaded() |
|
|
|
const logs = await client.getRenderProcessLogs() |
|
|
|
expect(logs).toHaveLength(0) |
|
|
|
}) |
|
|
|