diff --git a/.github/workflows/capsule-cypress-manual-trigger.yml b/.github/workflows/capsule-cypress-manual-trigger.yml index 05c9377a2..98339188d 100644 --- a/.github/workflows/capsule-cypress-manual-trigger.yml +++ b/.github/workflows/capsule-cypress-manual-trigger.yml @@ -133,7 +133,7 @@ jobs: working-directory: frontend-monorepo - name: Run Cypress tests - run: yarn nx run ${{ github.event.inputs.project }}:e2e --record --key ${{ secrets.CYPRESS_RECORD_KEY }} --browser chrome + run: yarn nx run ${{ github.event.inputs.project }}:e2e --record --key ${{ secrets.CYPRESS_RECORD_KEY }} working-directory: frontend-monorepo env: CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE: ${{ secrets.CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE }} diff --git a/.github/workflows/capsule-cypress-night-run.yml b/.github/workflows/capsule-cypress-night-run.yml index 769062af2..befc1ce14 100644 --- a/.github/workflows/capsule-cypress-night-run.yml +++ b/.github/workflows/capsule-cypress-night-run.yml @@ -117,7 +117,7 @@ jobs: working-directory: frontend-monorepo - name: Run Cypress tests - run: yarn nx run-many --target=e2e --all --record --key ${{ secrets.CYPRESS_RECORD_KEY }} --browser chrome + run: yarn nx run-many --target=e2e --all --record --key ${{ secrets.CYPRESS_RECORD_KEY }} working-directory: frontend-monorepo env: CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE: ${{ secrets.CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE }} diff --git a/.github/workflows/capsule-cypress.yml b/.github/workflows/capsule-cypress.yml index 74bbe04d6..a2eb2a4d1 100644 --- a/.github/workflows/capsule-cypress.yml +++ b/.github/workflows/capsule-cypress.yml @@ -130,7 +130,7 @@ jobs: working-directory: frontend-monorepo - name: Run Cypress tests - run: npx nx affected:e2e --record --key ${{ secrets.CYPRESS_RECORD_KEY }} --browser chrome + run: npx nx affected:e2e --record --key ${{ secrets.CYPRESS_RECORD_KEY }} working-directory: frontend-monorepo env: CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE: ${{ secrets.CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE }} diff --git a/apps/trading-e2e/src/integration/home.cy.ts b/apps/trading-e2e/src/integration/home.cy.ts index daf1724ad..fad513963 100644 --- a/apps/trading-e2e/src/integration/home.cy.ts +++ b/apps/trading-e2e/src/integration/home.cy.ts @@ -12,6 +12,8 @@ describe('home', () => { mockTradingPage(req, MarketState.STATE_ACTIVE); }); cy.visit('/'); + cy.wait('@Market'); + cy.get('main[data-testid="market"]', { timeout: 20000 }).should('exist'); // Wait for page to be rendered to before checking url // Overlay should be shown diff --git a/apps/trading-e2e/src/integration/market-info.cy.ts b/apps/trading-e2e/src/integration/market-info.cy.ts index 0cc3bda16..c6672e1ed 100644 --- a/apps/trading-e2e/src/integration/market-info.cy.ts +++ b/apps/trading-e2e/src/integration/market-info.cy.ts @@ -4,6 +4,7 @@ import { mockTradingPage } from '../support/trading'; const marketInfoBtn = 'Info'; const row = 'key-value-table-row'; const marketTitle = 'accordion-title'; +const externalLink = 'external-link'; describe('market info is displayed', () => { before(() => { @@ -25,9 +26,9 @@ describe('market info is displayed', () => { it('market price', () => { cy.getByTestId(marketTitle).contains('Market price').click(); - validateMarketDataRow(0, 'Mark Price', '57.49'); - validateMarketDataRow(1, 'Best Bid Price', '6,817.65'); - validateMarketDataRow(2, 'Best Offer Price', '6,817.69'); + validateMarketDataRow(0, 'Mark Price', '0.05749'); + validateMarketDataRow(1, 'Best Bid Price', '6.81765 '); + validateMarketDataRow(2, 'Best Offer Price', '6.81769 '); }); it('market volume displayed', () => { @@ -71,11 +72,7 @@ describe('market info is displayed', () => { validateMarketDataRow(0, 'Name', 'tBTC TEST'); validateMarketDataRow(1, 'Symbol', 'tBTC'); - validateMarketDataRow( - 2, - 'Asset ID', - '5cfa87844724df6069b94e4c8a6f03af21907d7bc251593d08e4251043ee9f7c' - ); + validateMarketDataRow(2, 'Asset ID', 'market-0'); }); it('metadata displayed', () => { @@ -114,9 +111,9 @@ describe('market info is displayed', () => { it('price monitoring bound displayed', () => { cy.getByTestId(marketTitle).contains('Price monitoring bound 1').click(); - validateMarketDataRow(0, 'Min Valid Price', '6,547.01'); - validateMarketDataRow(1, 'Max Valid Price', '7,973.23'); - validateMarketDataRow(2, 'Reference Price', '7,226.25'); + validateMarketDataRow(0, 'Min Valid Price', '6.54701 '); + validateMarketDataRow(1, 'Max Valid Price', '7.97323 '); + validateMarketDataRow(2, 'Reference Price', '7.22625 '); }); it('liquidity monitoring parameters displayed', () => { @@ -129,6 +126,20 @@ describe('market info is displayed', () => { validateMarketDataRow(2, 'Scaling Factor', '10'); }); + it('liquidity displayed', () => { + cy.getByTestId('accordion-toggle').eq(14).click(); + + validateMarketDataRow(0, 'Target Stake', '0.56789 tBTC'); + validateMarketDataRow(1, 'Supplied Stake', '0.56767 tBTC'); + validateMarketDataRow(2, 'Market Value Proxy', '6.77678 tBTC'); + + cy.getByTestId(externalLink).should( + 'have.attr', + 'href', + '/liquidity/market-0' + ); + }); + it('oracle displayed', () => { cy.getByTestId(marketTitle).contains('Oracle').click(); @@ -148,6 +159,19 @@ describe('market info is displayed', () => { 'Termination Oracle', 'f028fe5ea7de3890962a05a7163fdde562629af649ed81b8c8902fafb6eef04f' ); + + cy.getByTestId(externalLink) + .should('have.attr', 'href') + .and('contain', '/oracles'); + }); + + it('proposal displayed', () => { + cy.getByTestId(marketTitle).contains('Proposal').click(); + + cy.getByTestId(externalLink) + .should('have.text', 'View governance proposal') + .and('have.attr', 'href') + .and('contain', '/governance/market-0'); }); afterEach('close toggle', () => { diff --git a/apps/trading-e2e/src/integration/withdraw.cy.ts b/apps/trading-e2e/src/integration/withdraw.cy.ts index 895a1171d..d78adade8 100644 --- a/apps/trading-e2e/src/integration/withdraw.cy.ts +++ b/apps/trading-e2e/src/integration/withdraw.cy.ts @@ -83,6 +83,18 @@ describe('withdraw', () => { }, }); cy.get(assetSelectField).select('Asset 0'); + cy.getByTestId('balance-available') + .should('contain.text', 'Balance available') + .find('td') + .should('have.text', '1000'); + cy.getByTestId('withdrawal-threshold') + .should('contain.text', 'Delayed withdrawal threshold') + .find('td') + .should('contain.text', '1m+'); + cy.getByTestId('delay-time') + .should('contain.text', 'Delay time') + .find('td') + .should('have.text', 'None'); cy.get(amountField).clear().type('10'); cy.getByTestId(submitWithdrawBtn).click(); cy.getByTestId('dialog-title').should( diff --git a/apps/trading-e2e/src/support/mocks/generate-market-info-query.ts b/apps/trading-e2e/src/support/mocks/generate-market-info-query.ts index f11f8867e..f17bafb53 100644 --- a/apps/trading-e2e/src/support/mocks/generate-market-info-query.ts +++ b/apps/trading-e2e/src/support/mocks/generate-market-info-query.ts @@ -15,7 +15,7 @@ export const generateMarketInfoQuery = ( market: { __typename: 'Market', id: 'market-0', - decimalPlaces: 2, + decimalPlaces: 5, positionDecimalPlaces: 0, state: MarketState.STATE_ACTIVE, tradingMode: MarketTradingMode.TRADING_MODE_CONTINUOUS, @@ -144,10 +144,10 @@ export const generateMarketInfoQuery = ( quoteName: 'BTC', settlementAsset: { __typename: 'Asset', - id: '5cfa87844724df6069b94e4c8a6f03af21907d7bc251593d08e4251043ee9f7c', + id: 'market-0', symbol: 'tBTC', name: 'tBTC TEST', - decimals: 1, + decimals: 5, }, oracleSpecForSettlementPrice: { __typename: 'OracleSpec', diff --git a/libs/withdraws/src/lib/withdraw-limits.tsx b/libs/withdraws/src/lib/withdraw-limits.tsx index ebb2141c2..16c006b52 100644 --- a/libs/withdraws/src/lib/withdraw-limits.tsx +++ b/libs/withdraws/src/lib/withdraw-limits.tsx @@ -33,17 +33,17 @@ export const WithdrawLimits = ({ return ( - + - + - +
{t('Balance available')} {balance.toString()}
{t('Delayed withdrawal threshold')} {text}
{t('Delay time')} {delayTime}