Test/governance and wallet tweaks (#1309)

* test: tweaks

* test: lint

* test: lint

* test: remove unnessecary timeouts

* test: lint

* test: syntax tweak
This commit is contained in:
AndyWhiteVega 2022-09-13 08:43:40 +01:00 committed by GitHub
parent 4505e86363
commit 535bdb5183
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 13 deletions

View File

@ -1,6 +1,6 @@
{ {
"rationale": { "rationale": {
"title": "An example freeform proposal", "title": "An example freeform proposal with unique number of: ",
"description": "I propose that everyone evaluate the following IPFS document and vote Yes if they agree. [bafybeigwwctpv37xdcwacqxvekr6e4kaemqsrv34em6glkbiceo3fcy4si](https://dweb.link/ipfs/bafybeigwwctpv37xdcwacqxvekr6e4kaemqsrv34em6glkbiceo3fcy4si)" "description": "I propose that everyone evaluate the following IPFS document and vote Yes if they agree. [bafybeigwwctpv37xdcwacqxvekr6e4kaemqsrv34em6glkbiceo3fcy4si](https://dweb.link/ipfs/bafybeigwwctpv37xdcwacqxvekr6e4kaemqsrv34em6glkbiceo3fcy4si)"
}, },
"terms": { "terms": {

View File

@ -196,11 +196,7 @@ context('Governance flow - with eth and vega wallets connected', function () {
.then((proposalId) => { .then((proposalId) => {
cy.get('[data-testid="set-proposals-filter-visible"]').click(); cy.get('[data-testid="set-proposals-filter-visible"]').click();
cy.get('[data-testid="filter-input"]').type(proposalId); cy.get('[data-testid="filter-input"]').type(proposalId);
cy.get(`#${proposalId}`).should( cy.get(`#${proposalId}`).should('contain', proposalId);
'contain',
`Freeform proposal: ${proposalId}`,
txTimeout
);
}); });
}); });
@ -230,11 +226,7 @@ context('Governance flow - with eth and vega wallets connected', function () {
let proposalId = proposal.response.body.data.busEvents[0].event.id; let proposalId = proposal.response.body.data.busEvents[0].event.id;
cy.get('[data-testid="set-proposals-filter-visible"]').click(); cy.get('[data-testid="set-proposals-filter-visible"]').click();
cy.get('[data-testid="filter-input"]').type(proposerId); cy.get('[data-testid="filter-input"]').type(proposerId);
cy.get(`#${proposalId}`).should( cy.get(`#${proposalId}`).should('contain', proposalId);
'contain',
`Freeform proposal: ${proposalId}`,
txTimeout
);
}); });
}); });
@ -264,7 +256,7 @@ context('Governance flow - with eth and vega wallets connected', function () {
.then((proposalId) => { .then((proposalId) => {
cy.get(openProposals).within(() => { cy.get(openProposals).within(() => {
cy.get(`#${proposalId}`) cy.get(`#${proposalId}`)
.should('contain', `Freeform proposal: ${proposalId}`, txTimeout) .should('contain', proposalId)
.and('contain', 'Open') .and('contain', 'Open')
.and('be.visible') .and('be.visible')
.within(() => { .within(() => {

View File

@ -1,5 +1,6 @@
const vegaWalletContainer = '[data-testid="vega-wallet"]'; const vegaWalletContainer = '[data-testid="vega-wallet"]';
const restConnectorForm = '[data-testid="rest-connector-form"]'; const restConnectorForm = '[data-testid="rest-connector-form"]';
const vegaWalletNameElement = '[data-testid="wallet-name"]';
const vegaWalletName = Cypress.env('vegaWalletName'); const vegaWalletName = Cypress.env('vegaWalletName');
const vegaWalletLocation = Cypress.env('vegaWalletLocation'); const vegaWalletLocation = Cypress.env('vegaWalletLocation');
const vegaWalletPassphrase = Cypress.env('vegaWalletPassphrase'); const vegaWalletPassphrase = Cypress.env('vegaWalletPassphrase');
@ -14,6 +15,11 @@ Cypress.Commands.add('vega_wallet_import', () => {
cy.exec( cy.exec(
`vegawallet service run --network DV --automatic-consent --home ${vegaWalletLocation}` `vegawallet service run --network DV --automatic-consent --home ${vegaWalletLocation}`
); );
cy.exec(`vegawallet version`)
.its('stdout')
.then((output) => {
cy.log(output);
});
}); });
Cypress.Commands.add('vega_wallet_connect', () => { Cypress.Commands.add('vega_wallet_connect', () => {
@ -31,5 +37,5 @@ Cypress.Commands.add('vega_wallet_connect', () => {
cy.get('#passphrase').click().type(vegaWalletPassphrase); cy.get('#passphrase').click().type(vegaWalletPassphrase);
cy.get('button').contains('Connect').click(); cy.get('button').contains('Connect').click();
}); });
cy.contains(`${vegaWalletName} key`, { timeout: 20000 }).should('be.visible'); cy.get(vegaWalletNameElement).should('be.visible');
}); });