parent
4270fc5c5f
commit
36dfcad8a9
@ -0,0 +1,27 @@ |
|||||||
|
import { NightwatchBrowser } from 'nightwatch' |
||||||
|
|
||||||
|
|
||||||
|
module.exports = { |
||||||
|
before: function (browser: NightwatchBrowser, done: VoidFunction) { |
||||||
|
done() |
||||||
|
}, |
||||||
|
'clone a repo': function (browser: NightwatchBrowser) { |
||||||
|
browser |
||||||
|
.waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000) |
||||||
|
.waitForElementVisible('button[data-id="landingPageImportFromGit"]') |
||||||
|
.click('button[data-id="landingPageImportFromGit"]') |
||||||
|
.pause(1000) |
||||||
|
.waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]') |
||||||
|
.click('[data-id="fileSystemModalDialogModalBody-react"]') |
||||||
|
.waitForElementVisible('[data-id="modalDialogCustomPromptTextClone"]') |
||||||
|
.setValue('[data-id="modalDialogCustomPromptTextClone"]', 'https://github.com/ethereum/awesome-remix') |
||||||
|
.click('[data-id="fileSystem-modal-footer-ok-react"]') |
||||||
|
.pause(3000) |
||||||
|
.windowHandles(function (result) { |
||||||
|
console.log(result.value) |
||||||
|
browser.switchWindow(result.value[1]) |
||||||
|
.waitForElementVisible('*[data-id="treeViewLitreeViewItem.git"]') |
||||||
|
}) |
||||||
|
.end() |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,33 @@ |
|||||||
|
import { NightwatchBrowser } from 'nightwatch' |
||||||
|
|
||||||
|
|
||||||
|
module.exports = { |
||||||
|
before: function (browser: NightwatchBrowser, done: VoidFunction) { |
||||||
|
done() |
||||||
|
}, |
||||||
|
'open default template': function (browser: NightwatchBrowser) { |
||||||
|
browser |
||||||
|
.waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000) |
||||||
|
.waitForElementVisible('button[data-id="landingPageImportFromTemplate"]') |
||||||
|
.click('button[data-id="landingPageImportFromTemplate"]') |
||||||
|
.waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]') |
||||||
|
.waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') |
||||||
|
.click('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') |
||||||
|
.pause(3000) |
||||||
|
.windowHandles(function (result) { |
||||||
|
console.log(result.value) |
||||||
|
browser.switchWindow(result.value[1]) |
||||||
|
.waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]') |
||||||
|
.click('*[data-id="treeViewLitreeViewItemtests"]') |
||||||
|
.waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts"]') |
||||||
|
.click('*[data-id="treeViewLitreeViewItemcontracts"]') |
||||||
|
.waitForElementVisible('[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]') |
||||||
|
.openFile('contracts/1_Storage.sol') |
||||||
|
.waitForElementVisible('*[id="editorView"]', 10000) |
||||||
|
.getEditorValue((content) => { |
||||||
|
browser.assert.ok(content.includes('function retrieve() public view returns (uint256){')) |
||||||
|
}) |
||||||
|
}) |
||||||
|
.end() |
||||||
|
} |
||||||
|
} |
@ -1,13 +0,0 @@ |
|||||||
import { NightwatchBrowser } from 'nightwatch' |
|
||||||
|
|
||||||
|
|
||||||
module.exports = { |
|
||||||
before: function (browser: NightwatchBrowser, done: VoidFunction) { |
|
||||||
done() |
|
||||||
}, |
|
||||||
'open app': function (browser: NightwatchBrowser) { |
|
||||||
browser |
|
||||||
.pause() |
|
||||||
.end() |
|
||||||
} |
|
||||||
} |
|
Loading…
Reference in new issue