auto complete test

editorcontextDummy
filip mertens 3 years ago
parent 7cd713d955
commit 004fb2bb15
  1. 87
      apps/remix-ide-e2e/src/tests/editorAutoComplete.test.ts

@ -16,19 +16,20 @@ module.exports = {
.waitForElementVisible('#editorView') .waitForElementVisible('#editorView')
.setEditorValue(BallotWithARefToOwner) .setEditorValue(BallotWithARefToOwner)
.pause(4000) // wait for the compiler to finish .pause(4000) // wait for the compiler to finish
.scrollToLine(37)
}, },
'Should put cursor at the end of a line': function (browser: NightwatchBrowser) { 'Should put cursor at the end of a line': function (browser: NightwatchBrowser) {
const path = "//*[@class='view-line' and contains(.,'new') and contains(.,'owner')]//span//span[contains(.,';')]" const path = "//*[@class='view-line' and contains(.,'new') and contains(.,'owner')]//span//span[contains(.,';')]"
browser.waitForElementVisible('#editorView') browser.waitForElementVisible('#editorView')
.useXpath() .useXpath()
.click(path).pause(1000) .click(path).pause(1000)
.perform(function () { .perform(function () {
const actions = this.actions({ async: true }); const actions = this.actions({ async: true });
return actions. return actions.
// right arrow key // right arrow key
sendKeys(this.Keys.ARROW_RIGHT). sendKeys(this.Keys.ARROW_RIGHT).
sendKeys(this.Keys.ARROW_RIGHT) sendKeys(this.Keys.ARROW_RIGHT)
}) })
}, },
'Should type and get msg + sender': function (browser: NightwatchBrowser) { 'Should type and get msg + sender': function (browser: NightwatchBrowser) {
browser. browser.
@ -54,13 +55,13 @@ module.exports = {
sendKeys(this.Keys.ENTER). sendKeys(this.Keys.ENTER).
sendKeys('co') sendKeys('co')
}) })
.waitForElementVisible(autoCompleteLineElement('chairperson')) .waitForElementVisible(autoCompleteLineElement('chairperson'))
.waitForElementVisible(autoCompleteLineElement('cowner')) .waitForElementVisible(autoCompleteLineElement('cowner'))
.waitForElementVisible(autoCompleteLineElement('constructor')) .waitForElementVisible(autoCompleteLineElement('constructor'))
.waitForElementVisible(autoCompleteLineElement('continue')) .waitForElementVisible(autoCompleteLineElement('continue'))
.waitForElementVisible(autoCompleteLineElement('contract')) .waitForElementVisible(autoCompleteLineElement('contract'))
.waitForElementVisible(autoCompleteLineElement('constant')) .waitForElementVisible(autoCompleteLineElement('constant'))
.click(autoCompleteLineElement('cowner')) .click(autoCompleteLineElement('cowner'))
}, },
'Perform dot completion on cowner': function (browser: NightwatchBrowser) { 'Perform dot completion on cowner': function (browser: NightwatchBrowser) {
browser.perform(function () { browser.perform(function () {
@ -68,13 +69,53 @@ module.exports = {
return actions. return actions.
sendKeys('.') sendKeys('.')
}) })
// publicly available functions // publicly available functions
.waitForElementVisible(autoCompleteLineElement('changeOwner')) .waitForElementVisible(autoCompleteLineElement('changeOwner'))
.waitForElementVisible(autoCompleteLineElement('getOwner')) .waitForElementVisible(autoCompleteLineElement('getOwner'))
// do not show private vars, functions & modifiers & events // do not show private vars, functions & modifiers & events
.waitForElementNotPresent(autoCompleteLineElement('private')) .waitForElementNotPresent(autoCompleteLineElement('private'))
.waitForElementNotPresent(autoCompleteLineElement('isOwner')) .waitForElementNotPresent(autoCompleteLineElement('isOwner'))
.waitForElementNotPresent(autoCompleteLineElement('ownerSet')) .waitForElementNotPresent(autoCompleteLineElement('ownerSet'))
.perform(function () {
const actions = this.actions({ async: true });
return actions.
sendKeys(this.Keys.ENTER).
sendKeys('msg.')
})
.waitForElementVisible(autoCompleteLineElement('sender'))
.click(autoCompleteLineElement('sender'))
.perform(function () {
const actions = this.actions({ async: true });
return actions.
// right arrow key
sendKeys(this.Keys.ARROW_RIGHT).
sendKeys(this.Keys.ARROW_RIGHT).
sendKeys(this.Keys.ENTER)
})
},
'Dot complete struct': function (browser: NightwatchBrowser) {
browser.perform(function () {
const actions = this.actions({ async: true });
return actions.
sendKeys(this.Keys.ENTER).
sendKeys('Proposal m')
})
.waitForElementVisible(autoCompleteLineElement('memory'))
.click(autoCompleteLineElement('memory'))
.perform(function () {
const actions = this.actions({ async: true });
return actions.
sendKeys(' p;').
sendKeys(this.Keys.ENTER).pause(2000).
sendKeys('p.')
})
.waitForElementVisible(autoCompleteLineElement('name'))
.waitForElementVisible(autoCompleteLineElement('voteCount'))
.perform(function () {
const actions = this.actions({ async: true });
return actions.
sendKeys(' =1;')
})
} }
} }

Loading…
Cancel
Save