From ff14d7c8dd8d14b553507f7a7c331de7359016cc Mon Sep 17 00:00:00 2001 From: Dariusz Majcherczyk Date: Tue, 20 Jun 2023 17:37:43 +0200 Subject: [PATCH] test: cover post and reduce only ACs --- .../trading-deal-ticket-time-in-force.cy.ts | 36 ++++++++++++++++--- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/apps/trading-e2e/src/integration/trading-deal-ticket-time-in-force.cy.ts b/apps/trading-e2e/src/integration/trading-deal-ticket-time-in-force.cy.ts index c7112276d..92dc36b5f 100644 --- a/apps/trading-e2e/src/integration/trading-deal-ticket-time-in-force.cy.ts +++ b/apps/trading-e2e/src/integration/trading-deal-ticket-time-in-force.cy.ts @@ -5,6 +5,10 @@ import { toggleMarket, } from '../support/deal-ticket'; +const tooltipContent = 'tooltip-content'; +const reduceOnly = 'reduce-only'; +const postOnly = 'post-only'; + describe('time in force validation', { tags: '@smoke' }, () => { before(() => { cy.setVegaWallet(); @@ -122,13 +126,18 @@ describe('time in force validation', { tags: '@smoke' }, () => { // 7002-SORD-026 it(`post and reduce order market for ${tif.code}`, function () { + // 7003-SORD-054 + // 7003-SORD-055 + // 7003-SORD-056 + // 7003-SORD-057 + cy.getByTestId(orderTIFDropDown).select(tif.value); cy.get(`[data-testid=${orderTIFDropDown}] option:selected`).should( 'have.text', tif.text ); - cy.getByTestId('post-only').should('be.disabled'); - cy.getByTestId('reduce-only').should('be.enabled'); + cy.getByTestId(postOnly).should('be.disabled'); + cy.getByTestId(reduceOnly).should('be.enabled'); }); }); }); @@ -144,14 +153,33 @@ describe('time in force validation', { tags: '@smoke' }, () => { validTIFLimit.forEach((tif) => { it(`post and reduce order for limit ${tif.code}`, function () { + // 7003-SORD-054 + // 7003-SORD-055 + // 7003-SORD-056 + // 7003-SORD-057 cy.getByTestId(orderTIFDropDown).select(tif.value); cy.get(`[data-testid=${orderTIFDropDown}] option:selected`).should( 'have.text', tif.text ); - cy.getByTestId('post-only').should('be.enabled'); - cy.getByTestId('reduce-only').should('be.disabled'); + cy.getByTestId(postOnly).should('be.enabled'); + cy.getByTestId(reduceOnly).should('be.disabled'); }); }); + it(`can see explanation of what post only and reduce only is/does`, function () { + // 7003-SORD-058 + cy.get('[for="post-only"]').should('have.text', 'Post only').realHover(); + cy.getByTestId(tooltipContent).should( + 'contain.text', + `"Post only" will ensure the order is not filled immediately but is placed on the order book as a passive order. When the order is processed it is either stopped (if it would not be filled immediately), or placed in the order book as a passive order until the price taker matches with it.` + ); + cy.get('[for="reduce-only"]') + .should('have.text', 'Reduce only') + .realHover(); + cy.getByTestId(tooltipContent).should( + 'contain.text', + `"Reduce only" can be used only with non-persistent orders, such as "Fill or Kill" or "Immediate or Cancel".` + ); + }); }); });