forked from zalmoxisus/crossbuilder
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a6f1914
commit 7b0d1c4
Showing
3 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
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,46 @@ | ||
import webdriver from 'selenium-webdriver'; | ||
import expect from 'expect'; | ||
import { check, doBefore, doAfter } from '../shared/functions'; | ||
import * as Test from '../shared/tests'; | ||
import { appName, appTitle } from '../config'; | ||
|
||
let appHandle; | ||
|
||
describe('Chrome app window', function() { | ||
|
||
before(function(done) { | ||
doBefore.call(this, done, () => { | ||
return this.driver.get('chrome://extensions-frame').then(() => { | ||
this.driver.findElement(webdriver.By.className('launch-link')).click(); | ||
return this.driver.wait(() => | ||
this.driver.getAllWindowHandles() | ||
.then(windows => { | ||
if (windows.length === 2) { | ||
appHandle = windows[1]; | ||
return true; | ||
} | ||
return false; | ||
}) | ||
, 15000, 'Chrome app not launched'); | ||
}); | ||
}, './build/app'); | ||
}); | ||
|
||
after(doAfter); | ||
|
||
it('should switch to app\'s handle', function(done) { | ||
expect(appHandle).toExist(); | ||
|
||
this.driver.switchTo().window(appHandle).then(() => { | ||
this.driver.getWindowHandle().then( | ||
(handle) => { | ||
expect(handle).toEqual(appHandle); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
|
||
Test.hasTitle(appTitle); | ||
Test.hasValue(0); | ||
|
||
}); |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export const injectClassName = 'browser-redux'; | ||
export const extensionName = 'browser-extension'; | ||
export const appName = 'browser-app'; | ||
export const appTitle = 'Redux Counter Example'; |
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