Skip to content

Commit 74b018c

Browse files
ci-bothsy822
authored andcommitted
remove #pr and update e2e
1 parent f13d4c1 commit 74b018c

File tree

3 files changed

+44
-20
lines changed

3 files changed

+44
-20
lines changed

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

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,12 @@ class switchEnvironment extends EventEmitter {
6565
) => {
6666
const tryOne = (i: number) => {
6767
if (i >= labels.length) return onDone()
68+
const submenuXPath = `//span[contains(@class,'dropdown-item') and normalize-space()='${labels[i]}']`
69+
6870
browser
6971
.useXpath()
7072
.isPresent({
71-
selector: `//span[contains(@class,'dropdown-item') and normalize-space()='${labels[i]}']`,
73+
selector: submenuXPath,
7274
suppressNotFoundErrors: true,
7375
timeout: 0
7476
}, (present) => {
@@ -77,21 +79,30 @@ class switchEnvironment extends EventEmitter {
7779
return tryOne(i + 1)
7880
}
7981
browser
80-
.moveToElement(`//span[contains(@class,'dropdown-item') and normalize-space()='${labels[i]}']`, 5, 5)
81-
.pause(250)
82+
.execute(function(xpath) {
83+
const element = document.evaluate(xpath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue
84+
if (element) {
85+
const event = new MouseEvent('mouseover', { 'view': window, 'bubbles': true, 'cancelable': true })
86+
element.dispatchEvent(event)
87+
}
88+
},
89+
[submenuXPath]
90+
)
8291
.useCss()
83-
.isPresent({
84-
selector: `body .dropdown-menu.show [data-id="dropdown-item-${providerName}"]`,
85-
suppressNotFoundErrors: true,
86-
timeout: 1000
87-
}, (inPortal) => {
88-
if (inPortal.value) {
92+
.waitForElementVisible(
93+
`body .dropdown-menu.show [data-id="dropdown-item-${providerName}"]`,
94+
5000,
95+
undefined,
96+
false,
97+
(result) => {
98+
if (result.status === 0) {
8999
clickAndMaybeWait(browser, `body .dropdown-menu.show [data-id="dropdown-item-${providerName}"]`, providerName, shouldWait)
90100
onDone()
91101
} else {
92102
tryOne(i + 1)
93103
}
94-
})
104+
}
105+
)
95106
})
96107
}
97108
tryOne(0)

apps/remix-ide-e2e/src/tests/environment-account.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = {
1212
init(browser, done, null)
1313
},
1414

15-
'Should open submenu and close both menus on selection #group1 #pr': function (browser: NightwatchBrowser) {
15+
'Should open submenu and close both menus on selection #group1': function (browser: NightwatchBrowser) {
1616
browser
1717
.clickLaunchIcon('udapp')
1818
.waitForElementVisible('[data-id="settingsSelectEnvOptions"]')
@@ -24,7 +24,7 @@ module.exports = {
2424
.assert.containsText('[data-id="selected-provider-vm-cancun"]', 'Remix VM (Cancun)')
2525
},
2626

27-
'Should display sample accounts and balances #group1 #pr': function (browser: NightwatchBrowser) {
27+
'Should display sample accounts and balances #group1': function (browser: NightwatchBrowser) {
2828
browser
2929
.waitForElementVisible('[data-id="runTabSelectAccount"]')
3030
.click('[data-id="runTabSelectAccount"]')

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

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -141,15 +141,22 @@ const tests = {
141141
.clickLaunchIcon('filePanel')
142142
},
143143
'Should show fork states provider in environment dropdown & make txs using forked state #group1': function (browser: NightwatchBrowser) {
144+
const remixVMSpanXPath = "//span[contains(@class,'dropdown-item') and normalize-space()='Remix VM']"
144145
browser
145146
.clickLaunchIcon('udapp')
146147
.waitForElementVisible('[data-id="settingsSelectEnvOptions"]')
147148
.click('[data-id="settingsSelectEnvOptions"] button')
148-
.useXpath()
149-
.moveToElement("//span[contains(@class,'dropdown-item') and normalize-space()='Remix VM']", 5, 5)
150-
.useCss()
149+
.execute(function(xpath) {
150+
const element = document.evaluate(xpath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue
151+
if (element) {
152+
const event = new MouseEvent('mouseover', { 'view': window, 'bubbles': true, 'cancelable': true })
153+
element.dispatchEvent(event)
154+
}
155+
},
156+
[remixVMSpanXPath]
157+
)
151158
.waitForElementVisible(`[data-id="dropdown-item-vm-fs-forkedState_1"]`)
152-
.click('[data-id="settingsSelectEnvOptions"] button')
159+
.click('[data-id="settingsSelectEnvOptions"] button')
153160
.switchEnvironment('vm-prague')
154161
.openFile('contracts/1_Storage.sol')
155162
.clickLaunchIcon('solidity')
@@ -170,12 +177,18 @@ const tests = {
170177
.assert.elementPresent('*[data-id="selected-provider-vm-fs-forkedState_2"]')
171178

172179
.click('[data-id="settingsSelectEnvOptions"] button')
173-
.useXpath()
174-
.moveToElement("//span[contains(@class,'dropdown-item') and normalize-space()='Remix VM']", 5, 5)
175-
.useCss()
180+
.execute(function(xpath) {
181+
const element = document.evaluate(xpath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue
182+
if (element) {
183+
const event = new MouseEvent('mouseover', { 'view': window, 'bubbles': true, 'cancelable': true })
184+
element.dispatchEvent(event)
185+
}
186+
},
187+
[remixVMSpanXPath]
188+
)
189+
176190
.waitForElementVisible(`[data-id="dropdown-item-vm-fs-forkedState_2"]`)
177191
.click('[data-id="settingsSelectEnvOptions"] button')
178-
179192
.click('*[data-id="Deploy - transact (not payable)"]')
180193
.clickInstance(0)
181194
.clickFunction('store - transact (not payable)', { types: 'uint256 num', values: '"555"' })

0 commit comments

Comments
 (0)