pull/5370/head
filip mertens 2 years ago
parent f7691a1daf
commit e4730ccb35
  1. 68
      apps/remix-ide-e2e/src/tests/editorHoverContext.test.ts

@ -15,13 +15,75 @@ module.exports = {
.useXpath() .useXpath()
.waitForElementVisible("//*[contains(text(),'BallotHoverTest')]") .waitForElementVisible("//*[contains(text(),'BallotHoverTest')]")
.click("//*[contains(text(),'BallotHoverTest')]") .click("//*[contains(text(),'BallotHoverTest')]")
.moveToElement("//*[contains(text(),'BallotHoverTest')]", 0, 0) //.moveToElement("//*[contains(text(),'BallotHoverTest')]", 0, 0)
.useCss()
.findElements('.view-line', function (res) {
if (Array.isArray(res.value)) {
let found = false
for (const jsonWebElement of res.value) {
const jsonWebElementId = jsonWebElement.ELEMENT || jsonWebElement[Object.keys(jsonWebElement)[0]]
if (!found) {
browser.elementIdText(jsonWebElementId, (jsonElement) => {
const text = jsonElement.value
if (typeof text == 'string') {
if (text.indexOf('contract BallotHoverTest') !== -1) {
console.log(text)
console.log(jsonWebElementId)
browser
browser.moveTo(jsonWebElementId, 0, 0).pause(20000)
found = true
}
}
}
)
}
}
/*
res.value.forEach(function (jsonWebElement) {
browser.elementIdText(jsonWebElementId, (jsonElement) => {
const text = jsonElement.value
if (typeof text == 'string') {
if (text.indexOf('contract BallotHoverTest') !== -1) {
console.log(text)
console.log(jsonWebElementId)
browser.moveTo(jsonWebElementId, 0, 0).pause(20000)
}
}
})
})*/
}
})
/*
.useCss() .useCss()
.waitForElementContainsText('.monaco-hover-content', 'contract BallotHoverTest is BallotHoverTest') .waitForElementContainsText('.monaco-hover-content', 'contract BallotHoverTest is BallotHoverTest')
.waitForElementContainsText('.monaco-hover-content', 'contracts/3_Ballot.sol 10:0') .waitForElementContainsText('.monaco-hover-content', 'contracts/3_Ballot.sol 10:0')
.waitForElementContainsText('.monaco-hover-content', '@title Ballot') .waitForElementContainsText('.monaco-hover-content', '@title Ballot')
const elements = browser.findElements('.view-line') .findElements('.view-line', function (res) {
elements.forEach(item => console.log('Element Id:', item.getText())); Array.isArray(res.value) && res.value.forEach(function (jsonWebElement) {
const jsonWebElementId = jsonWebElement.ELEMENT || jsonWebElement[Object.keys(jsonWebElement)[0]]
browser.elementIdText(jsonWebElementId, (jsonElement) => {
const text = jsonElement.value
if (typeof text == 'string') {
if (text.indexOf('address public chairperson;') !== -1) {
console.log(jsonWebElementId)
browser.moveTo(jsonWebElementId, 20, 0).pause(20000)
}
}
})
})
})
*/
} }
} }

Loading…
Cancel
Save