chore: updated acs for governance (#1711)

This commit is contained in:
Joe Tsang 2022-10-12 12:39:08 +01:00 committed by GitHub
parent 06541a1527
commit d071ffa777
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 53 additions and 48 deletions

View File

@ -147,7 +147,7 @@ context(
}); });
it('Should be able to see that no proposals exist', function () { it('Should be able to see that no proposals exist', function () {
// 1004-VOTE-003 // 3001-VOTE-003
cy.get(noOpenProposals) cy.get(noOpenProposals)
.should('be.visible') .should('be.visible')
.and('have.text', 'There are no open or yet to enact proposals'); .and('have.text', 'There are no open or yet to enact proposals');
@ -156,17 +156,17 @@ context(
.and('have.text', 'There are no enacted or rejected proposals'); .and('have.text', 'There are no enacted or rejected proposals');
}); });
// 1005-PROP-002 // 3002-PROP-002
// 1005-PROP-003 // 3002-PROP-003
it('Submit a proposal form - shows how many vega tokens are required to make a proposal', function () { it('Submit a proposal form - shows how many vega tokens are required to make a proposal', function () {
// 1005-PROP-005 // 3002-PROP-005
cy.go_to_make_new_proposal(governanceProposalType.NEW_MARKET); cy.go_to_make_new_proposal(governanceProposalType.NEW_MARKET);
cy.contains( cy.contains(
`You must have at least ${this.minProposerBalance} VEGA associated to make a proposal` `You must have at least ${this.minProposerBalance} VEGA associated to make a proposal`
).should('be.visible'); ).should('be.visible');
}); });
// 1005-PROP-011 // 3002-PROP-011
it( it(
'Able to submit a valid freeform proposal - with minimum required tokens associated', 'Able to submit a valid freeform proposal - with minimum required tokens associated',
{ tags: '@smoke' }, { tags: '@smoke' },
@ -175,7 +175,7 @@ context(
this.minProposerBalance this.minProposerBalance
); );
cy.go_to_make_new_proposal(governanceProposalType.FREEFORM); cy.go_to_make_new_proposal(governanceProposalType.FREEFORM);
cy.get(minVoteButton).should('be.visible'); // 1005-PROP-008 cy.get(minVoteButton).should('be.visible'); // 3002-PROP-008
cy.get(maxVoteButton).should('be.visible'); cy.get(maxVoteButton).should('be.visible');
cy.get(votingDate).should('not.be.empty'); cy.get(votingDate).should('not.be.empty');
cy.get(voteTwoMinExtraNote).should( cy.get(voteTwoMinExtraNote).should(
@ -184,8 +184,8 @@ context(
); );
cy.enter_unique_freeform_proposal_body('50'); cy.enter_unique_freeform_proposal_body('50');
cy.get(newProposalSubmitButton).should('be.visible').click(); cy.get(newProposalSubmitButton).should('be.visible').click();
// 1005-PROP-012 // 3002-PROP-012
// 1005-PROP-016 // 3002-PROP-016
cy.wait_for_proposal_submitted(); cy.wait_for_proposal_submitted();
} }
); );
@ -229,14 +229,14 @@ context(
}); });
it('Newly created proposals list - shows title and portion of summary', function () { it('Newly created proposals list - shows title and portion of summary', function () {
createRawProposal(this.minProposerBalance); createRawProposal(this.minProposerBalance); // 3001-VOTE-052
cy.wait('@proposalSubmissionCompletion') cy.wait('@proposalSubmissionCompletion')
.its(proposalResponseProposalIdPath) .its(proposalResponseProposalIdPath)
.then((proposalId) => { .then((proposalId) => {
cy.get(openProposals).within(() => { cy.get(openProposals).within(() => {
cy.get('@rawProposal').then((rawProposal) => { cy.get('@rawProposal').then((rawProposal) => {
// 1004-VOTE-008 // 3001-VOTE-008
// 1004-VOTE-034 // 3001-VOTE-034
cy.get(`#${proposalId}`) cy.get(`#${proposalId}`)
.should('contain', rawProposal.rationale.title) .should('contain', rawProposal.rationale.title)
.and('be.visible'); .and('be.visible');
@ -252,8 +252,8 @@ context(
}); });
it('Newly created proposals list - shows open proposals in an open state', function () { it('Newly created proposals list - shows open proposals in an open state', function () {
// 1004-VOTE-004 // 3001-VOTE-004
// 1004-VOTE-035 // 3001-VOTE-035
createRawProposal(this.minProposerBalance); createRawProposal(this.minProposerBalance);
cy.wait('@proposalSubmissionCompletion') cy.wait('@proposalSubmissionCompletion')
.its(proposalResponseProposalIdPath) .its(proposalResponseProposalIdPath)
@ -276,7 +276,7 @@ context(
}); });
it('Newly created proposals list - proposals closest to closing date appear higher in list', function () { it('Newly created proposals list - proposals closest to closing date appear higher in list', function () {
// 1004-VOTE-005 // 3001-VOTE-005
cy.ensure_specified_unstaked_tokens_are_associated( cy.ensure_specified_unstaked_tokens_are_associated(
this.minProposerBalance this.minProposerBalance
); );
@ -326,7 +326,7 @@ context(
cy.get_submitted_proposal_from_proposal_list() cy.get_submitted_proposal_from_proposal_list()
.as('submittedProposal') .as('submittedProposal')
.within(() => { .within(() => {
// 1004-VOTE-039 // 3001-VOTE-039
cy.get(voteStatus).should('have.text', 'Participation not reached'); cy.get(voteStatus).should('have.text', 'Participation not reached');
cy.get(viewProposalButton).click(); cy.get(viewProposalButton).click();
}); });
@ -367,7 +367,7 @@ context(
}); });
}); });
cy.get('@rawProposal').then((freeformProposal) => { cy.get('@rawProposal').then((freeformProposal) => {
// 1004-VOTE-054 // 3001-VOTE-054
cy.get(proposalDetailsTitle) cy.get(proposalDetailsTitle)
.should('contain', freeformProposal.rationale.title) .should('contain', freeformProposal.rationale.title)
.and('be.visible'); .and('be.visible');
@ -391,7 +391,7 @@ context(
}); });
}); });
cy.get('@rawProposal').then(() => { cy.get('@rawProposal').then(() => {
// 1004-VOTE-055 // 3001-VOTE-055
cy.get(proposalDetailsDescription) cy.get(proposalDetailsDescription)
.should('have.attr', 'href') .should('have.attr', 'href')
.and( .and(
@ -437,13 +437,13 @@ context(
.should('be.visible'); .should('be.visible');
} }
); );
// 1004-VOTE-043 // 3001-VOTE-043
cy.contains('3 days left to vote').should('be.visible'); cy.contains('3 days left to vote').should('be.visible');
}); });
it('Newly created proposal details - shows default status set to fail', function () { it('Newly created proposal details - shows default status set to fail', function () {
// 1004-VOTE-037 // 3001-VOTE-037
// 1004-VOTE-040 // 3001-VOTE-040
createRawProposal(this.minProposerBalance); createRawProposal(this.minProposerBalance);
cy.get_submitted_proposal_from_proposal_list().within(() => cy.get_submitted_proposal_from_proposal_list().within(() =>
cy.get(viewProposalButton).click() cy.get(viewProposalButton).click()
@ -455,8 +455,8 @@ context(
cy.get_proposal_information_from_table('Will pass') cy.get_proposal_information_from_table('Will pass')
.contains('👎') .contains('👎')
.should('be.visible'); .should('be.visible');
// 1004-VOTE-062 // 3001-VOTE-062
// 1004-VOTE-040 // 3001-VOTE-040
cy.get_proposal_information_from_table('Majority met') cy.get_proposal_information_from_table('Majority met')
.contains('👎') .contains('👎')
.should('be.visible'); .should('be.visible');
@ -465,12 +465,13 @@ context(
.should('be.visible'); .should('be.visible');
}); });
// 3001-VOTE-080 3001-VOTE-090
it('Newly created proposal details - ability to vote for and against proposal - with minimum required tokens associated', function () { it('Newly created proposal details - ability to vote for and against proposal - with minimum required tokens associated', function () {
createRawProposal(this.minProposerBalance); createRawProposal(this.minProposerBalance);
cy.get_submitted_proposal_from_proposal_list() cy.get_submitted_proposal_from_proposal_list()
.as('submittedProposal') .as('submittedProposal')
.within(() => cy.get(viewProposalButton).click()); .within(() => cy.get(viewProposalButton).click());
// 1004-VOTE-080 // 3001-VOTE-080
cy.get(voteButtons).contains('against').should('be.visible'); cy.get(voteButtons).contains('against').should('be.visible');
cy.get(voteButtons).contains('for').should('be.visible'); cy.get(voteButtons).contains('for').should('be.visible');
cy.vote_for_proposal('for'); cy.vote_for_proposal('for');
@ -478,8 +479,8 @@ context(
'0', '0',
'shortMonth' 'shortMonth'
).then((votedDate) => { ).then((votedDate) => {
// 1004-VOTE-051 // 3001-VOTE-051
// 1004-VOTE-093 // 3001-VOTE-093
cy.contains('You voted:') cy.contains('You voted:')
.siblings() .siblings()
.contains('For') .contains('For')
@ -505,11 +506,11 @@ context(
cy.get_proposal_information_from_table('Tokens against proposal') cy.get_proposal_information_from_table('Tokens against proposal')
.should('have.text', '0.00') .should('have.text', '0.00')
.and('be.visible'); .and('be.visible');
// 1004-VOTE-061 // 3001-VOTE-061
cy.get_proposal_information_from_table('Participation required') cy.get_proposal_information_from_table('Participation required')
.contains(`${this.requiredParticipation}%`) .contains(`${this.requiredParticipation}%`)
.should('be.visible'); .should('be.visible');
// 1004-VOTE-066 // 3001-VOTE-066
cy.get_proposal_information_from_table('Majority Required') cy.get_proposal_information_from_table('Majority Required')
.contains(`${parseFloat(this.requiredMajority).toFixed(2)}%`) .contains(`${parseFloat(this.requiredMajority).toFixed(2)}%`)
.should('be.visible'); .should('be.visible');
@ -518,7 +519,7 @@ context(
.and('be.visible'); .and('be.visible');
cy.get(changeVoteButton).should('be.visible').click(); cy.get(changeVoteButton).should('be.visible').click();
cy.vote_for_proposal('for'); cy.vote_for_proposal('for');
// 1004-VOTE-064 // 3001-VOTE-064
cy.get_proposal_information_from_table('Tokens for proposal') cy.get_proposal_information_from_table('Tokens for proposal')
.should('have.text', parseFloat(this.minProposerBalance).toFixed(2)) .should('have.text', parseFloat(this.minProposerBalance).toFixed(2))
.and('be.visible'); .and('be.visible');
@ -542,7 +543,7 @@ context(
.as('submittedProposal') .as('submittedProposal')
.within(() => cy.get(viewProposalButton).click()); .within(() => cy.get(viewProposalButton).click());
cy.vote_for_proposal('for'); cy.vote_for_proposal('for');
// 1004-VOTE-079 // 3001-VOTE-079
cy.contains('You voted: For').should('be.visible'); cy.contains('You voted: For').should('be.visible');
cy.get_proposal_information_from_table('Total Supply') cy.get_proposal_information_from_table('Total Supply')
.invoke('text') .invoke('text')
@ -563,7 +564,7 @@ context(
cy.get(proposalVoteProgressAgainstPercentage) cy.get(proposalVoteProgressAgainstPercentage)
.contains('0.00%') .contains('0.00%')
.and('be.visible'); .and('be.visible');
// 1004-VOTE-065 // 3001-VOTE-065
cy.get(proposalVoteProgressForTokens) cy.get(proposalVoteProgressForTokens)
.contains(tokensRequiredToAchieveResult) .contains(tokensRequiredToAchieveResult)
.and('be.visible'); .and('be.visible');
@ -582,18 +583,18 @@ context(
cy.get_proposal_information_from_table('Will pass') cy.get_proposal_information_from_table('Will pass')
.contains('👍') .contains('👍')
.should('be.visible'); .should('be.visible');
// 1004-VOTE-062 // 3001-VOTE-062
cy.get_proposal_information_from_table('Majority met') cy.get_proposal_information_from_table('Majority met')
.contains('👍') .contains('👍')
.should('be.visible'); .should('be.visible');
cy.get_proposal_information_from_table('Participation met') cy.get_proposal_information_from_table('Participation met')
.contains('👍') .contains('👍')
.should('be.visible'); .should('be.visible');
// 1004-VOTE-042 // 3001-VOTE-042
// 1004-VOTE-057 // 3001-VOTE-057
// 1004-VOTE-058 // 3001-VOTE-058
// 1004-VOTE-059 // 3001-VOTE-059
// 1004-VOTE-060 // 3001-VOTE-060
cy.contains('Currently set to pass').should('be.visible'); cy.contains('Currently set to pass').should('be.visible');
}); });
}); });
@ -689,7 +690,7 @@ context(
// Json containing unexpected field no longer fails submission // Json containing unexpected field no longer fails submission
it.skip('Unable to create a freeform proposal - when json parent section contains unexpected field', function () { it.skip('Unable to create a freeform proposal - when json parent section contains unexpected field', function () {
// 1004-VOTE-038 // 3001-VOTE-038
cy.ensure_specified_unstaked_tokens_are_associated( cy.ensure_specified_unstaked_tokens_are_associated(
this.minProposerBalance this.minProposerBalance
); );
@ -722,7 +723,7 @@ context(
// Json containing unexpected field no longer fails submission // Json containing unexpected field no longer fails submission
it.skip('Unable to create a freeform proposal - when json terms section contains unexpected field', function () { it.skip('Unable to create a freeform proposal - when json terms section contains unexpected field', function () {
// 1004-VOTE-038 // 3001-VOTE-038
cy.ensure_specified_unstaked_tokens_are_associated( cy.ensure_specified_unstaked_tokens_are_associated(
this.minProposerBalance this.minProposerBalance
); );
@ -787,8 +788,8 @@ context(
cy.get_submitted_proposal_from_proposal_list() cy.get_submitted_proposal_from_proposal_list()
.as('submittedProposal') .as('submittedProposal')
.within(() => cy.get(viewProposalButton).click()); .within(() => cy.get(viewProposalButton).click());
// 1004-VOTE-075 // 3001-VOTE-075
// 1004-VOTE-076 // 3001-VOTE-076
cy.get(connectToVegaWalletButton) cy.get(connectToVegaWalletButton)
.should('be.visible') .should('be.visible')
.and('have.text', 'Connect Vega wallet') .and('have.text', 'Connect Vega wallet')
@ -801,13 +802,13 @@ context(
}); });
cy.get(vegaWalletNameElement).should('be.visible'); cy.get(vegaWalletNameElement).should('be.visible');
cy.get(connectToVegaWalletButton).should('not.exist'); cy.get(connectToVegaWalletButton).should('not.exist');
// 1004-VOTE-100 // 3001-VOTE-100
cy.get(vegaWalletAssociatedBalance, txTimeout).contains( cy.get(vegaWalletAssociatedBalance, txTimeout).contains(
'1.000000000000000000', '1.000000000000000000',
txTimeout txTimeout
); );
cy.vote_for_proposal('against'); cy.vote_for_proposal('against');
// 1004-VOTE-079 // 3001-VOTE-079
cy.contains('You voted: Against').should('be.visible'); cy.contains('You voted: Against').should('be.visible');
}); });

View File

@ -25,6 +25,7 @@ const governanceProposalType = {
RAW: 'raw proposal', RAW: 'raw proposal',
}; };
// 3001-VOTE-007
context( context(
'Governance flow - form validations for different governance proposals', 'Governance flow - form validations for different governance proposals',
{ tags: '@slow' }, { tags: '@slow' },
@ -55,17 +56,18 @@ context(
it('Able to submit valid update network parameter proposal', function () { it('Able to submit valid update network parameter proposal', function () {
cy.navigate_to_page_if_not_already_loaded('governance'); cy.navigate_to_page_if_not_already_loaded('governance');
cy.go_to_make_new_proposal(governanceProposalType.NETWORK_PARAMETER); cy.go_to_make_new_proposal(governanceProposalType.NETWORK_PARAMETER);
// 1005-PROP-006 // 3002-PROP-006
cy.get(newProposalTitle).type('Test update network parameter proposal'); cy.get(newProposalTitle).type('Test update network parameter proposal');
// 1005-PROP-007 // 3002-PROP-007
cy.get(newProposalDescription).type('E2E test for proposals'); cy.get(newProposalDescription).type('E2E test for proposals');
cy.get(proposalParameterSelect).find('option').should('have.length', 109); cy.get(proposalParameterSelect).find('option').should('have.length', 109);
cy.get(proposalParameterSelect).select( cy.get(proposalParameterSelect).select(
// 3007-PNEC-002
'governance_proposal_asset_minEnact' 'governance_proposal_asset_minEnact'
); );
cy.get(currentParameterValue).should('have.value', '2s'); cy.get(currentParameterValue).should('have.value', '2s');
cy.get(newProposedParameterValue).type('5s'); cy.get(newProposedParameterValue).type('5s'); // 3007-PNEC-003
cy.get(newProposalSubmitButton).should('be.visible').click(); cy.get(newProposalSubmitButton).should('be.visible').click();
cy.wait_for_proposal_submitted(); cy.wait_for_proposal_submitted();
}); });
@ -95,6 +97,7 @@ context(
); );
}); });
// 3003-PMAN-001
it('Able to submit valid new market proposal', function () { it('Able to submit valid new market proposal', function () {
cy.go_to_make_new_proposal(governanceProposalType.NEW_MARKET); cy.go_to_make_new_proposal(governanceProposalType.NEW_MARKET);
cy.get(newProposalTitle).type('Test new market proposal'); cy.get(newProposalTitle).type('Test new market proposal');
@ -140,6 +143,7 @@ context(
cy.wait_for_proposal_submitted(); cy.wait_for_proposal_submitted();
}); });
// 3001-VOTE-026 3001-VOTE-027 3001-VOTE-028 3001-VOTE-095 3001-VOTE-096 3005-PASN-001
it('Able to submit new asset proposal', function () { it('Able to submit new asset proposal', function () {
cy.go_to_make_new_proposal(governanceProposalType.NEW_ASSET); cy.go_to_make_new_proposal(governanceProposalType.NEW_ASSET);
cy.get(newProposalTitle).type('Test new asset proposal'); cy.get(newProposalTitle).type('Test new asset proposal');

View File

@ -22,14 +22,14 @@ context(
}); });
it('should be able to see a working link for - find out more about Vega governance', function () { it('should be able to see a working link for - find out more about Vega governance', function () {
// 1004-VOTE-001 // 3001-VOTE-001
cy.get(proposalDocumentationLink) cy.get(proposalDocumentationLink)
.should('be.visible') .should('be.visible')
.and('have.text', 'Find out more about Vega governance') .and('have.text', 'Find out more about Vega governance')
.and('have.attr', 'href') .and('have.attr', 'href')
.and('equal', governanceDocsUrl); .and('equal', governanceDocsUrl);
// 1005-PROP-001 // 3002-PROP-001
cy.request(governanceDocsUrl) cy.request(governanceDocsUrl)
.its('body') .its('body')
.then((body) => { .then((body) => {
@ -44,7 +44,7 @@ context(
}); });
it('should be able to see button for - new proposal', function () { it('should be able to see button for - new proposal', function () {
// 1004-VOTE-002 // 3001-VOTE-002
cy.get(newProposalLink) cy.get(newProposalLink)
.should('be.visible') .should('be.visible')
.and('have.text', 'New proposal') .and('have.text', 'New proposal')