Compare commits

..
14 changed files with 74 additions and 29 deletions
@@ -1,7 +1,7 @@
import { getNewAssetTxBody } from '../support/governance.functions';
context('Proposal page', { tags: '@smoke' }, function () {
describe.skip('Verify elements on page', function () {
describe('Verify elements on page', function () {
const proposalHeading = 'proposals-heading';
const dateTimeRegex =
/(\d{1,2})\/(\d{1,2})\/(\d{4}), (\d{1,2}):(\d{1,2}):(\d{1,2})/gm;
@@ -7,6 +7,7 @@ import {
navigateTo,
navigation,
turnTelemetryOff,
setRiskAccepted,
} from '../../support/common.functions';
import {
clickOnValidatorFromList,
@@ -57,6 +58,7 @@ context(
// 1002-STKE-002, 1002-STKE-032
before('visit staking tab and connect vega wallet', function () {
cy.visit('/');
setRiskAccepted();
ethereumWalletConnect();
cy.connectVegaWallet();
vegaWalletSetSpecifiedApprovalAmount('1000');
@@ -5,6 +5,7 @@ import {
navigateTo,
navigation,
turnTelemetryOff,
setRiskAccepted,
} from '../../support/common.functions';
import {
stakingPageAssociateTokens,
@@ -57,6 +58,7 @@ context(
function () {
cy.clearLocalStorage();
turnTelemetryOff();
setRiskAccepted();
cy.mockChainId();
cy.reload();
waitForSpinner();
@@ -82,20 +82,20 @@ context('Home Page - verify elements on page', { tags: '@smoke' }, function () {
it('should have information on active nodes', function () {
cy.getByTestId('node-information')
.first()
.should('contain.text', '1')
.should('contain.text', '2')
.and('contain.text', 'active nodes');
});
it('should have information on consensus nodes', function () {
cy.getByTestId('node-information')
.last()
.should('contain.text', '1')
.should('contain.text', '2')
.and('contain.text', 'consensus nodes');
});
it('should contain link to specific validators', function () {
cy.getByTestId('validators')
.should('have.length', '1')
.should('have.length', '2')
.each(($validator) => {
cy.wrap($validator).find('a').should('have.attr', 'href');
});
@@ -3,6 +3,7 @@
import { aliasGQLQuery } from '@vegaprotocol/cypress';
import {
navigation,
setRiskAccepted,
verifyPageHeader,
verifyTabHighlighted,
} from '../../support/common.functions';
@@ -187,6 +188,7 @@ context('Validators Page - verify elements on page', function () {
before('connect wallets and click on validator', function () {
cy.mockChainId();
cy.visit('/validators');
setRiskAccepted();
cy.connectVegaWallet();
clickOnValidatorFromList(0);
});
@@ -1,5 +1,8 @@
import { truncateByChars } from '@vegaprotocol/utils';
import { waitForSpinner } from '../../support/common.functions';
import {
setRiskAccepted,
waitForSpinner,
} from '../../support/common.functions';
import {
vegaWalletFaucetAssetsWithoutCheck,
vegaWalletTeardown,
@@ -11,7 +14,6 @@ const connectButton = 'connect-vega-wallet';
const getVegaLink = 'link';
const dialog = '[role="dialog"]:visible';
const dialogHeader = 'dialog-title';
const walletDialogHeader = 'wallet-dialog-title';
const connectorsList = 'connectors-list';
const dialogCloseBtn = 'dialog-close';
const accountNo = 'vega-account-truncated';
@@ -34,6 +36,7 @@ context(
() => {
before('visit token home page', () => {
cy.visit('/');
setRiskAccepted();
cy.get(walletContainer, { timeout: 60000 }).should('be.visible');
});
@@ -63,17 +66,12 @@ context(
it('should have Connect Vega header visible', () => {
cy.get(dialog).within(() => {
cy.getByTestId(walletDialogHeader)
cy.getByTestId(connectorsList)
.should('be.visible')
.and('have.text', 'Get a Vega wallet');
});
});
it('should have jsonRpc and hosted connection options visible on list', function () {
cy.getByTestId(connectorsList).within(() => {
cy.getByTestId('connector-jsonRpc')
.should('be.visible')
.and('have.text', 'Use the Desktop App/CLI');
.and(
'have.text',
'Get the Vega WalletGet MetaMask>_Command Line WalletView as public key'
);
});
});
@@ -88,7 +86,6 @@ context(
before('connect vega wallet', function () {
cy.mockChainId();
cy.visit('/');
cy.wait('@ChainId');
cy.connectVegaWallet();
vegaWalletTeardown();
});
@@ -102,6 +102,12 @@ export function turnTelemetryOff() {
);
}
export function setRiskAccepted() {
cy.window().then((win) =>
win.localStorage.setItem('vega_wallet_risk_accepted', 'true')
);
}
export function dissociateFromSecondWalletKey() {
const secondWalletKey = Cypress.env('vegaWalletPublicKey2Short');
cy.getByTestId('vega-in-wallet')
@@ -112,8 +112,6 @@ export function createNewMarketProposalTxBody(): ProposalSubmissionBody {
performanceHysteresisEpochs: 2,
slaCompetitionFactor: '0.1',
},
// FIXME: workaround because of https://github.com/vegaprotocol/vega/issues/10343
quadraticSlippageFactor: '0',
instrument: {
name: 'Token test market',
code: 'TEST.24h',
@@ -210,6 +208,16 @@ export function createNewMarketProposalTxBody(): ProposalSubmissionBody {
sigma: 0.5,
},
},
markPriceConfiguration: {
decayWeight: '1',
decayPower: '1',
cashAmount: '5000000',
sourceWeights: undefined,
sourceStalenessTolerance: ['1m0s', '1m0s', '1m0s'],
compositePriceType: 'COMPOSITE_PRICE_TYPE_WEIGHTED',
dataSourcesSpec: [],
dataSourcesSpecBinding: [],
},
},
},
closingTimestamp,
@@ -242,8 +250,6 @@ export function createSuccessorMarketProposalTxBody(
decimalPlaces: '5',
positionDecimalPlaces: '5',
linearSlippageFactor: '0.001',
// FIXME: workaround because of https://github.com/vegaprotocol/vega/issues/10343
quadraticSlippageFactor: '0',
liquiditySlaParameters: {
priceRange: '0.5',
commitmentMinTimeFraction: '0.1',
@@ -354,6 +360,16 @@ export function createSuccessorMarketProposalTxBody(
parentMarketId: parentMarketId,
insurancePoolFraction: '0.75',
},
markPriceConfiguration: {
decayWeight: '1',
decayPower: '1',
cashAmount: '5000000',
sourceWeights: undefined,
sourceStalenessTolerance: ['1m0s', '1m0s', '1m0s'],
compositePriceType: 'COMPOSITE_PRICE_TYPE_WEIGHTED',
dataSourcesSpec: [],
dataSourcesSpecBinding: [],
},
},
},
closingTimestamp,
+10 -1
View File
@@ -35,7 +35,6 @@ function createNewMarketProposal(): ProposalSubmissionBody {
decimalPlaces: '5',
positionDecimalPlaces: '5',
linearSlippageFactor: '0.001',
quadraticSlippageFactor: '0',
instrument: {
name: 'Test market 1',
code: 'TEST.24h',
@@ -137,6 +136,16 @@ function createNewMarketProposal(): ProposalSubmissionBody {
performanceHysteresisEpochs: 2,
slaCompetitionFactor: '0.75',
},
markPriceConfiguration: {
decayWeight: '1',
decayPower: '1',
cashAmount: '5000000',
sourceWeights: undefined,
sourceStalenessTolerance: ['1m0s', '1m0s', '1m0s'],
compositePriceType: 'COMPOSITE_PRICE_TYPE_WEIGHTED',
dataSourcesSpec: [],
dataSourcesSpecBinding: [],
},
},
},
closingTimestamp,
@@ -12,7 +12,7 @@ declare global {
}
}
const chainId = 'test-id';
const chainId = 'vega-stagnet1-202307191148';
export function addMockChainId() {
Cypress.Commands.add('mockChainId', () => {
@@ -37,10 +37,12 @@ export function addVegaWalletConnect() {
Cypress.Commands.add('connectVegaWallet', (isMobile) => {
mockConnectWallet();
cy.highlight(`Connecting Vega Wallet`);
cy.get('[data-testid="splash-loader"]', { timeout: 20000 }).should(
'not.exist'
);
const connectVegaWalletButton = `[data-testid=connect-vega-wallet${
isMobile ? '-mobile' : ''
}]:visible`;
cy.get(connectVegaWalletButton).then((btn) => {
if (btn.length === 0) {
cy.log('could not find the button, perhaps already connected');
+3 -2
View File
@@ -13,7 +13,8 @@ declare global {
const hasMethod = (req: CyHttpMessages.IncomingHttpRequest, method: string) => {
const { body } = req;
return 'method' in body && body.method === method;
const b = JSON.parse(body);
return 'method' in b && b.method === method;
};
export function addMockWalletCommand() {
@@ -72,7 +73,7 @@ export const aliasWalletConnectQuery = (
body: {
jsonrpc: '2.0',
result: {
chainID: 'test-id',
chainID: 'vega-fairground-202305051805',
},
id: '1',
},
@@ -121,6 +121,7 @@ export class SnapConnector implements Connector {
async listKeys() {
try {
const res = await this.invokeSnap<{
// eslint-disable-next-line no-restricted-globals
keys: Array<{ publicKey: string; name: string }>;
}>(JsonRpcMethod.ListKeys);
return res.keys;
+10 -3
View File
@@ -138,7 +138,6 @@ interface ProposalNewMarketTerms {
positionDecimalPlaces: string;
linearSlippageFactor: string;
// FIXME: workaround because of https://github.com/vegaprotocol/vega/issues/10343
quadraticSlippageFactor: string;
instrument: {
name: string;
code: string;
@@ -164,6 +163,16 @@ interface ProposalNewMarketTerms {
logNormal: LogNormal;
successor?: Successor;
liquiditySlaParameters: LiquiditySLAParameters;
markPriceConfiguration: {
decayWeight: string;
decayPower: string;
cashAmount: string;
sourceWeights: undefined;
sourceStalenessTolerance: string[];
compositePriceType: string;
dataSourcesSpec: Schema.DataSourceDefinition[];
dataSourcesSpecBinding: Schema.SpecBindingForCompositePrice[];
};
};
};
closingTimestamp: number;
@@ -175,8 +184,6 @@ interface ProposalUpdateMarketTerms {
marketId: string;
changes: {
linearSlippageFactor: string;
// FIXME: workaround because of https://github.com/vegaprotocol/vega/issues/10343
quadraticSlippageFactor: string;
instrument: {
code: string;
future: {