-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge the develop branch to the master branch, preparation to v2.3.0
- Loading branch information
Showing
17 changed files
with
566 additions
and
25 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
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 |
---|---|---|
@@ -1 +1 @@ | ||
10.16 | ||
10.22 |
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,15 @@ | ||
{ | ||
"extends": [ | ||
"plugin:node/recommended", | ||
"airbnb-base", | ||
"../.eslintrc" | ||
], | ||
"plugins": ["node", "jest"], | ||
"env": { | ||
"jest/globals": true | ||
}, | ||
"globals": { | ||
"page": true, | ||
"browser": true | ||
} | ||
} |
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,24 @@ | ||
{ | ||
"name": "alm-e2e", | ||
"version": "0.0.1", | ||
"private": true, | ||
"scripts": { | ||
"test": "jest --detectOpenHandles", | ||
"lint": "eslint . --ignore-path ../.eslintignore", | ||
"lint:fix": "eslint . --fix" | ||
}, | ||
"dependencies": { | ||
"jest": "24.7.1", | ||
"jest-puppeteer": "^4.4.0", | ||
"puppeteer": "^5.2.1" | ||
}, | ||
"jest": { | ||
"preset": "jest-puppeteer" | ||
}, | ||
"devDependencies": { | ||
"eslint-plugin-jest": "^23.18.0" | ||
}, | ||
"engines": { | ||
"node": ">= 8.9" | ||
} | ||
} |
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,13 @@ | ||
#!/usr/bin/env bash | ||
cd $(dirname $0) | ||
|
||
../e2e-commons/up.sh deploy blocks alm alm-e2e | ||
|
||
# run oracle amb e2e tests to generate transactions for alm | ||
docker-compose -f ../e2e-commons/docker-compose.yml run e2e yarn workspace oracle-e2e run alm | ||
|
||
yarn test | ||
rc=$? | ||
|
||
../e2e-commons/down.sh | ||
exit $rc |
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,50 @@ | ||
const puppeteer = require('puppeteer') | ||
const { waitUntil } = require('./utils/utils') | ||
|
||
jest.setTimeout(60000) | ||
|
||
const statusText = 'Success' | ||
const statusSelector = 'label[data-id="status"]' | ||
|
||
const homeToForeignTxURL = 'http://localhost:3004/77/0x58e7d63368335b9591d4dbb43889084f698fcee93ab7656fd7a39d8c66bc4b60' | ||
const foreignToHomeTxURL = 'http://localhost:3004/42/0x592bf28fc896419d2838f71cd0388775814b692688f1ecd5b1519081566b994a' | ||
|
||
describe('ALM', () => { | ||
let browser | ||
let page | ||
|
||
beforeAll(async () => { | ||
browser = await puppeteer.launch() | ||
page = await browser.newPage() | ||
}) | ||
|
||
afterAll(async () => { | ||
await browser.close() | ||
}) | ||
|
||
it('should be titled "AMB Live Monitoring"', async () => { | ||
await page.goto(foreignToHomeTxURL) | ||
|
||
await expect(page.title()).resolves.toMatch('AMB Live Monitoring') | ||
}) | ||
it('should display information of foreign to home transaction', async () => { | ||
await page.goto(foreignToHomeTxURL) | ||
|
||
await page.waitForSelector(statusSelector) | ||
await waitUntil(async () => { | ||
const element = await page.$(statusSelector) | ||
const text = await page.evaluate(element => element.textContent, element) | ||
return text === statusText | ||
}) | ||
}) | ||
it('should display information of home to foreign transaction', async () => { | ||
await page.goto(homeToForeignTxURL) | ||
|
||
await page.waitForSelector(statusSelector) | ||
await waitUntil(async () => { | ||
const element = await page.$(statusSelector) | ||
const text = await page.evaluate(element => element.textContent, element) | ||
return text === statusText | ||
}) | ||
}) | ||
}) |
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,15 @@ | ||
const waitUntil = async (predicate, step = 100, timeout = 20000) => { | ||
const stopTime = Date.now() + timeout | ||
while (Date.now() <= stopTime) { | ||
const result = await predicate() | ||
if (result) { | ||
return result | ||
} | ||
await new Promise(resolve => setTimeout(resolve, step)) // sleep | ||
} | ||
throw new Error(`waitUntil timed out after ${timeout} ms`) | ||
} | ||
|
||
module.exports = { | ||
waitUntil | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
COMMON_HOME_BRIDGE_ADDRESS=0x0AEe1FCD12dDFab6265F7f8956e6E012A9Fe4Aa0 | ||
COMMON_FOREIGN_BRIDGE_ADDRESS=0x0AEe1FCD12dDFab6265F7f8956e6E012A9Fe4Aa0 | ||
|
||
COMMON_HOME_RPC_URL=http://localhost:8541 | ||
COMMON_FOREIGN_RPC_URL=http://localhost:8542 | ||
|
||
ALM_HOME_NETWORK_NAME=Parity1 | ||
ALM_FOREIGN_NETWORK_NAME=Parity2 | ||
|
||
PORT=3000 |
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
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
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
Oops, something went wrong.