This repository has been archived by the owner on Oct 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #100 from atdrago/feature/adam/testing
Feature/adam/testing
- Loading branch information
Showing
24 changed files
with
179 additions
and
132 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,4 +39,4 @@ describe.skip('Benchmark', function () { | |
}); | ||
}); | ||
}) | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,4 +38,4 @@ describe('Edit > Copy', function () { | |
assert.isDefined(image.getSize); | ||
}); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,4 +39,4 @@ describe('Edit > Paste', function () { | |
}) | ||
.then((src) => assert.isTrue(REGEX_PNG.test(src))); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,4 +39,4 @@ describe('Edit > Redo', function () { | |
}) | ||
.then((src) => assert.isTrue(REGEX_PNG.test(src))); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,4 +38,4 @@ describe('Edit > Undo', function () { | |
}) | ||
.then((src) => assert.equal(src, '')); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,4 +42,4 @@ describe('File > Close Tab', function () { | |
}) | ||
.then((tabCount) => assert.equal(tabCount, 1)); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,4 +41,4 @@ describe('File > New Tab', function () { | |
}) | ||
.then((tabCount) => assert.equal(tabCount, 2)); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
'use strict'; | ||
|
||
const { Application } = require('spectron'); | ||
const { assert } = require('chai'); | ||
|
||
const APP_PATH = './dist/Negative-darwin-x64/Negative.app/Contents/MacOS/Negative'; | ||
const IMAGE_ID = '#negativeImage'; | ||
|
||
describe('View > Actual Size', function () { | ||
const app = new Application({ | ||
path: APP_PATH, | ||
env: { | ||
ELECTRON_ENABLE_LOGGING: true, | ||
ELECTRON_ENABLE_STACK_DUMPING: true, | ||
NEGATIVE_IGNORE_WINDOW_SETTINGS: false, | ||
NEGATIVE_SKIP_RESET_DIALOG: true, | ||
NEGATIVE_SETTINGS_PATH: '../test/fixtures/two-windows-with-data.json', | ||
NODE_ENV: 'development' | ||
} | ||
}); | ||
|
||
this.timeout(60000); | ||
|
||
beforeEach(() => { | ||
return app.start(); | ||
}); | ||
|
||
afterEach(() => { | ||
if (app && app.isRunning()) { | ||
return app.stop(); | ||
} | ||
}); | ||
|
||
it('Should zoom to 0', () => { | ||
// @TODO - Load settings file for actual size. Blocked by #96. | ||
return app.electron.ipcRenderer.send('test-zoom-in') | ||
.then(() => app.electron.ipcRenderer.send('test-actual-size')) | ||
.then(() => { | ||
return app.client.selectorExecute(IMAGE_ID, (element) => { | ||
const zoomLevel = element[0].getAttribute('data-zoom-level'); | ||
|
||
return zoomLevel; | ||
}); | ||
}) | ||
.then((zoomLevel) => assert.equal(zoomLevel, 1)); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,4 +38,4 @@ describe('View > Capture', function () { | |
}) | ||
.then((src) => assert.isTrue(REGEX_PNG.test(src))); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,4 +38,4 @@ describe('View > Clear', function () { | |
}) | ||
.then((src) => assert.equal(src, '')); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
'use strict'; | ||
|
||
const { Application } = require('spectron'); | ||
const { assert } = require('chai'); | ||
|
||
const APP_PATH = './dist/Negative-darwin-x64/Negative.app/Contents/MacOS/Negative'; | ||
const IMAGE_ID = '#negativeImage'; | ||
|
||
describe('View > Zoom In', function () { | ||
const app = new Application({ | ||
path: APP_PATH, | ||
env: { | ||
ELECTRON_ENABLE_LOGGING: true, | ||
ELECTRON_ENABLE_STACK_DUMPING: true, | ||
NEGATIVE_IGNORE_WINDOW_SETTINGS: false, | ||
NEGATIVE_SKIP_RESET_DIALOG: true, | ||
NEGATIVE_SETTINGS_PATH: '../test/fixtures/two-windows-with-data.json', | ||
NODE_ENV: 'development' | ||
} | ||
}); | ||
|
||
this.timeout(60000); | ||
|
||
beforeEach(() => { | ||
return app.start(); | ||
}); | ||
|
||
afterEach(() => { | ||
if (app && app.isRunning()) { | ||
return app.stop(); | ||
} | ||
}); | ||
|
||
it('Should zoom in', () => { | ||
return app.electron.ipcRenderer.send('test-zoom-in') | ||
.then(() => { | ||
return app.client.selectorExecute(IMAGE_ID, (element) => { | ||
const zoomLevel = element[0].getAttribute('data-zoom-level'); | ||
|
||
return zoomLevel; | ||
}); | ||
}) | ||
.then((zoomLevel) => assert.equal(zoomLevel, 1.25)) | ||
.then(() => app.electron.ipcRenderer.send('test-zoom-in')) | ||
.then(() => app.electron.ipcRenderer.send('test-zoom-in')) | ||
.then(() => app.electron.ipcRenderer.send('test-zoom-in')) | ||
.then(() => app.electron.ipcRenderer.send('test-zoom-in')) | ||
.then(() => { | ||
return app.client.selectorExecute(IMAGE_ID, (element) => { | ||
const zoomLevel = element[0].getAttribute('data-zoom-level'); | ||
|
||
return zoomLevel; | ||
}); | ||
}) | ||
.then((zoomLevel) => assert.equal(zoomLevel, 2)); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
'use strict'; | ||
|
||
const { Application } = require('spectron'); | ||
const { assert } = require('chai'); | ||
|
||
const APP_PATH = './dist/Negative-darwin-x64/Negative.app/Contents/MacOS/Negative'; | ||
const IMAGE_ID = '#negativeImage'; | ||
|
||
describe('View > Zoom Out', function () { | ||
const app = new Application({ | ||
path: APP_PATH, | ||
env: { | ||
ELECTRON_ENABLE_LOGGING: true, | ||
ELECTRON_ENABLE_STACK_DUMPING: true, | ||
NEGATIVE_IGNORE_WINDOW_SETTINGS: false, | ||
NEGATIVE_SKIP_RESET_DIALOG: true, | ||
NEGATIVE_SETTINGS_PATH: '../test/fixtures/two-windows-with-data.json', | ||
NODE_ENV: 'development' | ||
} | ||
}); | ||
|
||
this.timeout(60000); | ||
|
||
beforeEach(() => { | ||
return app.start(); | ||
}); | ||
|
||
afterEach(() => { | ||
if (app && app.isRunning()) { | ||
return app.stop(); | ||
} | ||
}); | ||
|
||
it('Should zoom out', () => { | ||
return app.electron.ipcRenderer.send('test-zoom-out') | ||
.then(() => { | ||
return app.client.selectorExecute(IMAGE_ID, (element) => { | ||
const zoomLevel = element[0].getAttribute('data-zoom-level'); | ||
|
||
return zoomLevel; | ||
}); | ||
}) | ||
.then((zoomLevel) => assert.equal(zoomLevel, 0.75)) | ||
.then(() => app.electron.ipcRenderer.send('test-zoom-out')) | ||
.then(() => app.electron.ipcRenderer.send('test-zoom-out')) | ||
.then(() => { | ||
return app.client.selectorExecute(IMAGE_ID, (element) => { | ||
const zoomLevel = element[0].getAttribute('data-zoom-level'); | ||
|
||
return zoomLevel; | ||
}); | ||
}) | ||
.then((zoomLevel) => assert.equal(zoomLevel, 0.5)); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.