@ -1,3 +1,3 @@ |
||||
gist_token = <token> |
||||
account_passphrase = <passphrase> |
||||
account_password = <password> |
||||
gist_token=<token> |
||||
account_passphrase=<passphrase> |
||||
account_password=<password> |
@ -0,0 +1,3 @@ |
||||
{ |
||||
"presets": ["@babel/preset-env"] |
||||
} |
@ -0,0 +1 @@ |
||||
node_modules |
@ -1,3 +1,3 @@ |
||||
gist_token = <token> |
||||
account_passphrase = <passphrase> |
||||
account_password = <password> |
||||
gist_token=<token> |
||||
account_passphrase=<passphrase> |
||||
account_password=<password> |
||||
|
@ -0,0 +1,6 @@ |
||||
FROM nginx:alpine |
||||
WORKDIR / |
||||
|
||||
COPY ./temp_publish_docker/ /usr/share/nginx/html/ |
||||
|
||||
EXPOSE 80 |
@ -0,0 +1,28 @@ |
||||
# This dockerfile is to build each branch seperately (for dev purpouses) |
||||
FROM node:10 |
||||
# Create Remix user, don't use root! |
||||
# RUN yes | adduser --disabled-password remix && mkdir /app |
||||
# USER remix |
||||
|
||||
# #Now do remix stuff |
||||
# USER remix |
||||
WORKDIR /home/remix |
||||
|
||||
COPY ./ ./ |
||||
|
||||
RUN npm ci |
||||
RUN npm run build |
||||
|
||||
FROM nginx:alpine |
||||
WORKDIR / |
||||
|
||||
COPY --from=0 /home/remix/build/ /usr/share/nginx/html/build/ |
||||
COPY --from=0 /home/remix/index.html /usr/share/nginx/html/index.html |
||||
COPY --from=0 /home/remix/nginx.conf /etc/nginx/nginx.conf |
||||
COPY --from=0 /home/remix/assets/ /usr/share/nginx/html/assets/ |
||||
COPY --from=0 /home/remix/icon.png /usr/share/nginx/html/icon.png |
||||
COPY --from=0 /home/remix/background.js /usr/share/nginx/html/background.js |
||||
COPY --from=0 /home/remix/soljson.js /usr/share/nginx/html/soljson.js |
||||
COPY --from=0 /home/remix/package.json /usr/share/nginx/html/package.json |
||||
|
||||
EXPOSE 80 |
After Width: | Height: | Size: 32 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 43 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 4.4 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 408 B |
@ -0,0 +1,181 @@ |
||||
/* eslint-disable */ |
||||
ace.define("ace/theme/remixDark",["require","exports","module","ace/lib/dom"], function(acequire, exports, module) { |
||||
|
||||
exports.isDark = true; |
||||
exports.cssClass = "ace-remixDark"; |
||||
exports.cssText = ".ace-remixDark .ace_gutter {\ |
||||
background: #2a2c3f;\ |
||||
color: #8789a1;\ |
||||
border-right: 1px solid #282828;\ |
||||
}\ |
||||
.ace-remixDark .ace_gutter-cell.ace_warning {\ |
||||
background-image: none;\ |
||||
background: #FC0;\ |
||||
border-left: none;\ |
||||
padding-left: 0;\ |
||||
color: #000;\ |
||||
}\ |
||||
.ace-remixDark .ace_gutter-cell.ace_error {\ |
||||
background-position: -6px center;\ |
||||
background-image: none;\ |
||||
background: #F10;\ |
||||
border-left: none;\ |
||||
padding-left: 0;\ |
||||
color: #000;\ |
||||
}\ |
||||
.ace-remixDark .ace_print-margin {\ |
||||
border-left: 1px solid #555;\ |
||||
right: 0;\ |
||||
background: #1D1D1D;\ |
||||
}\ |
||||
.ace-remixDark {\ |
||||
background-color: #222336;\ |
||||
color: #a2a3bd;\ |
||||
}\ |
||||
.ace-remixDark .ace_cursor {\ |
||||
border-left: 2px solid #FFFFFF;\ |
||||
}\ |
||||
.ace-remixDark .ace_cursor.ace_overwrite {\ |
||||
border-left: 0px;\ |
||||
border-bottom: 1px solid #FFFFFF;\ |
||||
}\ |
||||
.ace-remixDark .ace_marker-layer .ace_selection {\ |
||||
background: #494836;\ |
||||
}\ |
||||
.ace-remixDark .ace_marker-layer .ace_step {\ |
||||
background: rgb(198, 219, 174);\ |
||||
}\ |
||||
.ace-remixDark .ace_marker-layer .ace_bracket {\ |
||||
margin: -1px 0 0 -1px;\ |
||||
border: 1px solid #FCE94F;\ |
||||
}\ |
||||
.ace-remixDark .ace_marker-layer .ace_active-line {\ |
||||
background: #363950;\ |
||||
}\ |
||||
.ace-remixDark .ace_gutter-active-line {\ |
||||
background-color: #363950;\ |
||||
}\ |
||||
.ace-remixDark .ace_invisible {\ |
||||
color: #404040;\ |
||||
}\ |
||||
.ace-remixDark .ace_rparen {\ |
||||
color: #d4d7ed;\ |
||||
}\ |
||||
.ace-remixDark .ace_lparen {\ |
||||
color: #d4d7ed;\ |
||||
}\ |
||||
.ace-remixDark .ace_keyword {\ |
||||
color:#ffa76d;\ |
||||
}\ |
||||
.ace-remixDark .ace_keyword.ace_operator {\ |
||||
color:#eceeff;\ |
||||
}\ |
||||
.ace-remixDark .ace_constant {\ |
||||
color:#1EDAFB;\ |
||||
}\ |
||||
.ace-remixDark .ace_constant.ace_language {\ |
||||
color:#FDC251;\ |
||||
}\ |
||||
.ace-remixDark .ace_constant.ace_library {\ |
||||
color:#8DFF0A;\ |
||||
}\ |
||||
.ace-remixDark .ace_constant.ace_numeric {\ |
||||
color:#eceeff;\ |
||||
}\ |
||||
.ace-remixDark .ace_invalid {\ |
||||
color:#FFFFFF;\ |
||||
background-color:#990000;\ |
||||
}\ |
||||
.ace-remixDark .ace_invalid.ace_deprecated {\ |
||||
color:#FFFFFF;\ |
||||
background-color:#990000;\ |
||||
}\ |
||||
.ace-remixDark .ace_support {\ |
||||
color: #999;\ |
||||
}\ |
||||
.ace-remixDark .ace_support.ace_function {\ |
||||
color:#3fe2a7;\ |
||||
}\ |
||||
.ace-remixDark .ace_function {\ |
||||
color:#3fe2a7;\ |
||||
}\ |
||||
.ace-remixDark .ace_string {\ |
||||
color:#eceeff;\ |
||||
}\ |
||||
.ace-remixDark .ace_comment {\ |
||||
color:#a7a7a7;\ |
||||
font-style:italic;\ |
||||
padding-bottom: 0px;\ |
||||
}\ |
||||
.ace-remixDark .ace_type {\ |
||||
color:#75ceef;\ |
||||
}]\ |
||||
.ace-remixDark .ace_visibility (\ |
||||
color:#f7d777;\ |
||||
)\ |
||||
.ace-remixDark .ace_identifier {\ |
||||
color:#bec1dd;\ |
||||
}\ |
||||
.ace-remixDark .ace_modifier {\ |
||||
color:#efff2f;\ |
||||
}\ |
||||
.ace-remixDark .ace-boolean {\ |
||||
color:#ff86ac;\ |
||||
}\ |
||||
.ace-remixDark .ace_statemutability {\ |
||||
color:#FFCC00;\ |
||||
}\ |
||||
.ace-remixDark .ace_variable {\ |
||||
color:#e0bb83;\ |
||||
}\ |
||||
.ace-remixDark .ace_meta.ace_tag {\ |
||||
color:#BE53E6;\ |
||||
}\ |
||||
.ace-remixDark .ace_entity.ace_other.ace_attribute-name {\ |
||||
color:#4aa8fd;\ |
||||
}\ |
||||
.ace-remixDark .ace_markup.ace_underline {\ |
||||
text-decoration: underline;\ |
||||
}\ |
||||
.ace-remixDark .ace_fold-widget {\ |
||||
text-align: center;\ |
||||
}\ |
||||
.ace-remixDark .ace_fold-widget:hover {\ |
||||
color: #777;\ |
||||
}\ |
||||
.ace-remixDark .ace_fold-widget.ace_start,\ |
||||
.ace-remixDark .ace_fold-widget.ace_end,\ |
||||
.ace-remixDark .ace_fold-widget.ace_closed{\ |
||||
background: none;\ |
||||
border: none;\ |
||||
box-shadow: none;\ |
||||
}\ |
||||
.ace-remixDark .ace_fold-widget.ace_start:after {\ |
||||
content: '▾'\ |
||||
}\ |
||||
.ace-remixDark .ace_fold-widget.ace_end:after {\ |
||||
content: '▴'\ |
||||
}\ |
||||
.ace-remixDark .ace_fold-widget.ace_closed:after {\ |
||||
content: '‣'\ |
||||
}\ |
||||
.ace-remixDark .ace_indent-guide {\ |
||||
border-right:1px dotted #333;\ |
||||
margin-right:-1px;\ |
||||
}\ |
||||
.ace-remixDark .ace_fold { \ |
||||
background: #222; \ |
||||
border-radius: 3px; \ |
||||
color: #7AF; \ |
||||
border: none; \ |
||||
}\ |
||||
.ace-remixDark .ace_fold:hover {\ |
||||
background: #CCC; \ |
||||
color: #000;\ |
||||
}\ |
||||
"; |
||||
|
||||
var dom = acequire("../lib/dom"); |
||||
dom.importCssString(exports.cssText, exports.cssClass); |
||||
|
||||
}); |
@ -0,0 +1,15 @@ |
||||
version: "3.7" |
||||
x-project-base: |
||||
&project-base |
||||
restart: always |
||||
networks: |
||||
- remixide |
||||
|
||||
networks: |
||||
remixide: |
||||
|
||||
services: |
||||
remixide: |
||||
build: |
||||
context: . |
||||
dockerfile: Dockerfile |
@ -0,0 +1,16 @@ |
||||
#!/bin/bash |
||||
set -e |
||||
|
||||
export TAG="$CIRCLE_BRANCH" |
||||
|
||||
if [ "$CIRCLE_BRANCH" == "master" ]; then |
||||
export TAG="latest"; |
||||
fi |
||||
|
||||
rm -rf temp_publish_docker |
||||
mkdir temp_publish_docker |
||||
cp -r $FILES_TO_PACKAGE temp_publish_docker |
||||
|
||||
docker login --username $DOCKER_USER --password $DOCKER_PASS |
||||
docker-compose -f docker-compose.yaml -f build.yaml build |
||||
docker push remixproject/remix-ide:$TAG |
@ -0,0 +1,18 @@ |
||||
version: "3.7" |
||||
x-project-base: |
||||
&project-base |
||||
restart: always |
||||
networks: |
||||
- remixide |
||||
|
||||
networks: |
||||
remixide: |
||||
|
||||
services: |
||||
remixide: |
||||
<<: *project-base |
||||
image: remixproject/remix-ide:$TAG |
||||
container_name: remixide-${TAG} |
||||
ports: |
||||
- 8080:80 |
||||
- 65520:65520 |
@ -0,0 +1,40 @@ |
||||
user nginx; |
||||
worker_processes 1; |
||||
|
||||
error_log /var/log/nginx/error.log warn; |
||||
pid /var/run/nginx.pid; |
||||
|
||||
events { |
||||
worker_connections 1024; |
||||
} |
||||
|
||||
http { |
||||
include /etc/nginx/mime.types; |
||||
default_type application/octet-stream; |
||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' |
||||
'$status $body_bytes_sent "$http_referer" ' |
||||
'"$http_user_agent" "$http_x_forwarded_for"'; |
||||
|
||||
access_log /var/log/nginx/access.log main; |
||||
|
||||
sendfile on; |
||||
keepalive_timeout 300; |
||||
gzip_disable "msie6"; |
||||
|
||||
include /etc/nginx/conf.d/*.conf; |
||||
|
||||
server { |
||||
listen 80 default_server; |
||||
listen [::]:80 default_server; |
||||
|
||||
root /usr/share/nginx/html; |
||||
|
||||
index index.html index.htm; |
||||
|
||||
server_name _; |
||||
|
||||
location / { |
||||
try_files $uri $uri/ /index.html; |
||||
} |
||||
} |
||||
} |
@ -1,48 +1,44 @@ |
||||
const semver = require('semver') |
||||
const minixhr = require('minixhr') |
||||
/* global Worker */ |
||||
|
||||
export const baseUrl = 'https://solc-bin.ethereum.org/bin' |
||||
export const baseURLBin = 'https://solc-bin.ethereum.org/bin' |
||||
export const baseURLWasm = 'https://solc-bin.ethereum.org/wasm' |
||||
|
||||
export const pathToURL = {} |
||||
|
||||
/** |
||||
* Retrieves the URL of the given compiler version |
||||
* @param version is the version of compiler with or without 'soljson-v' prefix and .js postfix |
||||
*/ |
||||
export function urlFromVersion (version) { |
||||
return `${baseUrl}/soljson-v${version}.js` |
||||
if (!version.startsWith('soljson-v')) version = 'soljson-v' + version |
||||
if (!version.endsWith('.js')) version = version + '.js' |
||||
return `${pathToURL[version]}/${version}` |
||||
} |
||||
|
||||
/** |
||||
* Checks if the worker can be used to load a compiler. |
||||
* checks a compiler whitelist, browser support and OS. |
||||
*/ |
||||
export function canUseWorker (selectedVersion) { |
||||
// Following restrictions should be deleted when Solidity will release fixed versions of compilers.
|
||||
// See https://github.com/ethereum/remix-ide/issues/2461
|
||||
const isChrome = !!window.chrome |
||||
const os = retrieveOS() |
||||
// define a whitelist for Linux
|
||||
const linuxWL = ['0.4.26', '0.5.3', '0.5.4', '0.5.5'] |
||||
const version = semver.coerce(selectedVersion) |
||||
// defining whitelist for chrome
|
||||
let isFromWhiteList = false |
||||
switch (os) { |
||||
case 'Windows': |
||||
isFromWhiteList = semver.gt(version, '0.5.2') || version === '0.4.26' |
||||
break |
||||
case 'Linux': |
||||
isFromWhiteList = semver.gt(version, '0.5.13') || linuxWL.includes(version) |
||||
break |
||||
default : |
||||
isFromWhiteList = true |
||||
} |
||||
return browserSupportWorker() && (!isChrome || (isChrome && isFromWhiteList)) |
||||
const isNightly = selectedVersion.includes('nightly') |
||||
return browserSupportWorker() && ( |
||||
semver.gt(version, '0.6.3') || |
||||
semver.gt(version, '0.3.6') && !isNightly |
||||
) |
||||
} |
||||
|
||||
function browserSupportWorker () { |
||||
return document.location.protocol !== 'file:' && Worker !== undefined |
||||
} |
||||
|
||||
function retrieveOS () { |
||||
let osName = 'Unknown OS' |
||||
if (navigator.platform.indexOf('Win') !== -1) { |
||||
osName = 'Windows' |
||||
} else if (navigator.platform.indexOf('Linux') !== -1) { |
||||
osName = 'Linux' |
||||
} |
||||
return osName |
||||
// returns a promise for minixhr
|
||||
export function promisedMiniXhr (url) { |
||||
return new Promise((resolve, reject) => { |
||||
minixhr(url, (json, event) => { |
||||
resolve({ json, event }) |
||||
}) |
||||
}) |
||||
} |
||||
|
@ -0,0 +1,17 @@ |
||||
'use strict' |
||||
var DropdownPanel = require('./DropdownPanel') |
||||
var yo = require('yo-yo') |
||||
|
||||
function FunctionPanel () { |
||||
this.basicPanel = new DropdownPanel('Function Stack', {json: true, displayContentOnly: false}) |
||||
} |
||||
|
||||
FunctionPanel.prototype.update = function (calldata) { |
||||
this.basicPanel.update(calldata) |
||||
} |
||||
|
||||
FunctionPanel.prototype.render = function () { |
||||
return yo`<div id="FunctionPanel">${this.basicPanel.render()}</div>` |
||||
} |
||||
|
||||
module.exports = FunctionPanel |
@ -0,0 +1,28 @@ |
||||
const EventEmitter = require('events') |
||||
|
||||
class NoWorkerErrorFor extends EventEmitter { |
||||
command (version) { |
||||
this.api.perform((done) => { |
||||
noWorkerErrorFor(this.api, version, () => { |
||||
done() |
||||
this.emit('complete') |
||||
}) |
||||
}) |
||||
return this |
||||
} |
||||
} |
||||
|
||||
function noWorkerErrorFor (browser, version, callback) { |
||||
browser |
||||
.setSolidityCompilerVersion(version) |
||||
.click('*[data-id="compilerContainerCompileBtn"]') |
||||
.waitForElementPresent('*[data-id="compilationFinishedWith_' + version + '"]', 10000) |
||||
.notContainsText('*[data-id="compiledErrors"]', 'worker error:undefined') |
||||
.notContainsText('*[data-id="compiledErrors"]', 'Uncaught RangeError: Maximum call stack size exceeded') |
||||
.notContainsText('*[data-id="compiledErrors"]', 'RangeError: Maximum call stack size exceeded') |
||||
.perform(() => { |
||||
callback() |
||||
}) |
||||
} |
||||
|
||||
module.exports = NoWorkerErrorFor |
@ -0,0 +1,100 @@ |
||||
'use strict' |
||||
var examples = require('../../src/app/editor/example-contracts') |
||||
var init = require('../helpers/init') |
||||
var sauce = require('./sauce') |
||||
|
||||
var sources = [ |
||||
{'browser/Untitled.sol': {content: examples.ballot.content}} |
||||
] |
||||
|
||||
module.exports = { |
||||
before: function (browser, done) { |
||||
init(browser, done) |
||||
}, |
||||
'@sources': function () { |
||||
return sources |
||||
}, |
||||
|
||||
'Should compile using "compileWithParamaters" API': function (browser) { |
||||
browser |
||||
.addFile('test_jsCompile.js', { content: jsCompile }) |
||||
.executeScript('remix.exeCurrent()') |
||||
.pause(5000) |
||||
.journalChildIncludes('"languageversion": "0.6.8+commit.0bbfe453"') |
||||
}, |
||||
|
||||
'Should update the compiler configuration with "setCompilerConfig" API': function (browser) { |
||||
browser |
||||
.addFile('test_updateConfiguration.js', { content: updateConfiguration }) |
||||
.executeScript('remix.exeCurrent()') |
||||
.pause(5000) |
||||
.addFile('test_updateConfiguration.sol', { content: simpleContract }) |
||||
.verifyContracts(['StorageTestUpdateConfiguration'], {wait: 5000, version: '0.6.8+commit.0bbfe453'}) |
||||
.end() |
||||
}, |
||||
|
||||
tearDown: sauce |
||||
} |
||||
|
||||
const simpleContract = `pragma solidity >=0.4.22 <0.7.0;
|
||||
|
||||
/** |
||||
* @title Storage |
||||
* @dev Store & retreive value in a variable |
||||
*/ |
||||
contract StorageTestUpdateConfiguration { |
||||
|
||||
uint256 number; |
||||
|
||||
/** |
||||
* @dev Store value in variable |
||||
* @param num value to store |
||||
*/ |
||||
function store(uint256 num) public { |
||||
number = num; |
||||
} |
||||
|
||||
/** |
||||
* @dev Return value
|
||||
* @return value of 'number' |
||||
*/ |
||||
function retreive() public view returns (uint256){ |
||||
return number; |
||||
} |
||||
} |
||||
|
||||
` |
||||
|
||||
const jsCompile = `(async () => {
|
||||
|
||||
try { |
||||
const contract = { |
||||
"storage.sol": {content : \`${simpleContract}\` }
|
||||
} |
||||
console.log('compile') |
||||
const params = { |
||||
optimize: false, |
||||
evmVersion: null, |
||||
language: 'Solidity', |
||||
version: '0.6.8+commit.0bbfe453' |
||||
} |
||||
const result = await remix.call('solidity', 'compileWithParameters', contract, params) |
||||
console.log('result ', result) |
||||
} catch (e) { |
||||
console.log(e.message)
|
||||
} |
||||
})()` |
||||
|
||||
const updateConfiguration = `(async () => {
|
||||
try {
|
||||
const params = { |
||||
optimize: false, |
||||
evmVersion: null, |
||||
language: 'Solidity', |
||||
version: '0.6.8+commit.0bbfe453' |
||||
} |
||||
await remix.call('solidity', 'setCompilerConfig', params) |
||||
} catch (e) { |
||||
console.log(e.message)
|
||||
} |
||||
})()` |
@ -0,0 +1,190 @@ |
||||
'use strict' |
||||
var init = require('../helpers/init') |
||||
var sauce = require('./sauce') |
||||
|
||||
module.exports = { |
||||
before: function (browser, done) { |
||||
init(browser, done) |
||||
}, |
||||
|
||||
'Should execute `file` api from file manager external api': function (browser) { |
||||
browser |
||||
.addFile('file.js', { content: executeFile }) |
||||
.executeScript(`remix.exeCurrent()`) |
||||
.pause(2000) |
||||
.journalLastChildIncludes('browser/file.js') |
||||
}, |
||||
|
||||
'Should execute `exists` api from file manager external api': function (browser) { |
||||
browser |
||||
.addFile('exists.js', { content: executeExists }) |
||||
.executeScript(`remix.exeCurrent()`) |
||||
.pause(2000) |
||||
.journalChildIncludes('browser/exists.js true') |
||||
.journalChildIncludes('browser/non-exists.js false') |
||||
}, |
||||
|
||||
'Should execute `open` api from file manager external api': function (browser) { |
||||
browser |
||||
.addFile('open.js', { content: executeOpen }) |
||||
.executeScript(`remix.exeCurrent()`) |
||||
.pause(2000) |
||||
.journalLastChildIncludes('browser/3_Ballot.sol') |
||||
}, |
||||
|
||||
'Should execute `writeFile` api from file manager external api': function (browser) { |
||||
browser |
||||
.addFile('writeFile.js', { content: executeWriteFile }) |
||||
.executeScript(`remix.exeCurrent()`) |
||||
.pause(2000) |
||||
.openFile('browser/new_contract.sol') |
||||
.assert.containsText('[data-id="editorInput"]', 'pragma solidity ^0.6.0') |
||||
}, |
||||
|
||||
'Should execute `readFile` api from file manager external api': function (browser) { |
||||
browser |
||||
.addFile('readFile.js', { content: executeReadFile }) |
||||
.executeScript(`remix.exeCurrent()`) |
||||
.pause(2000) |
||||
.journalLastChildIncludes('pragma solidity ^0.6.0') |
||||
}, |
||||
|
||||
'Should execute `copyFile` api from file manager external api': function (browser) { |
||||
browser |
||||
.addFile('copyFile.js', { content: executeCopyFile }) |
||||
.executeScript(`remix.exeCurrent()`) |
||||
.pause(2000) |
||||
.journalLastChildIncludes('pragma solidity >=0.4.22 <0.7.0;') |
||||
}, |
||||
|
||||
'Should execute `rename` api from file manager external api': function (browser) { |
||||
browser |
||||
.addFile('renameFile.js', { content: executeRename }) |
||||
.executeScript(`remix.exeCurrent()`) |
||||
.pause(2000) |
||||
.waitForElementPresent('[data-id="treeViewLibrowser/old_contract.sol"]') |
||||
}, |
||||
|
||||
'Should execute `mkdir` api from file manager external api': function (browser) { |
||||
browser |
||||
.addFile('mkdirFile.js', { content: executeMkdir }) |
||||
.executeScript(`remix.exeCurrent()`) |
||||
.pause(2000) |
||||
.waitForElementPresent('[data-id="treeViewLibrowser/Test_Folder"]') |
||||
}, |
||||
|
||||
'Should execute `readdir` api from file manager external api': function (browser) { |
||||
browser |
||||
.addFile('readdirFile.js', { content: executeReaddir }) |
||||
.executeScript(`remix.exeCurrent()`) |
||||
.pause(2000) |
||||
.journalLastChildIncludes('Test_Folder isDirectory true') |
||||
}, |
||||
|
||||
'Should execute `remove` api from file manager external api': function (browser) { |
||||
browser |
||||
.addFile('removeFile.js', { content: executeRemove }) |
||||
.executeScript(`remix.exeCurrent()`) |
||||
.pause(2000) |
||||
.waitForElementNotPresent('[data-id="treeViewLibrowser/old_contract.sol"]') |
||||
.end() |
||||
}, |
||||
|
||||
tearDown: sauce |
||||
} |
||||
|
||||
const executeFile = ` |
||||
const run = async () => { |
||||
const result = await remix.call('fileManager', 'file') |
||||
|
||||
console.log(result) |
||||
} |
||||
|
||||
run() |
||||
` |
||||
|
||||
const executeExists = ` |
||||
const run = async () => { |
||||
const result1 = await remix.call('fileManager', 'exists', 'browser/exists.js') |
||||
const result2 = await remix.call('fileManager', 'exists', 'browser/non-exists.js') |
||||
|
||||
console.log('browser/exists.js ' + result1) |
||||
console.log('browser/non-exists.js ' + result2) |
||||
} |
||||
|
||||
run() |
||||
` |
||||
|
||||
const executeOpen = ` |
||||
const run = async () => { |
||||
await remix.call('fileManager', 'open', 'browser/3_Ballot.sol') |
||||
const result = await remix.call('fileManager', 'file') |
||||
|
||||
console.log(result) |
||||
} |
||||
|
||||
run() |
||||
` |
||||
|
||||
const executeWriteFile = ` |
||||
const run = async () => { |
||||
await remix.call('fileManager', 'writeFile', 'browser/new_contract.sol', 'pragma solidity ^0.6.0') |
||||
} |
||||
|
||||
run() |
||||
` |
||||
|
||||
const executeReadFile = ` |
||||
const run = async () => { |
||||
const result = await remix.call('fileManager', 'readFile', 'browser/new_contract.sol') |
||||
|
||||
console.log(result) |
||||
} |
||||
|
||||
run() |
||||
` |
||||
|
||||
const executeCopyFile = ` |
||||
const run = async () => { |
||||
await remix.call('fileManager', 'copyFile', 'browser/3_Ballot.sol', 'browser/new_contract.sol') |
||||
const result = await remix.call('fileManager', 'readFile', 'browser/new_contract.sol') |
||||
|
||||
console.log(result) |
||||
} |
||||
|
||||
run() |
||||
` |
||||
|
||||
const executeRename = ` |
||||
const run = async () => { |
||||
await remix.call('fileManager', 'rename', 'browser/new_contract.sol', 'browser/old_contract.sol') |
||||
} |
||||
|
||||
run() |
||||
` |
||||
|
||||
const executeMkdir = ` |
||||
const run = async () => { |
||||
await remix.call('fileManager', 'mkdir', 'browser/Test_Folder/') |
||||
} |
||||
|
||||
run() |
||||
` |
||||
|
||||
const executeReaddir = ` |
||||
const run = async () => { |
||||
const result = await remix.call('fileManager', 'readdir', 'browser/') |
||||
|
||||
console.log('Test_Folder isDirectory ', result["Test_Folder"].isDirectory) |
||||
} |
||||
|
||||
run() |
||||
` |
||||
|
||||
const executeRemove = ` |
||||
const run = async () => { |
||||
await remix.call('fileManager', 'remove', 'browser/old_contract.sol') |
||||
} |
||||
|
||||
run() |
||||
` |