Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fabo/e2e integration #3068

Merged
merged 90 commits into from
Oct 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
06a8103
Send modal use GraphQL API
Oct 21, 2019
b77bdac
ActionModal api updates
Oct 21, 2019
f66d839
Delegation modal updates
Oct 21, 2019
e873e92
Delegation rewards
Oct 21, 2019
23624a3
Modal Deposit, Withdraw, Vote, Propose API updates
Oct 21, 2019
8ea4724
Small fixes
Oct 21, 2019
5294e79
Remove modalContext
Oct 21, 2019
3007b44
fixed sendModal
faboweb Oct 22, 2019
da42814
some more fixes
faboweb Oct 22, 2019
363d285
Linting
Oct 22, 2019
d682517
Remove send module
Oct 22, 2019
57d3b77
Case insensitive search
Oct 23, 2019
d6dffb3
Use uatom in transaction
Oct 23, 2019
accb2f1
Updates:
Oct 23, 2019
b53fd9a
Undelegation modal
Oct 24, 2019
73b440c
Single denom balance and other updates
Oct 24, 2019
485e470
Fix denom conversion
Oct 24, 2019
1ecc246
Merge colw/case-insensitive-search into colw/api-action-modals
Oct 24, 2019
e6383a7
Fix validators filter
Oct 24, 2019
59476b9
Move function
Oct 24, 2019
6764d3a
Fix spacing problem
Oct 25, 2019
e2f3f5e
Remove unnecessary code
Oct 25, 2019
279ce0a
Disable unstake button when no deligations
Oct 25, 2019
9793a9b
modal propose test
Oct 25, 2019
bf49535
modal vote tests
Oct 25, 2019
31a9ea2
modal deposit tests
Oct 25, 2019
2a85252
snapshots
Oct 25, 2019
2ba8e05
Minor, but not working, actionmodal test updates
Oct 25, 2019
dba74c5
Fixed recursive error
Oct 25, 2019
d1270da
Lint
Oct 25, 2019
fc9a4a8
fixed tests
faboweb Oct 25, 2019
95fdce5
delegation modals working
faboweb Oct 29, 2019
a89997e
fixed withdraw modal
faboweb Oct 29, 2019
0c71ce0
cleanup
faboweb Oct 29, 2019
ad0f4e5
remove denom conversion from sendModal
faboweb Oct 29, 2019
e41bc41
Snapshots
Oct 29, 2019
001c5a8
Update ActionManager test data
Oct 29, 2019
de8ac1f
Merge branch 'feature/api-gateway' into colw/api-action-modals
Oct 29, 2019
ed2ed22
remove view denom conversion for API requests
faboweb Oct 29, 2019
57ec85e
Merge branch 'colw/api-action-modals' of https://github.com/luniehq/l…
faboweb Oct 29, 2019
f7ed1f1
fix e2e tests
faboweb Oct 29, 2019
fd6e4a3
correct check for e2e balance
faboweb Oct 29, 2019
2e6d00c
correct default graphql url
faboweb Oct 29, 2019
76bddaa
correct VUE_APP_GRAPHQL_URL for e2e
faboweb Oct 29, 2019
62f01ab
working subscriptions
faboweb Oct 29, 2019
7e232ab
changelog
faboweb Oct 29, 2019
f6326b3
Merge remote-tracking branch 'origin/feature/api-gateway' into fabo/s…
faboweb Oct 29, 2019
185dcfe
only query on successful transactions
faboweb Oct 29, 2019
09e0b5a
linted
faboweb Oct 29, 2019
9e4e79f
Merge remote-tracking branch 'origin/feature/api-gateway' into fabo/s…
faboweb Oct 30, 2019
2032120
try fixing e2e tests
faboweb Oct 30, 2019
e687700
timeout waiting for API to be up
faboweb Oct 30, 2019
8e7055a
fix wrong e2e api up query
faboweb Oct 30, 2019
bb937fc
comment
faboweb Oct 30, 2019
28aa2a6
log repsonse for API check for debugging
faboweb Oct 30, 2019
f87acae
use browserstack friendly host for e2e tests
faboweb Oct 30, 2019
4763d36
linted
faboweb Oct 30, 2019
ea70c9c
log errors
faboweb Oct 30, 2019
f5711e2
disable production build to test faster
faboweb Oct 30, 2019
494e161
switch to local testing
faboweb Oct 30, 2019
60bb9d1
set network via env
faboweb Oct 30, 2019
0db5a53
remove lunie-backend
faboweb Oct 31, 2019
43061e5
reenable production build
faboweb Oct 31, 2019
f6355db
use browserstack again
faboweb Oct 31, 2019
65d83ae
use docker caching
faboweb Oct 31, 2019
511aeba
disable docker-layer-caching as not supported in free tier
faboweb Oct 31, 2019
1fe4404
typo
faboweb Oct 31, 2019
6d96dc5
typo
faboweb Oct 31, 2019
aa397a4
typo
faboweb Oct 31, 2019
4e9b57f
use npm instead of yarn in e2e test
faboweb Oct 31, 2019
16df260
typo
faboweb Oct 31, 2019
c834fef
switch back to local
faboweb Oct 31, 2019
a75c405
try working docker-compose command
faboweb Oct 31, 2019
61bb62d
add check for database to be ready in e2e tests
faboweb Oct 31, 2019
4676b34
comments
faboweb Oct 31, 2019
5bb1f43
temporary skip build step to debug ci faster
faboweb Oct 31, 2019
8b94932
log console for debugging
faboweb Oct 31, 2019
9326fe4
update lunie-api docker image manually
faboweb Oct 31, 2019
20df226
typo
faboweb Oct 31, 2019
2a763fd
do not rebuild dockers
faboweb Oct 31, 2019
34fbfd9
use debug branch
faboweb Oct 31, 2019
2f8234c
cleanup
faboweb Oct 31, 2019
8e1290e
cleanup
faboweb Oct 31, 2019
5ef23c3
shrink api up errors
faboweb Oct 31, 2019
988c787
fixed error in overview query
faboweb Oct 31, 2019
06c5f52
remove logs again
faboweb Oct 31, 2019
d777fcf
e2e should be always insecure more
faboweb Oct 31, 2019
da3a35a
switched to browserstack
faboweb Oct 31, 2019
1a68473
Merge remote-tracking branch 'origin/feature/api-gateway' into fabo/e…
faboweb Oct 31, 2019
46fa892
linted
faboweb Oct 31, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,24 +144,18 @@ jobs:
command: |
nvm install v10.13.0
nvm alias default v10.13.0
- run:
name: Install Chrome
command: |
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
sudo apt-get update
sudo apt-get -y install google-chrome-stable
- run:
name: Run testnet
command: |
cd lunie-backend
docker-compose up --build -d
npm run start -- -d
- run:
# needs to be done in CI to be sure it is build once we start the tests
name: Build for E2E test
command: npm run test:e2e:build
environment:
VUE_APP_GRAPHQL_URL: http://127.0.0.1:4000 # Browserstack tunneling doesn't work with "localhost"
NETWORK: local-cosmos-hub-testnet # Connect directly to the testnet
- run:
name: Test
command: npm run serve:dist & npm run test:e2e:browserstack
Expand Down
1 change: 1 addition & 0 deletions src/components/common/TmBalance.vue
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ export default {
},
query: UserTransactionAdded,
result() {
// query if successful or not as even an unsuccessful tx costs fees
this.$apollo.queries.overview.refetch()
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/vuex/modules/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default () => {
const state = {
developmentMode: config.development, // can't be set in browser
experimentalMode: config.development, // development mode, can be set from browser
insecureMode: false, // show the local signer
insecureMode: config.e2e || false, // show the local signer
signedIn: false,
sessionType: null, // local, explore, ledger, extension
pauseHistory: false,
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/browserstack.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const nightwatch_config = {
src_folders: ["tests/e2e"],
globals_path: "./globals.js",
output_folder: "./output",
launch_url: "http://127.0.0.1:9080?network=local-cosmos-hub-testnet",
launch_url: "http://127.0.0.1:9080",

selenium: {
start_process: false,
Expand Down
45 changes: 37 additions & 8 deletions tests/e2e/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ const axios = require("axios")
const chai = require("chai")
chai.use(require("chai-string"))

const HOST = "localhost"
const HOST = "127.0.0.1"

module.exports = {
// controls the timeout time for async hooks. Expects the done() callback to be invoked within this time
// or an error is thrown
asyncHookTimeout: 30000,

async before() {
await schemaAvailable()
await apiUp()
},

Expand Down Expand Up @@ -69,23 +70,51 @@ module.exports = {
}

async function apiUp() {
const start = new Date().getTime()
// we need to wait until the testnet is up and the account has money
let apiUp = false
while (!apiUp) {
if (new Date().getTime() - start > 90000) {
throw new Error("Timed out waiting for API to be up.")
}
try {
const { data } = await axios.post(`http://${HOST}:4000`, {
operationName: null,
query: `{\n balance(networkId: "local-cosmos-hub-testnet", address: "cosmos1ek9cd8ewgxg9w5xllq9um0uf4aaxaruvcw4v9e", denom: "STAKE") {\n denom\n amount\n }\n}\n`,
variables: {}
// test if the test account was funded as we need the account to have funds in the tests
const response = await axios.post(`http://${HOST}:4000`, {
query: `{overview(networkId: "local-cosmos-hub-testnet", address:"cosmos1ek9cd8ewgxg9w5xllq9um0uf4aaxaruvcw4v9e") {totalStake}}`
})
if (data.data.balance.amount === 0) {
if (response.data.errors) {
throw new Error(JSON.stringify(response.data.errors))
}
if (response.data.data.overview.totalStake === 0) {
continue
}
apiUp = true
} catch (err) {
console.log(err)
console.log("Failed to check API", err)
await new Promise(resolve => setTimeout(resolve, 1000))
console.log("Waiting for API to be up")
}
}
}

async function schemaAvailable() {
const start = new Date().getTime()
// we need to wait until the database is up and has the expected shema
let databaseUp = false
while (!databaseUp) {
if (new Date().getTime() - start > 90000) {
throw new Error("Timed out waiting for database to be up.")
}
try {
// test if the database has the expected schema by probing one setup table
await axios.post(`http://${HOST}:8080/v1/graphql`, {
query: `{maintenance { message }}`
})
databaseUp = true
} catch (err) {
console.log("Failed to check database", err.message)
await new Promise(resolve => setTimeout(resolve, 1000))
console.log("Waiting for node to be up")
console.log("Waiting for database to be up")
}
}
}
2 changes: 1 addition & 1 deletion tests/e2e/local-chrome.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const nightwatch_config = {
globals_path: "./globals.js",
disable_colors: false,
test_workers: false,
launch_url: "http://localhost:9080?network=local-cosmos-hub-testnet",
launch_url: "http://localhost:9080",
webdriver: {
start_process: true,
port: 9515,
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/signin.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function signIn(browser) {

function prepare(browser) {
browser.resizeWindow(400, 1024) // force mobile screen to be able to click some out of screen buttons
browser.url(browser.launch_url + "&insecure=true")
browser.url(browser.launch_url)
browser.waitForElementVisible(`body`)
browser.waitForElementVisible(`#app-content`)
signOut(browser)
Expand Down