-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add env variables to test build * add data-testid attribute to home component * add method to retrieve the url of the current page * add portfolio site test Co-authored-by: ryanml <[email protected]>
- Loading branch information
1 parent
2623fed
commit 1370f19
Showing
4 changed files
with
51 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,12 +16,12 @@ | |
"build": "yarn lavamoat:build", | ||
"build:dev": "node development/build/index.js", | ||
"build:icons": "node ui/components/component-library/icon/scripts/generate-icon-names.js && node ui/components/component-library/icon/scripts/generate-icon-scss.js", | ||
"start:test": "SEGMENT_HOST='https://api.segment.io' SEGMENT_WRITE_KEY='FAKE' SENTRY_DSN_DEV=https://[email protected]/0000000 yarn build testDev", | ||
"start:test": "SEGMENT_HOST='https://api.segment.io' SEGMENT_WRITE_KEY='FAKE' SENTRY_DSN_DEV=https://[email protected]/0000000 PORTFOLIO_URL=http://127.0.0.1:8080 yarn build testDev", | ||
"benchmark:chrome": "SELENIUM_BROWSER=chrome node test/e2e/benchmark.js", | ||
"mv3:stats:chrome": "SELENIUM_BROWSER=chrome ENABLE_MV3=true node test/e2e/mv3-perf-stats/index.js", | ||
"user-actions-benchmark:chrome": "SELENIUM_BROWSER=chrome node test/e2e/user-actions-benchmark.js", | ||
"benchmark:firefox": "SELENIUM_BROWSER=firefox node test/e2e/benchmark.js", | ||
"build:test": "SEGMENT_HOST='https://api.segment.io' SEGMENT_WRITE_KEY='FAKE' SENTRY_DSN_DEV=https://[email protected]/0000000 yarn build test", | ||
"build:test": "SEGMENT_HOST='https://api.segment.io' SEGMENT_WRITE_KEY='FAKE' SENTRY_DSN_DEV=https://[email protected]/0000000 PORTFOLIO_URL=http://127.0.0.1:8080 yarn build test", | ||
"build:test:flask": "yarn build test --build-type flask", | ||
"build:test:mv3": "ENABLE_MV3=true yarn build test", | ||
"test": "yarn lint && yarn test:unit && yarn test:unit:jest", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
const { strict: assert } = require('assert'); | ||
const { convertToHexValue, withFixtures } = require('../helpers'); | ||
|
||
describe('Portfolio site', function () { | ||
const ganacheOptions = { | ||
accounts: [ | ||
{ | ||
secretKey: | ||
'0x7C9529A67102755B7E6102D6D950AC5D5863C98713805CEC576B945B15B71EAC', | ||
balance: convertToHexValue(25000000000000000000), | ||
}, | ||
], | ||
}; | ||
it('should link to the portfolio site', async function () { | ||
await withFixtures( | ||
{ | ||
dapp: true, | ||
fixtures: 'imported-account', | ||
ganacheOptions, | ||
title: this.test.title, | ||
}, | ||
async ({ driver }) => { | ||
await driver.navigate(); | ||
await driver.fill('#password', 'correct horse battery staple'); | ||
await driver.press('#password', driver.Key.ENTER); | ||
|
||
// Click Portfolio site | ||
await driver.clickElement('[data-testid="home__portfolio-site"]'); | ||
await driver.waitUntilXWindowHandles(2); | ||
const windowHandles = await driver.getAllWindowHandles(); | ||
await driver.switchToWindowWithTitle('E2E Test Dapp', windowHandles); | ||
|
||
// Verify site | ||
assert.equal( | ||
await driver.getCurrentUrl(), | ||
'http://127.0.0.1:8080/?metamaskEntry=ext', | ||
); | ||
}, | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters