From ed3128c7b7f5e168fa77d8e5cbf215117fe9bf1e Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Fri, 7 Feb 2020 04:04:40 +0000 Subject: [PATCH] Homepage e2e tests --- package.json | 1 + test-browser/tests/homepage.js | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 test-browser/tests/homepage.js diff --git a/package.json b/package.json index c85a1146c9..3ee19f8ec0 100644 --- a/package.json +++ b/package.json @@ -175,6 +175,7 @@ "nightwatch_local_console": "nightwatch ./test-browser/tests/console.js --config nightwatch.js --env chrome ", "nightwatch_local_gist": "nightwatch ./test-browser/tests/gist.js --config nightwatch.js --env chrome ", "nightwatch_local_workspace": "nightwatch ./test-browser/tests/workspace.js --config nightwatch.js --env chrome ", + "nightwatch_local_homepage": "nightwatch ./test-browser/tests/homepage.js --config nightwatch.js --env chrome ", "onchange": "onchange build/app.js -- npm-run-all lint", "prepublish": "mkdirp build; npm-run-all -ls downloadsolc_root build", "remixd": "remixd -s ./contracts --remix-ide http://127.0.0.1:8080", diff --git a/test-browser/tests/homepage.js b/test-browser/tests/homepage.js new file mode 100644 index 0000000000..722a4a6646 --- /dev/null +++ b/test-browser/tests/homepage.js @@ -0,0 +1,26 @@ +'use strict' +const init = require('../helpers/init') +const sauce = require('./sauce') + +module.exports = { + before: function (browser, done) { + init(browser, done, 'http://127.0.0.1:8080', false) + }, + 'Loads Icon\'s Panel': function (browser) { + browser.waitForElementVisible('#icon-panel', 10000) + .waitForElementVisible('#icon-panel > div > div[class^="homeIcon"]') + .waitForElementVisible('#fileExplorerIcons > div:nth-child(1)') + .waitForElementVisible('#settingsIcons > div:nth-child(1)') + .waitForElementVisible('#settingsIcons > div:nth-child(2)') + }, + + 'Loads Side Panel': function (browser) { + browser.waitForElementVisible('#side-panel') + .assert.containsText('h6[class^="swapitTitle"]', 'FILE EXPLORERS') + .waitForElementVisible('div[class^="treeview"]') + .waitForElementVisible('ul[key="browser"] > li:nth-child(4)') + .end() + }, + + tearDown: sauce +}