diff options
author | Thomas <thomas.b.huang@gmail.com> | 2018-05-11 01:24:27 +0800 |
---|---|---|
committer | Thomas <thomas.b.huang@gmail.com> | 2018-05-11 01:24:27 +0800 |
commit | 60933f10901730946041815e0d1dd543f7ac6972 (patch) | |
tree | 1e0fb642e17dfc5a07cec4823fbb5d2df2b86f2d /test | |
parent | 68bbe18e3261e00734b0522b7e8d18306d51c646 (diff) | |
download | tangerine-wallet-browser-60933f10901730946041815e0d1dd543f7ac6972.tar tangerine-wallet-browser-60933f10901730946041815e0d1dd543f7ac6972.tar.gz tangerine-wallet-browser-60933f10901730946041815e0d1dd543f7ac6972.tar.bz2 tangerine-wallet-browser-60933f10901730946041815e0d1dd543f7ac6972.tar.lz tangerine-wallet-browser-60933f10901730946041815e0d1dd543f7ac6972.tar.xz tangerine-wallet-browser-60933f10901730946041815e0d1dd543f7ac6972.tar.zst tangerine-wallet-browser-60933f10901730946041815e0d1dd543f7ac6972.zip |
Job Screens with Shadow Dom Css selector
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/chrome/metamask.spec.js | 3 | ||||
-rw-r--r-- | test/e2e/firefox/metamask.spec.js | 7 | ||||
-rw-r--r-- | test/screens/new-ui.js | 3 |
3 files changed, 7 insertions, 6 deletions
diff --git a/test/e2e/chrome/metamask.spec.js b/test/e2e/chrome/metamask.spec.js index fb33e88fd..d72ebe1a9 100644 --- a/test/e2e/chrome/metamask.spec.js +++ b/test/e2e/chrome/metamask.spec.js @@ -102,7 +102,8 @@ describe('Metamask popup page', function () { it('shows value was created and seed phrase', async () => { await delay(300) - await driver.findElement(By.css('.twelve-word-phrase')).getText() + const seedPhrase = await driver.findElement(By.css('.twelve-word-phrase')).getText() + assert.equal(seedPhrase.split(' ').length, 12) const continueAfterSeedPhrase = await driver.findElement(By.css('#app-content > div > div.app-primary.from-right > div > button:nth-child(4)')) assert.equal(await continueAfterSeedPhrase.getText(), `I'VE COPIED IT SOMEWHERE SAFE`) await continueAfterSeedPhrase.click() diff --git a/test/e2e/firefox/metamask.spec.js b/test/e2e/firefox/metamask.spec.js index f9a798d0b..7024bbc7b 100644 --- a/test/e2e/firefox/metamask.spec.js +++ b/test/e2e/firefox/metamask.spec.js @@ -9,7 +9,7 @@ const By = webdriver.By const { delay, buildFirefoxWebdriver } = require('../func') describe('', function () { - let driver, seedPhase, accountAddress, tokenAddress, extensionId + let driver, accountAddress, tokenAddress, extensionId this.timeout(0) @@ -34,7 +34,7 @@ describe('', function () { it('switches to Firefox addon list', async function () { await driver.get('about:debugging#addons') - await delay(10000) + await delay(700) }) it(`selects MetaMask's extension id and opens it in the current tab`, async function () { @@ -102,7 +102,8 @@ describe('', function () { it('shows value was created and seed phrase', async () => { await delay(300) - seedPhase = await driver.findElement(By.css('.twelve-word-phrase')).getText() + cosnt seedPhase = await driver.findElement(By.css('.twelve-word-phrase')).getText() + assert.equal(seedPhrase.split(' ').length, 12) const continueAfterSeedPhrase = await driver.findElement(By.css('#app-content > div > div.app-primary.from-right > div > button:nth-child(4)')) assert.equal(await continueAfterSeedPhrase.getText(), `I'VE COPIED IT SOMEWHERE SAFE`) await continueAfterSeedPhrase.click() diff --git a/test/screens/new-ui.js b/test/screens/new-ui.js index e0ce8dcdf..e176da529 100644 --- a/test/screens/new-ui.js +++ b/test/screens/new-ui.js @@ -39,8 +39,7 @@ async function captureAllScreens() { const extPath = path.resolve('dist/chrome') driver = buildWebDriver(extPath) await driver.get('chrome://extensions-frame') - const elems = await driver.findElements(By.css('* /deep/ extensions-item')) - const extensionId = await elems[1].getAttribute('id') + const extensionId = await driver.executeScript('return document.querySelector("extensions-manager").shadowRoot.querySelector("extensions-view-manager extensions-item-list").shadowRoot.querySelector("#container > div.items-container > extensions-item:nth-child(2)").getAttribute("id")') await driver.get(`chrome-extension://${extensionId}/home.html`) await delay(500) tabs = await driver.getAllWindowHandles() |