From 4f12431d9c40620a55c69b0726a36759de3d03cb Mon Sep 17 00:00:00 2001 From: FranzPoize Date: Tue, 9 Feb 2016 20:30:18 +0100 Subject: [PATCH] fixing tests --- nightwatch.json | 3 ++- test/Views/toggling.views.js | 26 +++++++++++++------------- test/baseUI/topbar.test.js | 10 +++++----- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/nightwatch.json b/nightwatch.json index a778017f5..16015c979 100644 --- a/nightwatch.json +++ b/nightwatch.json @@ -29,7 +29,8 @@ "browserstack.user": "${BROWSERSTACK_USERNAME}", "browserstack.key": "${BROWSERSTACK_KEY}", "os": "WINDOWS", - "os_version": "8" + "os_version": "8", + "resolution": "1920x1080" } }, diff --git a/test/Views/toggling.views.js b/test/Views/toggling.views.js index c161ee10e..e64dbd66e 100644 --- a/test/Views/toggling.views.js +++ b/test/Views/toggling.views.js @@ -15,19 +15,19 @@ module.exports = { 'Should be able to toggle views': function (browser) { browser .elements('css selector', '#topbar > ul > li', function(result) { - browser.moveTo(result.value[3].ELEMENT) - .waitForElementVisible('#topbar > ul > li:nth-child(4) > ul', 2000) - .click('.top-bar-menu-item.is-icon-menu ul li:nth-child(1)') + browser.moveTo(result.value[2].ELEMENT) + .waitForElementVisible('#topbar > ul > li:nth-child(3) > ul', 2000) + .click('#topbar > ul > li:nth-child(3) > ul li:nth-child(2)') .waitForElementNotVisible('.prototypo-canvas', 2000) - .click('.top-bar-menu-item.is-icon-menu ul li:nth-child(1)') + .click('#topbar > ul > li:nth-child(3) > ul li:nth-child(2)') .waitForElementVisible('.prototypo-canvas', 2000) - .click('.top-bar-menu-item.is-icon-menu ul li:nth-child(2)') + .click('#topbar > ul > li:nth-child(3) > ul li:nth-child(3)') .waitForElementNotPresent('.prototypo-text', 2000) - .click('.top-bar-menu-item.is-icon-menu ul li:nth-child(2)') + .click('#topbar > ul > li:nth-child(3) > ul li:nth-child(3)') .waitForElementVisible('.prototypo-text', 2000) - .click('.top-bar-menu-item.is-icon-menu ul li:nth-child(3)') + .click('#topbar > ul > li:nth-child(3) > ul li:nth-child(4)') .waitForElementNotPresent('.prototypo-word', 2000) - .click('.top-bar-menu-item.is-icon-menu ul li:nth-child(3)') + .click('#topbar > ul > li:nth-child(3) > ul li:nth-child(4)') .waitForElementVisible('.prototypo-word', 2000); }); }, @@ -41,14 +41,14 @@ module.exports = { .waitForElementVisible('.prototypo-canvas', 2000); browser .elements('css selector', '#topbar > ul > li', function(result) { - browser.moveTo(result.value[3].ELEMENT) - .click('.top-bar-menu-item.is-icon-menu ul li:nth-child(3)') + browser.moveTo(result.value[2].ELEMENT) + .click('#topbar > ul > li:nth-child(3) > ul li:nth-child(4)') .waitForElementVisible('.prototypo-word', 2000) .click('.prototypo-canvas .close-button') .waitForElementNotPresent('.prototypo-canvas', 2000) - .moveTo(result.value[3].ELEMENT) - .click('.top-bar-menu-item.is-icon-menu ul li:nth-child(1)') - .click('.top-bar-menu-item.is-icon-menu ul li:nth-child(2)'); + .moveTo(result.value[2].ELEMENT) + .click('#topbar > ul > li:nth-child(3) > ul li:nth-child(2)') + .click('#topbar > ul > li:nth-child(3) > ul li:nth-child(3)'); }); }, }; diff --git a/test/baseUI/topbar.test.js b/test/baseUI/topbar.test.js index a33dddf46..e980255f2 100644 --- a/test/baseUI/topbar.test.js +++ b/test/baseUI/topbar.test.js @@ -15,7 +15,7 @@ module.exports = { 'Should contain File, Edit, toggle views and glyph list': function(browser) { browser .elements('css selector', '#topbar > ul > li', function(result) { - browser.assert.equal(result.value.length, 4); + browser.assert.equal(result.value.length, 8); }); }, 'Should display file menu' : function (browser) { @@ -35,16 +35,16 @@ module.exports = { 'Should display toggle views' : function (browser) { browser .elements('css selector', '#topbar > ul > li', function(result) { - browser.moveTo(result.value[3].ELEMENT) - .waitForElementVisible('#topbar > ul > li:nth-child(4) > ul', 2000); + browser.moveTo(result.value[2].ELEMENT) + .waitForElementVisible('#topbar > ul > li:nth-child(3) > ul', 2000); }); }, 'Should display glyph list': function (browser) { browser .elements('css selector', '#topbar > ul > li', function(result) { - browser.elementIdClick(result.value[2].ELEMENT) + browser.elementIdClick(result.value[4].ELEMENT) .waitForElementVisible('.glyph-list-glyphs', 2000) - .elementIdClick(result.value[2].ELEMENT) + .elementIdClick(result.value[4].ELEMENT) .waitForElementNotVisible('.glyph-list-glyphs', 2000).end(); }); },