Dusana/eng 5909 fix for workflow upload playwright report to develop (#811)

* release: v0.46.0

* Fix: Duplicate artifact name causing 409 Conflict in GH Actions and fix failing e2e tests (#808)

* Fix: Duplicate artifact name causing 409 Conflict in GitHub Actions

* fix for unstable locators

* removed a commented line in swapSip10Velar.spec.ts

* Fix for workflow Upload Playwright report in ci/cd

* Terence/add min balance decimals (#810)

* add formatBalance to final quote display

* add formatBalance to quoteSummaryTile.tsx

* remove invalid code (its comparing the rate to the minimum received)

* fix remove wrapping

* Fix for failing test

* Fix for failing tests

---------

Co-authored-by: DuskaT021 <aleksa2601@gmail.com>

* updated the build-rc.yml post-comment

---------

Co-authored-by: GitHub Actions Bot <>
Co-authored-by: Terence Ng <ngtere@live.com.sg>
This commit is contained in:
Duska.T
2024-12-05 16:36:59 +01:00
committed by GitHub
parent 442a84de2c
commit 8821afd607
9 changed files with 33 additions and 35 deletions

View File

@@ -50,6 +50,7 @@ jobs:
path: ./build
retention-days: 5
if-no-files-found: error
overwrite: true
UItest:
needs: [build]
name: E2E Test ${{ matrix.shardIndex }} of ${{ matrix.shardTotal }}
@@ -90,9 +91,13 @@ jobs:
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: all-blob-reports
name: blob-report-${{ matrix.shardIndex }}-of-${{ matrix.shardTotal }}
path: blob-report
retention-days: 1
if-no-files-found: warn
compression-level: 6
overwrite: true
include-hidden-files: false
merge-reports:
# Merge reports after playwright-tests, even if some shards have failed but not if the job was skipped
@@ -116,8 +121,9 @@ jobs:
- name: Download blob reports from GitHub Actions Artifacts
uses: actions/download-artifact@v4
with:
name: all-blob-reports
pattern: blob-report-*
path: all-blob-reports
merge-multiple: true
- name: Merge into HTML Report
run: npx playwright merge-reports --reporter html ./all-blob-reports
@@ -128,6 +134,7 @@ jobs:
name: html-report--attempt-${{ github.run_attempt }}
path: playwright-report
retention-days: 4
overwrite: true
publish-rc:
# TODO also keep the develop PR description up to date
@@ -206,7 +213,7 @@ jobs:
- name: zip
run: zip -rj build.zip ./build
- name: Upload release asset
uses: actions/upload-release-asset@v1
uses: actions/upload-release-asset@v1 # TODO: use softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
UPLOAD_URL: ${{needs.publish-rc.outputs.upload_url}}

View File

@@ -43,6 +43,7 @@ jobs:
path: ./build
retention-days: 4
if-no-files-found: error
overwrite: true
UItest:
needs: [build]
name: E2E Test ${{ matrix.shardIndex }} of ${{ matrix.shardTotal }}
@@ -83,7 +84,7 @@ jobs:
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: all-blob-reports
name: blob-report-${{ matrix.shardIndex }}-of-${{ matrix.shardTotal }}
path: blob-report
retention-days: 1
overwrite: true
@@ -110,8 +111,9 @@ jobs:
- name: Download blob reports from GitHub Actions Artifacts
uses: actions/download-artifact@v4
with:
name: all-blob-reports
pattern: blob-report-*
path: all-blob-reports
merge-multiple: true
- name: Merge into HTML Report
run: npx playwright merge-reports --reporter html ./all-blob-reports
@@ -122,3 +124,4 @@ jobs:
name: html-report--attempt-${{ github.run_attempt }}
path: playwright-report
retention-days: 4
overwrite: true

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "xverse-web-extension",
"version": "0.45.2",
"version": "0.46.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "xverse-web-extension",
"version": "0.45.2",
"version": "0.46.0",
"dependencies": {
"@aryzing/superqs": "0.0.6",
"@ledgerhq/hw-transport-webusb": "^6.27.13",

View File

@@ -1,7 +1,7 @@
{
"name": "xverse-web-extension",
"description": "A Bitcoin wallet for Web3",
"version": "0.45.2",
"version": "0.46.0",
"private": true,
"engines": {
"node": "^18.18.2"

View File

@@ -13,6 +13,7 @@ import {
AnalyticsEvents,
RUNE_DISPLAY_DEFAULTS,
capStxFeeAtThreshold,
formatBalance,
getBtcFiatEquivalent,
getStxFiatEquivalent,
stxToMicrostacks,
@@ -477,7 +478,7 @@ export default function QuoteSummary({
{t('SWAP_SCREEN.MIN_RECEIVE')}
</StyledP>
<StyledP data-testid="min-received-amount" typography="body_medium_m" color="white_0">
{formatNumber(quote.receiveAmount)} {toUnit}
{formatBalance(quote.receiveAmount)} {toUnit}
</StyledP>
</ListingDescriptionRow>
{Boolean(quote.feePercentage) && (

View File

@@ -1,5 +1,5 @@
import { formatBalance } from '@secretkeylabs/xverse-core';
import { StyledP } from '@ui-library/common.styled';
import { formatNumber } from '@utils/helper';
import { useTranslation } from 'react-i18next';
import styled from 'styled-components';
@@ -64,7 +64,7 @@ function QuoteSummaryTile({ fromUnit, toUnit, rate, provider, image, onClick }:
{t('SWAP_SCREEN.RATE')}
</StyledP>
<StyledP typography="body_medium_m" color="white_0">
1 {fromUnit} {formatNumber(rate)} {toUnit}
1 {fromUnit} {formatBalance(rate)} {toUnit}
</StyledP>
</RowCenter>
</InfoContainer>

View File

@@ -4,7 +4,6 @@ import { CaretRight } from '@phosphor-icons/react';
import type { FungibleToken } from '@secretkeylabs/xverse-core';
import { formatBalance } from '@secretkeylabs/xverse-core';
import { StyledP } from '@ui-library/common.styled';
import type { CurrencyTypes } from '@utils/constants';
import { NumericFormat } from 'react-number-format';
import styled, { useTheme } from 'styled-components';
import type { Color } from 'theme';
@@ -38,6 +37,7 @@ const RowContainer = styled.div`
flex-direction: row;
justify-content: space-between;
gap: ${({ theme }) => theme.space.m};
white-space: nowrap;
`;
const TruncatedP = styled(StyledP)`
@@ -123,12 +123,12 @@ function QuoteTile({
</RowContainer>
<RowContainer>
{subtitle && subtitleColor && (
<StyledP data-testid="info-message" typography="body_medium_s" color={subtitleColor}>
<TruncatedP data-testid="info-message" typography="body_medium_s" color={subtitleColor}>
<SubtitleContainer>
{subtitleColor === 'success_light' && <GreenEllipse />}
{subtitle}
</SubtitleContainer>
</StyledP>
</TruncatedP>
)}
{fiatValue && (
<NumericFormat

View File

@@ -621,13 +621,9 @@ export default class Wallet {
}
async checkVisualsStartpage() {
// Wait for the balance element to be present in the DOM
await this.page.waitForSelector('[data-testid="total-balance-value"]', { state: 'attached' });
// Wait for a short duration to allow the animation to complete
await this.page.waitForTimeout(400);
await expect(this.balance).toBeVisible();
// to-do fix the element itself, after the native-segwit update it resolves to 2 elements
// data-testid="total-balance-value"
await expect(this.balance.first()).toBeVisible();
await expect(this.manageTokenButton).toBeVisible();
// Deny data collection --> modal window is not always appearing so when it does we deny the data collection
@@ -737,8 +733,8 @@ export default class Wallet {
// Not all TX Screens show a total amount
if (totalAmountShown) {
await expect(this.confirmTotalAmount).toBeVisible();
await expect(this.confirmCurrencyAmount).toBeVisible();
await expect(this.confirmTotalAmount.first()).toBeVisible();
await expect(this.confirmCurrencyAmount.first()).toBeVisible();
}
if (tokenImageShown) {
@@ -845,18 +841,8 @@ export default class Wallet {
const usdAmountQuote = await this.textUSD.first().innerText();
const numericUSDQuote = parseFloat(usdAmountQuote.replace(/[^0-9.]/g, ''));
expect(numericUSDQuote).toEqual(numericUSDValue);
// min-received-amount value should be the same as quoteAmount
const minReceivedAmount = await this.minReceivedAmount.innerText();
const numericMinReceivedAmount = parseFloat(minReceivedAmount.replace(/[^0-9.]/g, ''));
const formattedNumericMinReceivedAmount = parseFloat(numericMinReceivedAmount.toFixed(3));
expect(formattedNumericMinReceivedAmount).toEqual(numericQuoteValue);
// check if quoteAmount is the same from the page before
const quoteAmount2Page = await this.quoteAmount.last().innerText();
const numericQuote2Page = parseFloat(quoteAmount2Page.replace(/[^0-9.]/g, ''));
expect(numericQuote2Page).toEqual(numericQuoteValue);
}
// check visuals of List on ME page
async checkVisualsListOnMEPage() {
await expect(this.buttonFloorPrice).toBeVisible();

View File

@@ -48,7 +48,8 @@ test.describe('Swap sip-10 token to STX', () => {
page.getByRole('button', { name: /get quotes/i }).click();
await expect(page.getByText('Rates', { exact: true })).toBeVisible();
await page.getByText(/^\d+\.\d+\s+STX$/i).click();
await page.getByText('Velar', { exact: true }).click();
// Quotes page velar -> stacks
await expect(page.getByText(/quote/i)).toBeVisible();