Skip to content

Commit 200f9d3

Browse files
yann300Aniket-Engg
authored andcommitted
use click()
1 parent 92bede9 commit 200f9d3

File tree

5 files changed

+51
-47
lines changed

5 files changed

+51
-47
lines changed

apps/remix-ide-e2e/src/commands/addLocalPlugin.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import EventEmitter from 'events'
33
import { ExternalProfile, LocationProfile, Profile } from '@remixproject/plugin-utils'
44

55
class AddLocalPlugin extends EventEmitter {
6-
command (this: NightwatchBrowser, profile: Profile & LocationProfile & ExternalProfile): NightwatchBrowser {
6+
command (this: NightwatchBrowser, profile: Profile & LocationProfile & ExternalProfile, focus: boolean): NightwatchBrowser {
77
this.api.perform((done) => {
8-
addLocalPlugin(this.api, profile, () => {
8+
addLocalPlugin(this.api, profile, focus, () => {
99
done()
1010
this.emit('complete')
1111
})
@@ -14,7 +14,7 @@ class AddLocalPlugin extends EventEmitter {
1414
}
1515
}
1616

17-
function addLocalPlugin (browser: NightwatchBrowser, profile: Profile & LocationProfile & ExternalProfile, callback: VoidFunction) {
17+
function addLocalPlugin (browser: NightwatchBrowser, profile: Profile & LocationProfile & ExternalProfile, focus: boolean, callback: VoidFunction) {
1818
browser.waitForElementVisible('*[data-id="remixIdeSidePanel"]')
1919
.pause(3000).element('css selector', '*[data-id="pluginManagerComponentPluginManager"]', function (result) {
2020
if (result.status === 0) {
@@ -38,8 +38,13 @@ function addLocalPlugin (browser: NightwatchBrowser, profile: Profile & Location
3838
.click(profile.location === 'sidePanel' ? '*[data-id="localPluginRadioButtonsidePanel"]' : '*[data-id="localPluginRadioButtonmainPanel"]')
3939
.click('*[data-id="pluginManagerLocalPluginModalDialogModalDialogModalFooter-react"]')
4040
.click('*[data-id="pluginManagerLocalPluginModalDialog-modal-footer-ok-react')
41-
.waitForElementVisible('[data-id="verticalIconsKindlocalPlugin"]')
42-
.click('[data-id="verticalIconsKindlocalPlugin"]')
41+
.perform((done) => {
42+
if (focus) {
43+
browser.waitForElementVisible(`[data-id="verticalIconsKind${profile.name}"]`)
44+
.click(`[data-id="verticalIconsKind${profile.name}"]`)
45+
}
46+
done()
47+
})
4348
.perform(function () { callback() })
4449
}
4550

apps/remix-ide-e2e/src/tests/pluginManager.test.ts

Lines changed: 25 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,21 @@ const testData = {
1212
pluginUrl: 'https://zokrates.github.io/zokrates-remix-plugin/'
1313
}
1414

15+
const localPluginData = {
16+
name: testData.pluginName,
17+
displayName: testData.pluginDisplayName,
18+
canActivate: [],
19+
url: testData.pluginUrl,
20+
location: 'sidePanel'
21+
}
22+
1523
module.exports = {
24+
'@disabled': true,
1625
before: function (browser: NightwatchBrowser, done: VoidFunction) {
1726
init(browser, done, 'http://127.0.0.1:8080', false)
1827
},
1928

20-
'Should Load Plugin Manager': function (browser: NightwatchBrowser) {
29+
'Should Load Plugin Manager #group1': function (browser: NightwatchBrowser) {
2130
browser.waitForElementVisible('*[data-id="remixIdeSidePanel"]')
2231
.pause(3000)
2332
.click('*[plugin="pluginManager"]')
@@ -26,7 +35,7 @@ module.exports = {
2635
.assert.containsText('*[data-id="sidePanelSwapitTitle"]', 'PLUGIN MANAGER')
2736
},
2837

29-
'Should Search for plugins': function (browser: NightwatchBrowser) {
38+
'Should Search for plugins #group1': function (browser: NightwatchBrowser) {
3039
browser.waitForElementVisible('*[data-id="pluginManagerComponentPluginManager"]')
3140
.click('*[data-id="pluginManagerComponentSearchInput"]')
3241
.keys('debugger')
@@ -45,7 +54,7 @@ module.exports = {
4554
.keys(browser.Keys.BACK_SPACE)
4655
},
4756

48-
'Should activate plugins': function (browser: NightwatchBrowser) {
57+
'Should activate plugins #group1': function (browser: NightwatchBrowser) {
4958
browser.waitForElementVisible('*[data-id="pluginManagerComponentPluginManager"]')
5059
.click('*[data-id="pluginManagerComponentPluginManager"]')
5160
.scrollAndClick('*[data-id="pluginManagerComponentActivateButtondebugger"]')
@@ -57,7 +66,7 @@ module.exports = {
5766
.waitForElementVisible('*[data-id="pluginManagerComponentDeactivateButtonZoKrates"]', 60000)
5867
},
5968

60-
'Should deactivate plugins': function (browser: NightwatchBrowser) {
69+
'Should deactivate plugins #group1': function (browser: NightwatchBrowser) {
6170
browser.waitForElementVisible('*[data-id="pluginManagerComponentPluginManager"]')
6271
.click('*[data-id="pluginManagerComponentPluginManager"]')
6372
.waitForElementVisible('*[data-id="pluginManagerComponentDeactivateButtondebugger"]', 60000)
@@ -69,45 +78,23 @@ module.exports = {
6978
.waitForElementVisible('*[data-id="pluginManagerComponentActivateButtonvyper"]', 60000)
7079
},
7180

72-
'Should connect a local plugin': function (browser: NightwatchBrowser) {
73-
browser.waitForElementVisible('*[data-id="pluginManagerComponentPluginManager"]')
74-
.execute(function () {
75-
window.testmode = true
76-
})
77-
.click('*[data-id="pluginManagerComponentPluginSearchButton"]')
78-
.waitForElementVisible('*[data-id="pluginManagerLocalPluginModalDialogModalDialogContainer-react"]')
79-
.click('*[data-id="pluginManagerLocalPluginModalDialogModalDialogModalBody-react"]')
80-
.waitForElementVisible('*[data-id="localPluginName"]')
81-
.clearValue('*[data-id="localPluginName"]').setValue('*[data-id="localPluginName"]', testData.pluginName)
82-
.clearValue('*[data-id="localPluginDisplayName"]').setValue('*[data-id="localPluginDisplayName"]', testData.pluginDisplayName)
83-
.clearValue('*[data-id="localPluginUrl"]').setValue('*[data-id="localPluginUrl"]', testData.pluginUrl)
84-
.click('*[data-id="localPluginRadioButtoniframe"]')
85-
.click('*[data-id="localPluginRadioButtonsidePanel"]')
86-
.click('*[data-id="pluginManagerLocalPluginModalDialogModalDialogModalFooter-react"]')
87-
.click('*[data-id="pluginManagerLocalPluginModalDialog-modal-footer-ok-react')
81+
'Should connect a local plugin #group2': function (browser: NightwatchBrowser) {
82+
browser.waitForElementVisible('*[data-id="remixIdeSidePanel"]')
83+
.pause(3000)
84+
.click('*[plugin="pluginManager"]')
85+
.clickLaunchIcon('filePanel')
86+
.addLocalPlugin(localPluginData, false)
87+
.pause(2000)
8888
},
8989

90-
'Should display error message for creating already existing plugin': function (browser: NightwatchBrowser) {
90+
'Should display error message for creating already existing plugin #group2': function (browser: NightwatchBrowser) {
9191
browser.waitForElementVisible('*[data-id="pluginManagerComponentPluginManager"]')
92-
.click('*[data-id="pluginManagerComponentPluginSearchButton"]')
93-
.waitForElementVisible('*[data-id="pluginManagerLocalPluginModalDialogModalDialogContainer-react"]')
94-
.click('*[data-id="pluginManagerLocalPluginModalDialogModalDialogModalBody-react"]')
95-
.waitForElementVisible('*[data-id="localPluginName"]')
96-
.clearValue('*[data-id="localPluginName"]').setValue('*[data-id="localPluginName"]', testData.pluginName)
97-
.clearValue('*[data-id="localPluginDisplayName"]').setValue('*[data-id="localPluginDisplayName"]', testData.pluginDisplayName)
98-
.clearValue('*[data-id="localPluginUrl"]').setValue('*[data-id="localPluginUrl"]', testData.pluginUrl)
99-
.click('*[data-id="localPluginRadioButtoniframe"]')
100-
.click('*[data-id="localPluginRadioButtonsidePanel"]')
101-
.waitForElementVisible('*[data-id="pluginManagerLocalPluginModalDialog-modal-footer-ok-react"]', 60000)
102-
.click('*[data-id="pluginManagerLocalPluginModalDialog-modal-footer-ok-react"]')
103-
// .modalFooterOKClick()
104-
// .pause(2000)
105-
.waitForElementVisible('*[data-shared="tooltipPopup"]', 60000)
106-
.pause(5000)
107-
.assert.containsText('*[data-shared="tooltipPopup"]', 'Cannot create Plugin : This name has already been used')
92+
.clickLaunchIcon('filePanel')
93+
.addLocalPlugin(localPluginData, false)
94+
.waitForElementContainsText('*[data-shared="tooltipPopup"]', 'Cannot create Plugin : This name has already been used')
10895
},
10996

110-
'Should load back installed plugins after reload': function (browser: NightwatchBrowser) {
97+
'Should load back installed plugins after reload #group2': function (browser: NightwatchBrowser) {
11198
browser
11299
.waitForElementVisible('*[data-id="remixIdeSidePanel"]',3000)
113100
.waitForElementVisible('*[data-id="pluginManagerComponentPluginManager"]')
@@ -124,6 +111,5 @@ module.exports = {
124111
done()
125112
})
126113
})
127-
.end()
128114
}
129115
}

apps/remix-ide-e2e/src/tests/plugin_api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ module.exports = {
167167
},
168168

169169
'Should connect a local plugin': function (browser: NightwatchBrowser) {
170-
browser.addLocalPlugin(localPluginData)
170+
browser.addLocalPlugin(localPluginData, true)
171171
// @ts-ignore
172172
.frame(0).useXpath()
173173
},

apps/remix-ide-e2e/src/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ declare module 'nightwatch' {
6161
checkAnnotationsNotPresent(type: string): NightwatchBrowser
6262
getLastTransactionHash(callback: (hash: string) => void)
6363
currentWorkspaceIs(name: string): NightwatchBrowser
64-
addLocalPlugin(this: NightwatchBrowser, profile: Profile & LocationProfile & ExternalProfile): NightwatchBrowser
64+
addLocalPlugin(this: NightwatchBrowser, profile: Profile & LocationProfile & ExternalProfile, focus: boolean): NightwatchBrowser
6565
acceptAndRemember(this: NightwatchBrowser, remember: boolean, accept: boolean): NightwatchBrowser
6666
clearConsole(this: NightwatchBrowser): NightwatchBrowser
6767
clearTransactions(this: NightwatchBrowser): NightwatchBrowser

apps/remix-ide/src/assets/list.json

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1079,9 +1079,22 @@
10791079
"bzzr://6e70fe6bfe8c3fc63f8a3eba733731aab129e6e58828b78058e53bb50440709b",
10801080
"dweb:/ipfs/QmZy5ho8W943FMGwppXZFS1WFrVwV3UXhUUwcD7oH5vrYe"
10811081
]
1082+
},
1083+
{
1084+
"path": "soljson-v0.8.24+commit.e11b9ed9.js",
1085+
"version": "0.8.24",
1086+
"build": "commit.e11b9ed9",
1087+
"longVersion": "0.8.24+commit.e11b9ed9",
1088+
"keccak256": "0x1b6ceeabad21bbb2011ba13373160f7c4d46c11371a354243ee1be07159345f3",
1089+
"sha256": "0x11b054b55273ec55f6ab3f445eb0eb2c83a23fed43d10079d34ac3eabe6ed8b1",
1090+
"urls": [
1091+
"bzzr://c604bdd6384bf73594cd0e5cfbe979048191549ebc88e70996346f3b744c0680",
1092+
"dweb:/ipfs/QmW2SQbEhiz3n2qV5iL8WBgzapv6cXjkLStvTMpCZhvr2x"
1093+
]
10821094
}
10831095
],
10841096
"releases": {
1097+
"0.8.24": "soljson-v0.8.24+commit.e11b9ed9.js",
10851098
"0.8.23": "soljson-v0.8.23+commit.f704f362.js",
10861099
"0.8.22": "soljson-v0.8.22+commit.4fc1097e.js",
10871100
"0.8.21": "soljson-v0.8.21+commit.d9974bed.js",
@@ -1173,5 +1186,5 @@
11731186
"0.4.0": "soljson-v0.4.0+commit.acd334c9.js",
11741187
"0.3.6": "soljson-v0.3.6+commit.3fc68da5.js"
11751188
},
1176-
"latestRelease": "0.8.23"
1189+
"latestRelease": "0.8.24"
11771190
}

0 commit comments

Comments
 (0)