Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- checkout
- run: npm install
- run: npm run lint
# - run: npm run lint remix-ide-e2e
- run: npm run lint remix-ide-e2e
- run: npm run build:libs
- run: npm run build
- run:
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
- checkout
- run: npm install
- run: npm run lint
# - run: npm run lint remix-ide-e2e
- run: npm run lint remix-ide-e2e
- run: npm run build:libs
- run: npm run build
- run:
Expand Down Expand Up @@ -126,7 +126,7 @@ jobs:
- checkout
- run: npm install
- run: npm run lint
# - run: npm run lint remix-ide-e2e
- run: npm run lint remix-ide-e2e
- run: npm run build:libs
- run: npm run build
- run:
Expand Down
4 changes: 3 additions & 1 deletion apps/remix-ide-e2e/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"files": ["**/*.ts"],
"rules": {
"no-undef": "off",
"@typescript-eslint/no-var-requires": 0
"@typescript-eslint/no-var-requires": 0,
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error"
}
}
],
Expand Down
100 changes: 50 additions & 50 deletions apps/remix-ide-e2e/nightwatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,79 +4,79 @@ const crxFile = fs.readFileSync('apps/remix-ide-e2e/src/extensions/chrome/metama
const metamaskExtension = Buffer.from(crxFile).toString('base64')

module.exports = {
'src_folders': ['dist/apps/remix-ide-e2e/src/tests'],
'output_folder': './reports/tests',
'custom_commands_path': ['dist/apps/remix-ide-e2e/src/commands'],
'custom_assertions_path': '',
'page_objects_path': '',
'globals_path': '',
src_folders: ['dist/apps/remix-ide-e2e/src/tests'],
output_folder: './reports/tests',
custom_commands_path: ['dist/apps/remix-ide-e2e/src/commands'],
custom_assertions_path: '',
page_objects_path: '',
globals_path: '',

'test_settings': {
'default': {
'selenium_port': 4444,
'selenium_host': 'localhost',
'globals': {
'waitForConditionTimeout': 10000,
'asyncHookTimeout': 100000
test_settings: {
default: {
selenium_port: 4444,
selenium_host: 'localhost',
globals: {
waitForConditionTimeout: 10000,
asyncHookTimeout: 100000
},
'screenshots': {
'enabled': true,
'path': './reports/screenshots',
'on_failure': true,
'on_error': true
screenshots: {
enabled: true,
path: './reports/screenshots',
on_failure: true,
on_error: true
},
'desiredCapabilities': {
'browserName': 'firefox',
'javascriptEnabled': true,
'acceptSslCerts': true
desiredCapabilities: {
browserName: 'firefox',
javascriptEnabled: true,
acceptSslCerts: true
},
'exclude': ['dist/apps/remix-ide-e2e/src/tests/runAndDeploy.js']
exclude: ['dist/apps/remix-ide-e2e/src/tests/runAndDeploy.js']
},

'chrome': {
'desiredCapabilities': {
'browserName': 'chrome',
'javascriptEnabled': true,
'acceptSslCerts': true,
chrome: {
desiredCapabilities: {
browserName: 'chrome',
javascriptEnabled: true,
acceptSslCerts: true,
'goog:chromeOptions': {
'args': ['window-size=2560,1440', 'start-fullscreen']
args: ['window-size=2560,1440', 'start-fullscreen']
}
}
},

'chrome-runAndDeploy': {
'desiredCapabilities': {
'browserName': 'chrome',
'javascriptEnabled': true,
'acceptSslCerts': true,
desiredCapabilities: {
browserName: 'chrome',
javascriptEnabled: true,
acceptSslCerts: true,
'goog:chromeOptions': {
'args': ['window-size=2560,1440', 'start-fullscreen'],
'extensions': [metamaskExtension]
args: ['window-size=2560,1440', 'start-fullscreen'],
extensions: [metamaskExtension]
}
}
},

'safari': {
'desiredCapabilities': {
'browserName': 'safari',
'javascriptEnabled': true,
'acceptSslCerts': true
safari: {
desiredCapabilities: {
browserName: 'safari',
javascriptEnabled: true,
acceptSslCerts: true
}
},

'ie': {
'desiredCapabilities': {
'browserName': 'internet explorer',
'javascriptEnabled': true,
'acceptSslCerts': true
ie: {
desiredCapabilities: {
browserName: 'internet explorer',
javascriptEnabled: true,
acceptSslCerts: true
}
},

'firefox': {
'desiredCapabilities': {
'browserName': 'firefox',
'javascriptEnabled': true,
'acceptSslCerts': true
firefox: {
desiredCapabilities: {
browserName: 'firefox',
javascriptEnabled: true,
acceptSslCerts: true
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from "events"
import EventEmitter from 'events'

class addAtAddressInstance extends EventEmitter {
command (this: NightwatchBrowser, address: string, isValidFormat: boolean, isValidChecksum: boolean): NightwatchBrowser {
Expand All @@ -19,7 +19,7 @@ function addInstance (browser: NightwatchBrowser, address: string, isValidFormat
.execute(function () {
const ret = document.querySelector('div[class^="modal-body"] div').innerHTML
const modal = document.querySelector('#modal-footer-ok') as HTMLElement

modal.click()
return ret
}, [], function (result) {
Expand Down
2 changes: 1 addition & 1 deletion apps/remix-ide-e2e/src/commands/addFile.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NightwatchBrowser, NightwatchContractContent } from 'nightwatch'
import EventEmitter from "events"
import EventEmitter from 'events'

class AddFile extends EventEmitter {
command (this: NightwatchBrowser, name: string, content: NightwatchContractContent): NightwatchBrowser {
Expand Down
4 changes: 2 additions & 2 deletions apps/remix-ide-e2e/src/commands/checkVariableDebug.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NightwatchBrowser, NightwatchCheckVariableDebugValue } from 'nightwatch'
import EventEmitter from "events"
import EventEmitter from 'events'

const deepequal = require('deep-equal')

Expand All @@ -16,7 +16,7 @@ class CheckVariableDebug extends EventEmitter {
}

function checkDebug (browser: NightwatchBrowser, id: string, debugValue: NightwatchCheckVariableDebugValue, done: VoidFunction) {
// id is soliditylocals or soliditystate
// id is soliditylocals or soliditystate
browser.execute(function (id: string) {
const elem = document.querySelector('#' + id + ' .dropdownrawcontent') as HTMLElement

Expand Down
2 changes: 1 addition & 1 deletion apps/remix-ide-e2e/src/commands/clearEditableContent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function clearContent (browser: NightwatchBrowser, cssSelector: string, callback
selection.addRange(range)
}, [cssSelector], function () {
browser.sendKeys(cssSelector, browser.Keys.BACK_SPACE)
.pause(5000)
.pause(5000)
callback()
})
}
Expand Down
14 changes: 7 additions & 7 deletions apps/remix-ide-e2e/src/commands/clickElementAtPosition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ class ClickElement extends EventEmitter {

function _clickElement (browser: NightwatchBrowser, cssSelector: string, index: number, cb: VoidFunction) {
browser.waitForElementPresent(cssSelector)
.execute(function (cssSelector: string, index: number) {
const elem = document.querySelectorAll(cssSelector)[index] as HTMLElement
elem.click()
}, [cssSelector, index], function () {
cb()
})
.execute(function (cssSelector: string, index: number) {
const elem = document.querySelectorAll(cssSelector)[index] as HTMLElement

elem.click()
}, [cssSelector, index], function () {
cb()
})
}

module.exports = ClickElement
30 changes: 15 additions & 15 deletions apps/remix-ide-e2e/src/commands/clickFunction.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import { NightwatchBrowser, NightwatchClickFunctionExpectedInput } from 'nightwatch'
import EventEmitter from "events"
import EventEmitter from 'events'

class ClickFunction extends EventEmitter {
command (this: NightwatchBrowser, fnFullName: string, expectedInput?: NightwatchClickFunctionExpectedInput): NightwatchBrowser {
this.api.waitForElementPresent('.instance button[title="' + fnFullName + '"]')
.perform(function (client, done) {
client.execute(function () {
document.querySelector('#runTabView').scrollTop = document.querySelector('#runTabView').scrollHeight
}, [], function () {
if (expectedInput) {
client.setValue('#runTabView input[title="' + expectedInput.types + '"]', expectedInput.values, _ => _)
}
done()
.perform(function (client, done) {
client.execute(function () {
document.querySelector('#runTabView').scrollTop = document.querySelector('#runTabView').scrollHeight
}, [], function () {
if (expectedInput) {
client.setValue('#runTabView input[title="' + expectedInput.types + '"]', expectedInput.values, _ => _)
}
done()
})
})
.scrollAndClick('.instance button[title="' + fnFullName + '"]')
.pause(2000)
.perform(() => {
this.emit('complete')
})
})
.scrollAndClick('.instance button[title="' + fnFullName + '"]')
.pause(2000)
.perform(() => {
this.emit('complete')
})
return this
}
}
Expand Down
2 changes: 1 addition & 1 deletion apps/remix-ide-e2e/src/commands/clickInstance.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from "events"
import EventEmitter from 'events'

class ClickInstance extends EventEmitter {
command (this: NightwatchBrowser, index: number): NightwatchBrowser {
Expand Down
4 changes: 2 additions & 2 deletions apps/remix-ide-e2e/src/commands/clickLaunchIcon.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NightwatchBrowser } from "nightwatch"
import EventEmitter from "events"
import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from 'events'

class ClickLaunchIcon extends EventEmitter {
command (this: NightwatchBrowser, icon: string): NightwatchBrowser {
Expand Down
10 changes: 5 additions & 5 deletions apps/remix-ide-e2e/src/commands/createContract.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NightwatchBrowser } from "nightwatch"
import EventEmitter from "events"
import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from 'events'

class CreateContract extends EventEmitter {
command (this: NightwatchBrowser, inputParams: string): NightwatchBrowser {
Expand All @@ -20,9 +20,9 @@ function createContract (browser: NightwatchBrowser, inputParams: string, callba
})
} else {
browser
.click('#runTabView button[class^="instanceButton"]')
.pause(500)
.perform(function () { callback() })
.click('#runTabView button[class^="instanceButton"]')
.pause(500)
.perform(function () { callback() })
}
}

Expand Down
6 changes: 3 additions & 3 deletions apps/remix-ide-e2e/src/commands/debugTransaction.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NightwatchBrowser } from "nightwatch"
import EventEmitter from "events"
import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from 'events'

class debugTransaction extends EventEmitter {
command (this: NightwatchBrowser, index = 0): NightwatchBrowser {
Expand All @@ -19,7 +19,7 @@ function checkStyle (browser: NightwatchBrowser, index: number, callback: VoidFu

debugBtn && debugBtn.click()
}, [index], function () {
browser.waitForElementVisible('*[data-id="buttonNavigatorJumpPreviousBreakpoint"]').perform(() => callback())
browser.waitForElementVisible('*[data-id="buttonNavigatorJumpPreviousBreakpoint"]').perform(() => callback())
})
}

Expand Down
4 changes: 2 additions & 2 deletions apps/remix-ide-e2e/src/commands/editorScroll.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NightwatchBrowser } from "nightwatch"
import EventEmitter from "events"
import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from 'events'

// fix for editor scroll
class ScrollEditor extends EventEmitter {
Expand Down
4 changes: 2 additions & 2 deletions apps/remix-ide-e2e/src/commands/executeScript.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NightwatchBrowser } from "nightwatch"
import EventEmitter from "events"
import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from 'events'

class ExecuteScript extends EventEmitter {
command (this: NightwatchBrowser, script: string): NightwatchBrowser {
Expand Down
20 changes: 10 additions & 10 deletions apps/remix-ide-e2e/src/commands/getAddressAtPosition.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NightwatchBrowser } from "nightwatch"
import EventEmitter from "events"
import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from 'events'

class GetAddressAtPosition extends EventEmitter {
command (this: NightwatchBrowser, index: number, cb: (pos: string) => void): NightwatchBrowser {
Expand All @@ -16,16 +16,16 @@ class GetAddressAtPosition extends EventEmitter {

function getAddressAtPosition (browser: NightwatchBrowser, index: number, callback: (pos: string) => void) {
browser.waitForElementPresent('*[data-shared="universalDappUiInstance"]')
.execute(function (index) {
const deployedContracts = document.querySelectorAll('*[data-shared="universalDappUiInstance"]')
const id = deployedContracts[index].getAttribute('id')
.execute(function (index) {
const deployedContracts = document.querySelectorAll('*[data-shared="universalDappUiInstance"]')
const id = deployedContracts[index].getAttribute('id')

return id.replace('instance', '')
}, [index], function (result) {
const pos = typeof result.value === 'string' ? result.value : null
return id.replace('instance', '')
}, [index], function (result) {
const pos = typeof result.value === 'string' ? result.value : null

callback(pos)
})
callback(pos)
})
}

module.exports = GetAddressAtPosition
6 changes: 3 additions & 3 deletions apps/remix-ide-e2e/src/commands/getEditorValue.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { NightwatchBrowser } from "nightwatch"
import EventEmitter from "events"
import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from 'events'

class GetEditorValue extends EventEmitter {
command (this: NightwatchBrowser, callback: (content: string) => void): NightwatchBrowser {
this.api.perform((client, done) => {
this.api.execute(function () {
const elem: any = document.getElementById('input')
const elem: any = document.getElementById('input')

return elem.editor.getValue()
}, [], (result) => {
Expand Down
Loading