|
|
|
@ -3,25 +3,25 @@ import { NightwatchBrowser } from 'nightwatch' |
|
|
|
|
import init from '../helpers/init' |
|
|
|
|
|
|
|
|
|
const openReferences = (browser: NightwatchBrowser, path: string) => { |
|
|
|
|
(browser as any).useXpath() |
|
|
|
|
;(browser as any) |
|
|
|
|
.useXpath() |
|
|
|
|
.useXpath() |
|
|
|
|
.waitForElementVisible(path) |
|
|
|
|
.click(path) |
|
|
|
|
.perform(function () { |
|
|
|
|
const actions = this.actions({ async: true }); |
|
|
|
|
return actions. |
|
|
|
|
keyDown(this.Keys.SHIFT). |
|
|
|
|
sendKeys(this.Keys.F12) |
|
|
|
|
const actions = this.actions({async: true}) |
|
|
|
|
return actions.keyDown(this.Keys.SHIFT).sendKeys(this.Keys.F12) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
module.exports = { |
|
|
|
|
before: function (browser: NightwatchBrowser, done: VoidFunction) { |
|
|
|
|
'before': function (browser: NightwatchBrowser, done: VoidFunction) { |
|
|
|
|
init(browser, done, 'http://127.0.0.1:8080', false) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
'Should load the test file': function (browser: NightwatchBrowser) { |
|
|
|
|
browser.openFile('contracts') |
|
|
|
|
browser |
|
|
|
|
.openFile('contracts') |
|
|
|
|
.openFile('contracts/3_Ballot.sol') |
|
|
|
|
.waitForElementVisible('#editorView') |
|
|
|
|
.setEditorValue(BallotWithARefToOwner) |
|
|
|
@ -32,19 +32,21 @@ module.exports = { |
|
|
|
|
browser.scrollToLine(48) |
|
|
|
|
const path = "//*[@class='view-line' and contains(.,'length') and contains(.,'proposalNames')]//span//span[contains(.,'proposalNames')]" |
|
|
|
|
openReferences(browser, path) |
|
|
|
|
browser.waitForElementVisible("//*[@class='monaco-highlighted-label referenceMatch']//span[contains(.,'length; i++')]") |
|
|
|
|
.waitForElementVisible("//*[@class='monaco-highlighted-label referenceMatch']//span[contains(.,'name:')]") |
|
|
|
|
.waitForElementVisible("//*[@class='monaco-highlighted-label referenceMatch']//span[contains(.,'constructor')]") |
|
|
|
|
browser |
|
|
|
|
.waitForElementVisible("//*[@class='monaco-highlighted-label referenceMatch'][contains(.,'length; i++')]") |
|
|
|
|
.waitForElementVisible("//*[@class='monaco-highlighted-label referenceMatch'][contains(.,'name:')]") |
|
|
|
|
.waitForElementVisible("//*[@class='monaco-highlighted-label referenceMatch'][contains(.,'constructor')]") |
|
|
|
|
.keys(browser.Keys.ESCAPE) |
|
|
|
|
}, |
|
|
|
|
'Should show references of getOwner': function (browser: NightwatchBrowser) { |
|
|
|
|
browser.scrollToLine(39) |
|
|
|
|
const path = "//*[@class='view-line' and contains(.,'getOwner') and contains(.,'cowner')]//span//span[contains(.,'getOwner')]" |
|
|
|
|
openReferences(browser, path) |
|
|
|
|
browser.useXpath() |
|
|
|
|
.waitForElementVisible("//*[@class='monaco-highlighted-label']//span[contains(.,'2_Owner.sol')]") |
|
|
|
|
.waitForElementVisible("//*[@class='monaco-highlighted-label']//span[contains(.,'3_Ballot.sol')]") |
|
|
|
|
.waitForElementVisible("//*[@class='monaco-highlighted-label referenceMatch']//span[contains(.,'cowner.getOwner')]") |
|
|
|
|
browser |
|
|
|
|
.useXpath() |
|
|
|
|
.waitForElementVisible("//*[@class='monaco-highlighted-label'][contains(.,'2_Owner.sol')]") |
|
|
|
|
.waitForElementVisible("//*[@class='monaco-highlighted-label'][contains(.,'3_Ballot.sol')]") |
|
|
|
|
.waitForElementVisible("//*[@class='monaco-highlighted-label referenceMatch'][contains(.,'cowner.getOwner')]") |
|
|
|
|
.waitForElementVisible("//*[contains(@class, 'results-loaded') and contains(., 'References (2)')]") |
|
|
|
|
.keys(browser.Keys.ESCAPE) |
|
|
|
|
} |
|
|
|
|