ts-node nightwatch setup

nightwatch-ts
ioedeveloper 4 years ago
parent 712bdfa83a
commit 696e5d0f4d
  1. 15
      apps/remix-ide-e2e/.eslintrc
  2. 83
      apps/remix-ide-e2e/nightwatch.ts
  3. 38
      apps/remix-ide-e2e/src/reports/sample.test.xml
  4. 0
      apps/remix-ide-e2e/src/tests/sample.test.js
  5. 9
      apps/remix-ide-e2e/tsconfig.e2e.json
  6. 8
      apps/remix-ide-e2e/tsconfig.json
  7. 4
      nx.json
  8. 2
      package.json
  9. 25
      workspace.json

@ -0,0 +1,15 @@
{
"rules": {},
"overrides": [
{
"files": ["src/plugins/index.js"],
"rules": {
"@typescript-eslint/no-var-requires": "off",
"no-undef": "off"
}
}
],
"extends": ["../../.eslintrc"],
"ignorePatterns": ["!**/*"]
}

@ -0,0 +1,83 @@
import * as fs from 'fs'
const crxFile = fs.readFileSync('apps/remix-ide/test-browser/extensions/chrome/metamask.crx')
const metamaskExtension = Buffer.from(crxFile).toString('base64')
module.exports = {
'src_folders': ['apps/remix-ide-e2e/src/tests'],
'output_folder': 'apps/remix-ide-e2e/src/reports',
'custom_commands_path': ['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
},
'screenshots': {
'enabled': true,
'path': 'apps/remix-ide-e2e/reports/screenshots',
'on_failure': true,
'on_error': true
},
'desiredCapabilities': {
'browserName': 'firefox',
'javascriptEnabled': true,
'acceptSslCerts': true
},
'exclude': ['apps/remix-ide-e2e/test-browser/tests/runAndDeploy.js']
},
'chrome': {
'desiredCapabilities': {
'browserName': 'chrome',
'javascriptEnabled': true,
'acceptSslCerts': true,
'goog:chromeOptions': {
'args': ['window-size=2560,1440', 'start-fullscreen']
}
}
},
'chrome-runAndDeploy': {
'desiredCapabilities': {
'browserName': 'chrome',
'javascriptEnabled': true,
'acceptSslCerts': true,
'goog:chromeOptions': {
'args': ['window-size=2560,1440', 'start-fullscreen'],
'extensions': [metamaskExtension]
}
}
},
'safari': {
'desiredCapabilities': {
'browserName': 'safari',
'javascriptEnabled': true,
'acceptSslCerts': true
}
},
'ie': {
'desiredCapabilities': {
'browserName': 'internet explorer',
'javascriptEnabled': true,
'acceptSslCerts': true
}
},
'firefox': {
'desiredCapabilities': {
'browserName': 'firefox',
'javascriptEnabled': true,
'acceptSslCerts': true
}
}
}
}

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8" ?>
<testsuites errors="0"
failures="0"
tests="0">
<testsuite name="sample.test"
errors="0" failures="0" hostname="" id="" package="sample.test" skipped="0"
tests="0" time="0" timestamp="">
<system-err>
Error: An error occurred while retrieving a new session: &#34;Connection refused to 127.0.0.1:4444&#34;. If the Webdriver/Selenium service is managed by Nightwatch, check if &#34;start_process&#34; is set to &#34;true&#34;.
at HttpRequest.EventEmitter.emit (domain.js:448:20)
at ClientRequest.EventEmitter.emit (domain.js:448:20)
at Socket.socketErrorListener (_http_client.js:392:9)
at Socket.EventEmitter.emit (domain.js:448:20)
</system-err>
<error message="An error occurred while retrieving a new session: &#34;Connection refused to 127.0.0.1:4444&#34;. If the Webdriver/Selenium service is managed by Nightwatch, check if &#34;start_process&#34; is set to &#34;true&#34;."><![CDATA[
Error: An error occurred while retrieving a new session: &#34;Connection refused to 127.0.0.1:4444&#34;. If the Webdriver/Selenium service is managed by Nightwatch, check if &#34;start_process&#34; is set to &#34;true&#34;.
at Selenium2Protocol.handleSessionCreateError (/Users/mac/Public/repos/ethereum/remix-project/node_modules/nightwatch/lib/transport/transport.js:103:15)
at HttpRequest.request.on.err (/Users/mac/Public/repos/ethereum/remix-project/node_modules/nightwatch/lib/transport/transport.js:158:32)
at HttpRequest.emit (events.js:198:13)
at HttpRequest.EventEmitter.emit (domain.js:448:20)
at ClientRequest.originalIssuer.on.args (/Users/mac/Public/repos/ethereum/remix-project/node_modules/nightwatch/lib/http/request.js:131:19)
at ClientRequest.emit (events.js:203:15)
at ClientRequest.EventEmitter.emit (domain.js:448:20)
at Socket.socketErrorListener (_http_client.js:392:9)
at Socket.emit (events.js:198:13)
at Socket.EventEmitter.emit (domain.js:448:20)
]]></error>
</testsuite>
</testsuites>

@ -0,0 +1,9 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"sourceMap": false,
"outDir": "../../dist/out-tsc",
"allowJs": true
},
"include": ["src/**/*.ts", "src/**/*.js"]
}

@ -0,0 +1,8 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"types": ["node"]
},
"include": ["**/*.ts", "**/*.js"]
}

@ -59,6 +59,10 @@
"remix-solidity",
"remix-tests"
]
},
"remix-ide-e2e": {
"tags": [],
"implicitDependencies": ["remix-ide"]
}
}
}

@ -239,7 +239,7 @@
"tap-spec": "^5.0.0",
"tape": "^4.13.3",
"ts-jest": "25.2.1",
"ts-node": "~7.0.0",
"ts-node": "^7.0.1",
"tslint": "~6.0.0",
"typescript": "~3.8.3",
"uglify-js": "^2.8.16",

@ -91,6 +91,31 @@
}
}
},
"remix-ide-e2e": {
"root": "apps/remix-ide-e2e",
"sourceRoot": "apps/remix-ide-e2e/src",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@nrwl/workspace:run-commands",
"options": {
"commands": [
{
"command": "node_modules/.bin/ts-node node_modules/.bin/nightwatch --config apps/remix-ide-e2e/nightwatch.ts apps/remix-ide-e2e/src/tests/sample.test.js --env chrome"
}
]
}
},
"lint": {
"builder": "@nrwl/linter:lint",
"options": {
"linter": "eslint",
"tsConfig": ["apps/remix-ide-e2e/tsconfig.e2e.json"],
"exclude": ["**/node_modules/**", "!apps/remix-ide-e2e/**/*"]
}
}
}
},
"remix-analyzer": {
"root": "libs/remix-analyzer",
"sourceRoot": "libs/remix-analyzer/src",

Loading…
Cancel
Save