-
Notifications
You must be signed in to change notification settings - Fork 7
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
test: adding tests for setting up governance params for liquidation flow and ci changes #156
Changes from all commits
6a1fbd3
9771c66
e7e551f
060bede
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
server { | ||
listen 26656; | ||
server_name localhost; | ||
|
||
location / { | ||
proxy_pass http://agoric_chain:26656; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
} | ||
} | ||
|
||
server { | ||
listen 26657; | ||
server_name localhost; | ||
|
||
location / { | ||
proxy_pass http://agoric_chain:26657; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
} | ||
} | ||
|
||
|
||
server { | ||
listen 1317; | ||
server_name localhost; | ||
|
||
location / { | ||
proxy_pass http://agoric_chain:1317; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,218 @@ | ||
/* eslint-disable ui-testing/no-disabled-tests */ | ||
describe('Wallet App Test Cases', () => { | ||
let startTime; | ||
|
||
context('Setting up accounts', () => { | ||
it('should set up wallets for two members of the econ committee.', () => { | ||
cy.setupWallet({ | ||
secretWords: | ||
'such field health riot cost kitten silly tube flash wrap festival portion imitate this make question host bitter puppy wait area glide soldier knee', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Magic string. Please source from constants in a config module |
||
walletName: 'gov2', | ||
}); | ||
cy.setupWallet({ | ||
secretWords: | ||
'physical immune cargo feel crawl style fox require inhale law local glory cheese bring swear royal spy buyer diesel field when task spin alley', | ||
walletName: 'gov1', | ||
}); | ||
}); | ||
|
||
it('should connect with chain and wallet', () => { | ||
cy.visit('https://econ-gov.inter.trade/?agoricNet=local'); | ||
cy.acceptAccess(); | ||
}); | ||
}); | ||
|
||
context('Adjusting Vault Params', () => { | ||
it('should allow gov1 to create a proposal', () => { | ||
cy.visit('https://econ-gov.inter.trade/?agoricNet=local'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider a const |
||
cy.acceptAccess(); | ||
|
||
cy.get('button').contains('Vaults').click(); | ||
cy.get('button').contains('Select Manager').click(); | ||
cy.get('button').contains('manager0').click(); | ||
|
||
cy.get('label') | ||
.contains('LiquidationMargin') | ||
.parent() | ||
.within(() => { | ||
cy.get('input').clear().type('150'); | ||
}); | ||
|
||
cy.get('label') | ||
.contains('LiquidationPadding') | ||
.parent() | ||
.within(() => { | ||
cy.get('input').clear().type('25'); | ||
}); | ||
|
||
cy.get('label') | ||
.contains('LiquidationPenalty') | ||
.parent() | ||
.within(() => { | ||
cy.get('input').clear().type('1'); | ||
}); | ||
|
||
cy.get('label') | ||
.contains('StabilityFee') | ||
.parent() | ||
.within(() => { | ||
cy.get('input').clear().type('1'); | ||
}); | ||
|
||
cy.get('label') | ||
.contains('MintFee') | ||
.parent() | ||
.within(() => { | ||
cy.get('input').clear().type('0.5'); | ||
}); | ||
|
||
cy.get('label') | ||
.contains('Minutes until close of vote') | ||
.parent() | ||
.within(() => { | ||
cy.get('input').clear().type(1); | ||
}); | ||
cy.get('[value="Propose Parameter Change"]').click(); | ||
|
||
cy.confirmTransaction(); | ||
cy.get('p') | ||
.contains('sent') | ||
.should('be.visible') | ||
.then(() => { | ||
startTime = Date.now(); | ||
}); | ||
}); | ||
|
||
it('should allow gov1 to vote on the proposal', () => { | ||
cy.visit('https://econ-gov.inter.trade/?agoricNet=local'); | ||
|
||
cy.get('button').contains('Vote').click(); | ||
cy.get('p').contains('YES').click(); | ||
cy.get('input:enabled[value="Submit Vote"]').click(); | ||
|
||
cy.confirmTransaction(); | ||
cy.get('p').contains('sent').should('be.visible'); | ||
}); | ||
|
||
it('should allow gov2 to vote on the proposal', () => { | ||
cy.switchWallet('gov2'); | ||
cy.visit('https://econ-gov.inter.trade/?agoricNet=local'); | ||
|
||
cy.get('button').contains('Vote').click(); | ||
cy.get('p').contains('YES').click(); | ||
cy.get('input:enabled[value="Submit Vote"]').click(); | ||
|
||
cy.confirmTransaction(); | ||
cy.get('p').contains('sent').should('be.visible'); | ||
}); | ||
|
||
it('should wait for proposal to pass', () => { | ||
cy.wait(60000 - Date.now() + startTime); | ||
cy.visit('https://econ-gov.inter.trade/?agoricNet=local'); | ||
|
||
cy.get('button').contains('History').click(); | ||
|
||
cy.get('code') | ||
.contains('VaultFactory - ATOM') | ||
.parent() | ||
.parent() | ||
.parent() | ||
.within(() => { | ||
cy.get('span').contains('Change Accepted').should('be.visible'); | ||
}); | ||
}); | ||
}); | ||
|
||
context('Adjusting Auction Params', () => { | ||
it('should allow gov2 to create a proposal', () => { | ||
cy.visit('https://econ-gov.inter.trade/?agoricNet=local'); | ||
|
||
cy.get('button').contains('Vaults').click(); | ||
cy.get('button').contains('Change Manager Params').click(); | ||
cy.get('button').contains('Change Auctioneer Params').click(); | ||
|
||
cy.get('label') | ||
.contains('StartingRate') | ||
.parent() | ||
.within(() => { | ||
cy.get('input').clear().type('105'); | ||
}); | ||
|
||
cy.get('label') | ||
.contains('LowestRate') | ||
.parent() | ||
.within(() => { | ||
cy.get('input').clear().type('65'); | ||
}); | ||
|
||
cy.get('label') | ||
.contains('DiscountStep') | ||
.parent() | ||
.within(() => { | ||
cy.get('input').clear().type('5'); | ||
}); | ||
|
||
cy.get('label') | ||
.contains('AuctionStartDelay') | ||
.parent() | ||
.within(() => { | ||
cy.get('input').clear().type('2'); | ||
}); | ||
|
||
cy.get('label') | ||
.contains('Minutes until close of vote') | ||
.parent() | ||
.within(() => { | ||
cy.get('input').clear().type(1); | ||
}); | ||
cy.get('[value="Propose Parameter Change"]').click(); | ||
|
||
cy.confirmTransaction(); | ||
cy.get('p') | ||
.contains('sent') | ||
.should('be.visible') | ||
.then(() => { | ||
startTime = Date.now(); | ||
}); | ||
}); | ||
|
||
it('should allow gov2 to vote on the proposal', () => { | ||
cy.visit('https://econ-gov.inter.trade/?agoricNet=local'); | ||
|
||
cy.get('button').contains('Vote').click(); | ||
cy.get('p').contains('YES').click(); | ||
cy.get('input:enabled[value="Submit Vote"]').click(); | ||
|
||
cy.confirmTransaction(); | ||
cy.get('p').contains('sent').should('be.visible'); | ||
}); | ||
|
||
it('should allow gov1 to vote on the proposal', () => { | ||
cy.switchWallet('gov1'); | ||
cy.visit('https://econ-gov.inter.trade/?agoricNet=local'); | ||
|
||
cy.get('button').contains('Vote').click(); | ||
cy.get('p').contains('YES').click(); | ||
cy.get('input:enabled[value="Submit Vote"]').click(); | ||
|
||
cy.confirmTransaction(); | ||
cy.get('p').contains('sent').should('be.visible'); | ||
}); | ||
|
||
it('should wait for proposal to pass', () => { | ||
cy.wait(60000 - Date.now() + startTime); | ||
cy.visit('https://econ-gov.inter.trade/?agoricNet=local'); | ||
|
||
cy.get('button').contains('History').click(); | ||
|
||
cy.get('code') | ||
.contains('VaultFactory - ATOM') | ||
.parent() | ||
.parent() | ||
.parent() | ||
.within(() => { | ||
cy.get('span').contains('Change Accepted').should('be.visible'); | ||
}); | ||
}); | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
/* eslint-disable ui-testing/no-disabled-tests */ | ||
describe('Wallet App Test Cases', () => { | ||
context('Test commands', () => { | ||
it(`should connect with Agoric Chain`, () => { | ||
it(`should setup wallet and connect with Agoric Chain`, () => { | ||
cy.setupWallet(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we dont have the |
||
cy.visit('/'); | ||
|
||
cy.acceptAccess().then((taskCompleted) => { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
import '@agoric/synpress/support/index'; | ||
import '@agoric/synpress/support/commands'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This long line makes it hard to see changes. Consider a script with new lines