aboutsummaryrefslogtreecommitdiffstats
path: root/test/integration/tests.js
diff options
context:
space:
mode:
authorDan Finlay <somniac@me.com>2016-07-26 07:42:39 +0800
committerGitHub <noreply@github.com>2016-07-26 07:42:39 +0800
commit11dfb8e869d425204512b250b00ef71ed85a14cc (patch)
tree3357a7b824bce625ad96fbd470c41855f1f8268f /test/integration/tests.js
parentbf5f1df20e64c21745d49b1315a31a1bf1cf720e (diff)
downloadtangerine-wallet-browser-11dfb8e869d425204512b250b00ef71ed85a14cc.tar
tangerine-wallet-browser-11dfb8e869d425204512b250b00ef71ed85a14cc.tar.gz
tangerine-wallet-browser-11dfb8e869d425204512b250b00ef71ed85a14cc.tar.bz2
tangerine-wallet-browser-11dfb8e869d425204512b250b00ef71ed85a14cc.tar.lz
tangerine-wallet-browser-11dfb8e869d425204512b250b00ef71ed85a14cc.tar.xz
tangerine-wallet-browser-11dfb8e869d425204512b250b00ef71ed85a14cc.tar.zst
tangerine-wallet-browser-11dfb8e869d425204512b250b00ef71ed85a14cc.zip
Ui testing (#481)
* Add UI Testing Framework and Simple UI Test Added a Testem configuration that launches a Qunit page with an iFrame that builds and loads our mock-dev page and can interact with it and run tests on it. Wrote a simple test that accepts the terms and conditions and transitions to the next page. I am not doing any fancy redux-hooks for the async waiting, I've simply added a `tests/integration/helpers.js` file with a `wait()` function that returns a promise that should wait long enough. Long term we should hook into the app lifecycle by some means for testing, so we only wait the right amount of time, and wait long enough for slower processes to complete, but this may work for the time being, just enough to run some basic automated browser tests. * Separate UI tests from normal unit test suite * Add UI tests to CI test script * Add testem and phantom to circleCI pre-script * Fix circle pre script * Move pre scripts to dependencies key * Remove phantom from build deps * Fix testem runner page * Add promise polyfill for PhantomJS * Skip PhantomJS in testem * Run browser tests in parallel * Fix promise usage? * Correct skip usage
Diffstat (limited to 'test/integration/tests.js')
-rw-r--r--test/integration/tests.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/integration/tests.js b/test/integration/tests.js
new file mode 100644
index 000000000..a3f3cd294
--- /dev/null
+++ b/test/integration/tests.js
@@ -0,0 +1,21 @@
+QUnit.test('agree to terms', function (assert) {
+ var done = assert.async()
+
+ // Select the mock app root
+ var app = $('iframe').contents().find('#app-content .mock-app-root')
+
+ // Agree to terms
+ app.find('button').click()
+
+ // Wait for view to transition:
+ wait().then(function() {
+
+ var title = app.find('h1').text()
+ assert.equal(title, 'MetaMask', 'title screen')
+
+ var buttons = app.find('button')
+ assert.equal(buttons.length, 2, 'two buttons: create and restore')
+
+ done()
+ })
+})