mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
development - screens - use localhost for network
This commit is contained in:
parent
5f1f345a5d
commit
b014133fdc
@ -35,6 +35,7 @@ async function captureAllScreens() {
|
|||||||
tabs = await driver.getAllWindowHandles()
|
tabs = await driver.getAllWindowHandles()
|
||||||
await driver.switchTo().window(tabs[0])
|
await driver.switchTo().window(tabs[0])
|
||||||
await delay(300)
|
await delay(300)
|
||||||
|
await setProviderType('localhost')
|
||||||
|
|
||||||
// click try new ui
|
// click try new ui
|
||||||
await driver.findElement(By.css('#app-content > div > div.app-primary.from-right > div > div.flex-row.flex-center.flex-grow > p')).click()
|
await driver.findElement(By.css('#app-content > div > div.app-primary.from-right > div > div.flex-row.flex-center.flex-grow > p')).click()
|
||||||
@ -42,8 +43,12 @@ async function captureAllScreens() {
|
|||||||
|
|
||||||
// close metamask homepage and extra home.html
|
// close metamask homepage and extra home.html
|
||||||
tabs = await driver.getAllWindowHandles()
|
tabs = await driver.getAllWindowHandles()
|
||||||
await driver.switchTo().window(tabs[2])
|
console.log(tabs)
|
||||||
driver.close()
|
// metamask homepage is opened on prod, not dev
|
||||||
|
if (tabs.length > 2) {
|
||||||
|
await driver.switchTo().window(tabs[2])
|
||||||
|
driver.close()
|
||||||
|
}
|
||||||
await driver.switchTo().window(tabs[1])
|
await driver.switchTo().window(tabs[1])
|
||||||
driver.close()
|
driver.close()
|
||||||
await driver.switchTo().window(tabs[0])
|
await driver.switchTo().window(tabs[0])
|
||||||
@ -159,7 +164,11 @@ async function captureAllScreens() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function setLocale(code) {
|
async function setLocale(code) {
|
||||||
await driver.executeScript('setLocale(arguments[0])', code)
|
await driver.executeScript('window.metamask.updateCurrentLocale(arguments[0])', code)
|
||||||
|
}
|
||||||
|
|
||||||
|
async function setProviderType(type) {
|
||||||
|
await driver.executeScript('window.metamask.setProviderType(arguments[0])', type)
|
||||||
}
|
}
|
||||||
|
|
||||||
// cleanup
|
// cleanup
|
||||||
|
11
ui/index.js
11
ui/index.js
@ -69,9 +69,14 @@ async function startApp (metamaskState, accountManager, opts) {
|
|||||||
store.dispatch(actions.updateMetamaskState(metamaskState))
|
store.dispatch(actions.updateMetamaskState(metamaskState))
|
||||||
})
|
})
|
||||||
|
|
||||||
// used by screenshotter tooling
|
// global metamask api - used by tooling
|
||||||
global.setLocale = (key) => {
|
global.metamask = {
|
||||||
store.dispatch(actions.updateCurrentLocale(key))
|
updateCurrentLocale: (code) => {
|
||||||
|
store.dispatch(actions.updateCurrentLocale(code))
|
||||||
|
},
|
||||||
|
setProviderType: (type) => {
|
||||||
|
store.dispatch(actions.setProviderType(type))
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// start app
|
// start app
|
||||||
|
Loading…
x
Reference in New Issue
Block a user