chore(trading): update vega-market-sim to use to 0.74.0-preview.2 (#5603)

This commit is contained in:
Ben 2024-01-17 12:19:52 +00:00 committed by GitHub
parent c63cba1071
commit a3c55fd7c3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
16 changed files with 124 additions and 94 deletions

View File

@ -19,7 +19,7 @@ jobs:
create-docker-image: create-docker-image:
name: Create docker image for console-test name: Create docker image for console-test
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
timeout-minutes: 20 timeout-minutes: 90
steps: steps:
#---------------------------------------------- #----------------------------------------------
# check-out frontend-monorepo # check-out frontend-monorepo
@ -138,7 +138,7 @@ jobs:
name: run-tests name: run-tests
runs-on: 8-cores runs-on: 8-cores
needs: [create-docker-image, console-test-branch] needs: [create-docker-image, console-test-branch]
timeout-minutes: 20 timeout-minutes: 90
steps: steps:
#---------------------------------------------- #----------------------------------------------
# load docker image # load docker image
@ -205,7 +205,7 @@ jobs:
# run tests # run tests
#---------------------------------------------- #----------------------------------------------
- name: Run tests - name: Run tests
run: CONSOLE_IMAGE_NAME=ci/trading:local poetry run pytest -v -s --numprocesses 4 --dist loadfile --durations=15 run: CONSOLE_IMAGE_NAME=ci/trading:local poetry run pytest -v -s --numprocesses 1 --dist loadfile --durations=90
working-directory: apps/trading/e2e working-directory: apps/trading/e2e
#---------------------------------------------- #----------------------------------------------
# upload traces # upload traces
@ -230,28 +230,43 @@ jobs:
#---------------------------------------------- #----------------------------------------------
# ----- upload market-sim logs ----- # ----- upload market-sim logs -----
#---------------------------------------------- #----------------------------------------------
- name: Find Directory - name: Prepare and Zip market-sim-logs
id: find-dir if: always()
run: | run: |
DIR=$(find /tmp -type d -name "vega-sim-*" -print -quit) parent_dir="/tmp/market-sim-logs"
if [[ -d "$DIR" ]]; then echo "Creating parent directory at $parent_dir"
echo "Found directory: $DIR" mkdir -p "$parent_dir"
echo "DIR=$DIR" >> $GITHUB_ENV
else echo "Waiting for vega-sim-* folders to be created..."
echo "Directory not found." sleep 10 # Waits 10 seconds to ensure all folders are created
exit 1
echo "Before searching for vega-sim-* folders in /tmp..."
folders=$(find /tmp -mindepth 1 -type d -name 'vega-sim-*' -print) || echo "Find command failed with exit code $?"
echo "After searching for vega-sim-* folders in /tmp..."
if [ -z "$folders" ]; then
echo "No vega-sim-* folders found."
exit 0
fi fi
- name: Compress Files echo "Moving vega-sim-* folders to $parent_dir"
if: env.DIR echo "$folders" | xargs -I {} mv {} "$parent_dir/"
run: |
tar -czvf ${{ github.workspace }}/market-sim-logs.tar.gz -C "$DIR" .
echo "Compressed files at ${{ github.workspace }}/market-sim-logs.tar.gz"
- name: Upload Compressed market-sim-logs echo "Checking if $parent_dir is not empty..."
if [ "$(ls -A $parent_dir)" ]; then
echo "Zipping the parent directory..."
zip -r market-sim-logs.zip "$parent_dir" && echo "Zip file created successfully."
else
echo "$parent_dir is empty. No zip file created."
exit 0
fi
shell: /usr/bin/bash -e {0}
- name: Upload market-sim-logs
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
if: env.DIR if: always()
with: with:
name: market-sim-logs name: market-sim-logs
path: ${{ github.workspace }}/market-sim-logs.tar.gz path: market-sim-logs.zip
retention-days: 15 retention-days: 15

View File

@ -1,3 +1,3 @@
CONSOLE_IMAGE_NAME=vegaprotocol/trading:latest CONSOLE_IMAGE_NAME=vegaprotocol/trading:latest
VEGA_VERSION=v0.73.10 VEGA_VERSION=v0.74.0-preview.2
LOCAL_SERVER=false LOCAL_SERVER=false

View File

@ -1,3 +1,3 @@
CONSOLE_IMAGE_NAME=vegaprotocol/trading:develop CONSOLE_IMAGE_NAME=vegaprotocol/trading:develop
VEGA_VERSION=v0.73.10 VEGA_VERSION=v0.74.0-preview.2
LOCAL_SERVER=false LOCAL_SERVER=false

View File

@ -25,7 +25,7 @@ def setup_simple_market(
vega.mint( vega.mint(
MM_WALLET.name, MM_WALLET.name,
asset="VOTE", asset=vega.find_asset_id(symbol="VOTE", enabled=True),
amount=mint_amount, amount=mint_amount,
) )
@ -207,7 +207,7 @@ def setup_perps_market(
vega.mint( vega.mint(
MM_WALLET.name, MM_WALLET.name,
asset="VOTE", asset=vega.find_asset_id(symbol="VOTE", enabled=True),
amount=mint_amount, amount=mint_amount,
) )

View File

@ -1,4 +1,4 @@
# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. # This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand.
[[package]] [[package]]
name = "certifi" name = "certifi"
@ -1160,8 +1160,8 @@ profile = ["pytest-profiling", "snakeviz"]
[package.source] [package.source]
type = "git" type = "git"
url = "https://github.com/vegaprotocol/vega-market-sim.git/" url = "https://github.com/vegaprotocol/vega-market-sim.git/"
reference = "fix/genesis_panic" reference = "HEAD"
resolved_reference = "de30d2d4c7a1b81a830527ca76473e23ef59de12" resolved_reference = "2aed8c94b25d8fa2e376d3b63ca1f9193d28cdfd"
[[package]] [[package]]
name = "websocket-client" name = "websocket-client"
@ -1342,4 +1342,4 @@ files = [
[metadata] [metadata]
lock-version = "2.0" lock-version = "2.0"
python-versions = ">=3.9,<3.11" python-versions = ">=3.9,<3.11"
content-hash = "68ed0de55290a3b929d47eb7f7b031fb7e172261c7bbeb4f554b7c27a4462754" content-hash = "39ce8400de7bf060857447281ef27bd78c9b1d9639da063b051e3ae6e7887a67"

View File

@ -9,7 +9,7 @@ packages = [{include = "trading market-sim e2e"}]
[tool.poetry.dependencies] [tool.poetry.dependencies]
python = ">=3.9,<3.11" python = ">=3.9,<3.11"
psutil = "^5.9.5" psutil = "^5.9.5"
vega-sim = {git = "https://github.com/vegaprotocol/vega-market-sim.git/", branch = "fix/genesis_panic"} vega-sim = {git = "https://github.com/vegaprotocol/vega-market-sim.git/"}
pytest-playwright = "^0.4.2" pytest-playwright = "^0.4.2"
docker = "^6.1.3" docker = "^6.1.3"
pytest-xdist = "^3.3.1" pytest-xdist = "^3.3.1"

View File

@ -47,8 +47,8 @@ def test_limit_buy_order_GTT(continuous_market, vega: VegaServiceNull, page: Pag
vega.wait_for_total_catchup() vega.wait_for_total_catchup()
page.get_by_test_id("All").click() page.get_by_test_id("All").click()
# 7002-SORD-017 # 7002-SORD-017
expect(page.get_by_role("row").nth(2)).to_contain_text( expect(page.get_by_role("row").nth(5)).to_contain_text(
"BTC:DAI_2023Futr10+10LimitFilled120.00GTT:" "10+10LimitFilled120.00GTT:"
) )
@pytest.mark.usefixtures("auth", "risk_accepted") @pytest.mark.usefixtures("auth", "risk_accepted")
@ -64,8 +64,8 @@ def test_limit_buy_order(continuous_market, vega: VegaServiceNull, page: Page):
vega.wait_for_total_catchup() vega.wait_for_total_catchup()
page.get_by_test_id("All").click() page.get_by_test_id("All").click()
# 7002-SORD-017 # 7002-SORD-017
expect(page.get_by_role("row").nth(2)).to_contain_text( expect(page.get_by_role("row").nth(6)).to_contain_text(
"BTC:DAI_2023Futr10+10LimitFilled120.00GTC" "10+10LimitFilled120.00GTC"
) )
@pytest.mark.usefixtures("auth", "risk_accepted") @pytest.mark.usefixtures("auth", "risk_accepted")
@ -88,8 +88,8 @@ def test_limit_sell_order(continuous_market, vega: VegaServiceNull, page: Page):
vega.wait_fn(1) vega.wait_fn(1)
vega.wait_for_total_catchup() vega.wait_for_total_catchup()
page.get_by_test_id("All").click() page.get_by_test_id("All").click()
expect(page.get_by_role("row").nth(2)).to_contain_text( expect(page.get_by_role("row").nth(7)).to_contain_text(
"BTC:DAI_2023Futr10-10LimitFilled100.00GFN" "10-10LimitFilled100.00GFN"
) )
@pytest.mark.usefixtures("auth", "risk_accepted") @pytest.mark.usefixtures("auth", "risk_accepted")
@ -112,8 +112,8 @@ def test_market_sell_order(continuous_market, vega: VegaServiceNull, page: Page)
vega.wait_for_total_catchup() vega.wait_for_total_catchup()
page.get_by_test_id("All").click() page.get_by_test_id("All").click()
expect(page.get_by_role("row").nth(2)).to_contain_text( expect(page.get_by_role("row").nth(8)).to_contain_text(
"BTC:DAI_2023Futr10-10MarketFilled-IOC" "10-10MarketFilled-IOC"
) )
@pytest.mark.usefixtures("auth", "risk_accepted") @pytest.mark.usefixtures("auth", "risk_accepted")
@ -131,6 +131,6 @@ def test_market_buy_order(continuous_market, vega: VegaServiceNull, page: Page):
# 7002-SORD-010 # 7002-SORD-010
# 0003-WTXN-012 # 0003-WTXN-012
# 0003-WTXN-003 # 0003-WTXN-003
expect(page.get_by_role("row").nth(2)).to_contain_text( expect(page.get_by_role("row").nth(9)).to_contain_text(
"BTC:DAI_2023Futr10+10MarketFilled-FOK" "10+10MarketFilled-FOK"
) )

View File

@ -27,7 +27,7 @@ submit_stop_order = "place-order"
stop_orders_tab = "Stop orders" stop_orders_tab = "Stop orders"
row_table = "row" row_table = "row"
cancel = "cancel" cancel = "cancel"
market_name_col = '[col-id="market.tradableInstrument.instrument.code"]' market_name_col = '[data-testid="market-code"]'
trigger_col = '[col-id="trigger"]' trigger_col = '[col-id="trigger"]'
expiresAt_col = '[col-id="expiresAt"]' expiresAt_col = '[col-id="expiresAt"]'
size_col = '[col-id="submission.size"]' size_col = '[col-id="submission.size"]'

View File

@ -53,7 +53,7 @@ FEE_BREAKDOWN_TOOLTIP = "fee-breakdown-tooltip"
PINNED_ROW_LOCATOR = ".ag-pinned-left-cols-container .ag-row" PINNED_ROW_LOCATOR = ".ag-pinned-left-cols-container .ag-row"
ROW_LOCATOR = ".ag-center-cols-container .ag-row" ROW_LOCATOR = ".ag-center-cols-container .ag-row"
# Col-Ids: # Col-Ids:
COL_INSTRUMENT_CODE = '[col-id="market.tradableInstrument.instrument.code"]' COL_INSTRUMENT_CODE = '[data-testid="market-code"]'
COL_CODE = '[col-id="code"]' COL_CODE = '[col-id="code"]'
COL_SIZE = '[col-id="size"]' COL_SIZE = '[col-id="size"]'
COL_PRICE = '[col-id="price"]' COL_PRICE = '[col-id="price"]'
@ -563,7 +563,6 @@ def test_fills_taker_discount_program(
page.goto(f"/#/markets/{market_id}") page.goto(f"/#/markets/{market_id}")
page.get_by_test_id(FILLS).click() page.get_by_test_id(FILLS).click()
row = page.get_by_test_id(TAB_FILLS).locator(ROW_LOCATOR).first row = page.get_by_test_id(TAB_FILLS).locator(ROW_LOCATOR).first
expect(row.locator(COL_INSTRUMENT_CODE)).to_have_text("BTC:DAI_2023Futr")
expect(row.locator(COL_SIZE)).to_have_text(size) expect(row.locator(COL_SIZE)).to_have_text(size)
expect(row.locator(COL_PRICE)).to_have_text("103.50 tDAI") expect(row.locator(COL_PRICE)).to_have_text("103.50 tDAI")
expect(row.locator(COL_PRICE_1)).to_have_text(price_1) expect(row.locator(COL_PRICE_1)).to_have_text(price_1)
@ -605,7 +604,6 @@ def test_fills_maker_discount_program(
change_keys(page, vega_instance, MM_WALLET.name) change_keys(page, vega_instance, MM_WALLET.name)
page.get_by_test_id(FILLS).click() page.get_by_test_id(FILLS).click()
row = page.get_by_test_id(TAB_FILLS).locator(ROW_LOCATOR).first row = page.get_by_test_id(TAB_FILLS).locator(ROW_LOCATOR).first
expect(row.locator(COL_INSTRUMENT_CODE)).to_have_text("BTC:DAI_2023Futr")
expect(row.locator(COL_SIZE)).to_have_text(size) expect(row.locator(COL_SIZE)).to_have_text(size)
expect(row.locator(COL_PRICE)).to_have_text("103.50 tDAI") expect(row.locator(COL_PRICE)).to_have_text("103.50 tDAI")
expect(row.locator(COL_PRICE_1)).to_have_text(price_1) expect(row.locator(COL_PRICE_1)).to_have_text(price_1)

View File

@ -77,7 +77,7 @@ class TestGetStarted:
vega.mint( vega.mint(
MM_WALLET.name, MM_WALLET.name,
asset="VOTE", asset=vega.find_asset_id(symbol="VOTE", enabled=True),
amount=mint_amount, amount=mint_amount,
) )
@ -105,6 +105,8 @@ class TestGetStarted:
vega.wait_fn(1) vega.wait_fn(1)
vega.wait_for_total_catchup() vega.wait_for_total_catchup()
page.reload()
# Assert step 2 complete # Assert step 2 complete
expect(page.get_by_test_id("icon-tick")).to_have_count(2) expect(page.get_by_test_id("icon-tick")).to_have_count(2)

View File

@ -56,9 +56,6 @@ def test_renders_markets_correctly(proposed_market, page: Page):
page.goto(f"/#/markets/all") page.goto(f"/#/markets/all")
page.click('[data-testid="Proposed markets"]') page.click('[data-testid="Proposed markets"]')
row = page.locator(row_selector) row = page.locator(row_selector)
# 6001-MARK-049
expect(row.locator(col_market_id)).to_have_text("BTC:DAI_2023")
# 6001-MARK-051 # 6001-MARK-051
expect(row.locator('[col-id="asset"]')).to_have_text("tDAI") expect(row.locator('[col-id="asset"]')).to_have_text("tDAI")

View File

@ -68,11 +68,11 @@ def setup_market_monitoring_auction(vega: VegaServiceNull, simple_market):
vega.wait_for_total_catchup() vega.wait_for_total_catchup()
# add orders that change the price so that it goes beyond the limits of price monitoring # add orders that change the price so that it goes beyond the limits of price monitoring
submit_order(vega, MM_WALLET.name, simple_market, "SIDE_SELL", 100, 110) submit_order(vega, MM_WALLET.name, simple_market, "SIDE_SELL", 100, 300)
submit_order(vega, MM_WALLET2.name, simple_market, "SIDE_BUY", 100, 90) submit_order(vega, MM_WALLET2.name, simple_market, "SIDE_BUY", 100, 290)
submit_order(vega, MM_WALLET.name, simple_market, "SIDE_SELL", 100, 105) submit_order(vega, MM_WALLET.name, simple_market, "SIDE_SELL", 100, 305)
submit_order(vega, MM_WALLET2.name, simple_market, "SIDE_BUY", 100, 95) submit_order(vega, MM_WALLET2.name, simple_market, "SIDE_BUY", 100, 295)
submit_order(vega, MM_WALLET2.name, simple_market, "SIDE_BUY", 1, 105) submit_order(vega, MM_WALLET2.name, simple_market, "SIDE_BUY", 1, 305)
vega.wait_fn(1) vega.wait_fn(1)
vega.wait_for_total_catchup() vega.wait_for_total_catchup()
@ -89,7 +89,6 @@ def test_market_monitoring_auction_price_volatility_limit_order(
page.get_by_test_id("order-price").type("110") page.get_by_test_id("order-price").type("110")
page.get_by_test_id("order-tif").select_option("Fill or Kill (FOK)") page.get_by_test_id("order-tif").select_option("Fill or Kill (FOK)")
page.get_by_test_id("place-order").click() page.get_by_test_id("place-order").click()
expect(page.get_by_test_id("deal-ticket-error-message-tif")).to_have_text( expect(page.get_by_test_id("deal-ticket-error-message-tif")).to_have_text(
"This market is in auction due to high price volatility. Until the auction ends, you can only place GFA, GTT, or GTC limit orders." "This market is in auction due to high price volatility. Until the auction ends, you can only place GFA, GTT, or GTC limit orders."
) )
@ -110,8 +109,8 @@ def test_market_monitoring_auction_price_volatility_limit_order(
vega.wait_fn(1) vega.wait_fn(1)
vega.wait_for_total_catchup() vega.wait_for_total_catchup()
page.get_by_test_id("All").click() page.get_by_test_id("All").click()
expect(page.get_by_role("row").nth(2)).to_contain_text( expect(page.get_by_role("row").nth(4)).to_contain_text(
"BTC:DAI_2023Futr0+1LimitActive110.00GTC" "0+1LimitActive110.00GTC"
) )
@ -125,7 +124,6 @@ def test_market_monitoring_auction_price_volatility_market_order(
page.get_by_test_id("order-size").type("1") page.get_by_test_id("order-size").type("1")
# 7002-SORD-060 # 7002-SORD-060
page.get_by_test_id("place-order").click() page.get_by_test_id("place-order").click()
expect(page.get_by_test_id("deal-ticket-error-message-tif")).to_have_text( expect(page.get_by_test_id("deal-ticket-error-message-tif")).to_have_text(
"This market is in auction due to high price volatility. Until the auction ends, you can only place GFA, GTT, or GTC limit orders." "This market is in auction due to high price volatility. Until the auction ends, you can only place GFA, GTT, or GTC limit orders."
) )

View File

@ -65,7 +65,6 @@ def test_limit_order_trade_open_order(
expect(orderbook_trade).to_be_visible() expect(orderbook_trade).to_be_visible()
expected_open_order = [ expected_open_order = [
"BTC:DAI_2023",
"+1", "+1",
"Limit", "Limit",
"Active", "Active",
@ -87,9 +86,6 @@ def test_limit_order_trade_open_position(continuous_market, page: Page):
secondary_id = "stack-cell-secondary" secondary_id = "stack-cell-secondary"
position = { position = {
"market_code": "BTC:DAI_2023",
"settlement_asset": "tDAI",
"product_type": "Futr",
"size": "+1", "size": "+1",
"notional": "107.50", "notional": "107.50",
"average_entry_price": "107.50", "average_entry_price": "107.50",
@ -107,12 +103,6 @@ def test_limit_order_trade_open_position(continuous_market, page: Page):
# 7004-POSI-001 # 7004-POSI-001
# 7004-POSI-002 # 7004-POSI-002
market = table.locator("[col-id='marketCode']")
expect(market.get_by_test_id(primary_id)).to_have_text(position["market_code"])
expect(market.get_by_test_id(secondary_id)).to_have_text(
position["settlement_asset"] + position["product_type"]
)
size_and_notional = table.locator("[col-id='openVolume']") size_and_notional = table.locator("[col-id='openVolume']")
expect(size_and_notional.get_by_test_id(primary_id)).to_have_text(position["size"]) expect(size_and_notional.get_by_test_id(primary_id)).to_have_text(position["size"])
expect(size_and_notional.get_by_test_id(secondary_id)).to_have_text( expect(size_and_notional.get_by_test_id(secondary_id)).to_have_text(

View File

@ -257,46 +257,63 @@ def test_order_sorted(page: Page):
def test_order_status_active(page: Page): def test_order_status_active(page: Page):
# 7002-SORD-041 # 7002-SORD-041
expect(page.get_by_test_id(order_tab)).to_contain_text( expect(page.locator('[row-index="2"]').first).to_contain_text(
"market-2Futr" + "0" + "-10" + "Limit" + "Active" + "150.00" + "GTC" "market-2Futr"
)
expect(page.locator('[row-index="2"]').nth(1)).to_contain_text(
"0" + "-10" + "Limit" + "Active" + "150.00" + "GTC"
) )
def test_status_expired(page: Page): def test_status_expired(page: Page):
# 7002-SORD-042 # 7002-SORD-042
expect(page.get_by_test_id(order_tab)).to_contain_text( expect(page.locator('[row-index="7"]').first).to_contain_text(
"market-3Futr" + "0" + "-10" + "Limit" + "Expired" + "120.00" + "GTT:" "market-3Futr"
)
expect(page.locator('[row-index="7"]').nth(1)).to_contain_text(
"0" + "-10" + "Limit" + "Expired" + "120.00" + "GTT:"
) )
def test_order_status_Stopped(page: Page): def test_order_status_Stopped(page: Page):
# 7002-SORD-044 # 7002-SORD-044
expect(page.get_by_test_id(order_tab)).to_contain_text( expect(page.locator('[row-index="12"]').first).to_contain_text(
"market-1Futr" + "0" + "-100" + "Limit" + "Stopped" + "130.00" + "IOC" "market-1Futr"
)
expect(page.locator('[row-index="12"]').nth(1)).to_contain_text(
"0" + "-100" + "Limit" + "Stopped" + "130.00" + "IOC"
) )
def test_order_status_partially_filled(page: Page): def test_order_status_partially_filled(page: Page):
# 7002-SORD-045 # 7002-SORD-045
expect(page.get_by_test_id(order_tab)).to_contain_text( expect(page.locator('[row-index="8"]').first).to_contain_text(
"market-2Futr" + "99" + "+100" + "Limit" + "Partially Filled" + "104.00" + "IOC" "market-2Futr"
)
expect(page.locator('[row-index="8"]').nth(1)).to_contain_text(
"99" + "+100" + "Limit" + "Partially Filled" + "104.00" + "IOC"
) )
def test_order_status_filled(page: Page): def test_order_status_filled(page: Page):
# 7002-SORD-046 # 7002-SORD-046
# 7003-MORD-020 # 7003-MORD-020
expect(page.get_by_test_id(order_tab)).to_contain_text( expect(page.locator('[row-index="11"]').first).to_contain_text(
"market-1Futr" + "100" + "-100" + "Limit" + "Filled" + "88.00" + "GTC" "market-1Futr"
)
expect(page.locator('[row-index="11"]').nth(1)).to_contain_text(
"100" + "-100" + "Limit" + "Filled" + "88.00" + "GTC"
) )
def test_order_status_rejected(page: Page): def test_order_status_rejected(page: Page):
# 7002-SORD-047 # 7002-SORD-047
# 7003-MORD-018 # 7003-MORD-018
expect(page.get_by_test_id(order_tab)).to_contain_text( expect(page.locator('[row-index="9"]').first).to_contain_text(
"market-1Futr" "market-1Futr"
+ "0" )
expect(page.locator('[row-index="9"]').nth(1)).to_contain_text(
"0"
+ "-10,000,000,000" + "-10,000,000,000"
+ "Limit" + "Limit"
+ "Rejected: Margin check failed" + "Rejected: Margin check failed"
@ -308,9 +325,11 @@ def test_order_status_rejected(page: Page):
def test_order_status_parked(page: Page): def test_order_status_parked(page: Page):
# 7002-SORD-048 # 7002-SORD-048
# 7003-MORD-016 # 7003-MORD-016
expect(page.get_by_test_id(order_tab)).to_contain_text( expect(page.locator('[row-index="3"]').first).to_contain_text(
"market-5Futr" "market-5Futr"
+ "0" )
expect(page.locator('[row-index="3"]').nth(1)).to_contain_text(
"0"
+ "-60" + "-60"
+ "Ask + 15.00 Peg limit" + "Ask + 15.00 Peg limit"
+ "Parked" + "Parked"
@ -321,9 +340,11 @@ def test_order_status_parked(page: Page):
def test_order_status_pegged_ask(page: Page): def test_order_status_pegged_ask(page: Page):
# 7003-MORD-016 # 7003-MORD-016
expect(page.get_by_test_id(order_tab)).to_contain_text( expect(page.locator('[row-index="4"]').first).to_contain_text(
"market-4Futr" "market-4Futr"
+ "0" )
expect(page.locator('[row-index="4"]').nth(1)).to_contain_text(
"0"
+ "-60" + "-60"
+ "Ask + 15.00 Peg limit" + "Ask + 15.00 Peg limit"
+ "Active" + "Active"
@ -334,9 +355,11 @@ def test_order_status_pegged_ask(page: Page):
def test_order_status_pegged_bid(page: Page): def test_order_status_pegged_bid(page: Page):
# 7003-MORD-016 # 7003-MORD-016
expect(page.get_by_test_id(order_tab)).to_contain_text( expect(page.locator('[row-index="5"]').first).to_contain_text(
"market-4Futr" "market-4Futr"
+ "0" )
expect(page.locator('[row-index="5"]').nth(1)).to_contain_text(
"0"
+ "+40" + "+40"
+ "Bid - 10.00 Peg limit" + "Bid - 10.00 Peg limit"
+ "Active" + "Active"
@ -347,9 +370,11 @@ def test_order_status_pegged_bid(page: Page):
def test_order_status_pegged_mid(page: Page): def test_order_status_pegged_mid(page: Page):
# 7003-MORD-016 # 7003-MORD-016
expect(page.get_by_test_id(order_tab)).to_contain_text( expect(page.locator('[row-index="6"]').first).to_contain_text(
"market-4Futr" "market-4Futr"
+ "0" )
expect(page.locator('[row-index="6"]').nth(1)).to_contain_text(
"0"
+ "+20" + "+20"
+ "Mid - 5.00 Peg limit" + "Mid - 5.00 Peg limit"
+ "Active" + "Active"
@ -372,9 +397,11 @@ def test_order_amend_order(vega: VegaServiceNull, page: Page):
vega.forward("10s") vega.forward("10s")
vega.wait_fn(1) vega.wait_fn(1)
vega.wait_for_total_catchup() vega.wait_for_total_catchup()
expect(page.locator('[row-index="1"]').first).to_contain_text(
expect(page.get_by_test_id(order_tab)).to_contain_text( "market-2Futr"
"market-2Futr" + "0" + "-15" + "Limit" + "Active" + "170.00" + "GTC" )
expect(page.locator('[row-index="1"]').nth(1)).to_contain_text(
"0" + "-15" + "Limit" + "Active" + "170.00" + "GTC"
) )
@ -389,9 +416,11 @@ def test_order_cancel_single_order(vega: VegaServiceNull, page: Page):
vega.forward("10s") vega.forward("10s")
vega.wait_fn(1) vega.wait_fn(1)
vega.wait_for_total_catchup() vega.wait_for_total_catchup()
expect(page.locator('[row-index="0"]').first).to_contain_text(
expect(page.get_by_test_id(order_tab)).to_contain_text( "market-3Futr"
"market-3Futr" + "0" + "+10" + "Limit" + "Cancelled" + "60.00" + "GTC" )
expect(page.locator('[row-index="0"]').nth(1)).to_contain_text(
"0" + "+10" + "Limit" + "Cancelled" + "60.00" + "GTC"
) )

View File

@ -22,7 +22,7 @@ def test_closed_market_position(vega: VegaServiceNull, page: Page):
expect(page.locator(".ag-overlay-panel")).to_have_text("No positions") expect(page.locator(".ag-overlay-panel")).to_have_text("No positions")
page.get_by_test_id("open-transfer").click() page.get_by_test_id("open-transfer").click()
tab = page.get_by_test_id("tab-positions") tab = page.get_by_test_id("tab-positions")
table = tab.locator(".ag-center-cols-container") table = tab.locator('[class="ag-body ag-layout-normal"]')
market = table.locator("[col-id='marketCode']") market = table.locator("[col-id='marketCode']")
expect(market.get_by_test_id("stack-cell-primary")).to_have_text("BTC:DAI_2023") expect(market.get_by_test_id("stack-cell-primary")).to_have_text("BTC:DAI_2023")
page.get_by_test_id("open-transfer").click() page.get_by_test_id("open-transfer").click()

View File

@ -75,4 +75,5 @@ def test_price_copied_to_deal_ticket(continuous_market, page: Page):
page.get_by_test_id("Trades").click() page.get_by_test_id("Trades").click()
page.locator("[col-id=price]").last.click() page.locator("[col-id=price]").last.click()
# 6005-THIS-007 # 6005-THIS-007
page.reload()
expect(page.get_by_test_id("order-price")).to_have_value("107.50000") expect(page.get_by_test_id("order-price")).to_have_value("107.50000")