Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.2.0
current_version = 0.3.0
commit = False
tag = False
allow_dirty = True
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/build-rln-node/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ runs:

- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.81.0
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
source "$HOME/.cargo/env"
shell: bash
Expand Down
15 changes: 10 additions & 5 deletions .github/actions/publish-test-reports/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,16 @@ runs:
shell: bash

- name: Generate reports
run: ./.github/scripts/generate-reports.sh
shell: bash
env:
RUN_ID: ${{ github.run_id }}
COMMIT_SHA: ${{ github.sha }}
run: ./.github/scripts/generate-reports.sh

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
github_token: ${{ github.token }}
publish_dir: gh-pages
path: site

- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4
22 changes: 11 additions & 11 deletions .github/scripts/generate-reports.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,33 @@

set -euo pipefail

mkdir -p gh-pages
mkdir -p site

# Generate embedded report
if [ -d "allure-results-embedded" ] && [ "$(ls -A allure-results-embedded 2>/dev/null)" ]; then
allure generate allure-results-embedded --clean -o gh-pages/embedded
allure generate allure-results-embedded --clean -o site/embedded
else
mkdir -p gh-pages/embedded
echo "<h1>No embedded test results available</h1>" > gh-pages/embedded/index.html
mkdir -p site/embedded
echo "<h1>No embedded test results available</h1>" > site/embedded/index.html
fi

# Generate remote report
if [ -d "allure-results-remote" ] && [ "$(ls -A allure-results-remote 2>/dev/null)" ]; then
allure generate allure-results-remote --clean -o gh-pages/remote
allure generate allure-results-remote --clean -o site/remote
else
mkdir -p gh-pages/remote
echo "<h1>No remote test results available</h1>" > gh-pages/remote/index.html
mkdir -p site/remote
echo "<h1>No remote test results available</h1>" > site/remote/index.html
fi

# Copy coverage report
if [ -d "coverage-report" ] && [ "$(ls -A coverage-report 2>/dev/null)" ]; then
cp -r coverage-report gh-pages/coverage
cp -r coverage-report site/coverage
else
mkdir -p gh-pages/coverage
echo "<h1>No coverage report available</h1>" > gh-pages/coverage/index.html
mkdir -p site/coverage
echo "<h1>No coverage report available</h1>" > site/coverage/index.html
fi

# Create index page with links to all reports
cp .github/pages/allure-index.html gh-pages/index.html
cp .github/pages/allure-index.html site/index.html

echo "✅ Reports generated successfully"
18 changes: 11 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,16 +146,16 @@ jobs:
- test_ask_auth_for_imp_operations
- test_settings
- test_btc_channel_tx
- test_rgb20_channel_tx
- test_nia_channel_tx
- test_help
- test_about
- test_backup_and_restore
- test_send_and_receive_rgb20_asset
- test_send_and_receive_rgb25_asset
- test_send_and_receive_nia_asset
- test_send_and_receive_cfa_asset
- test_hide_exhausted_asset
- test_fail_transfer
- test_issue_rgb20_asset
- test_issue_rgb25_asset
- test_issue_nia_asset
- test_issue_cfa_asset
- test_view_unspent
- test_refresh_transfer
env:
Expand Down Expand Up @@ -270,8 +270,12 @@ jobs:
runs-on: ubuntu-latest
if: always()
permissions:
contents: write
actions: write
contents: read
pages: write
id-token: write

environment:
name: github-pages

steps:
- name: Checkout repository
Expand Down
30 changes: 15 additions & 15 deletions accessible_constant.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@
SEND_ASSET_BUTTON = 'send_asset_button'
ASSET_ADDRESS_VALIDATION_LABEL = 'asset_address_validation_label'

# Issue RGB20 asset page
ISSUE_RGB20_ASSET = 'issue_rgb20_asset'
ISSUE_RGB20_ASSET_CLOSE_BUTTON = 'issue_rgb20_asset_close_button'
RGB20_ASSET_TICKER = 'rgb20_asset_ticker'
RGB20_ASSET_NAME = 'rgb20_asset_name'
RGB20_ASSET_AMOUNT = 'rgb20_asset_amount'
ISSUE_RGB20_BUTTON = 'issue_rgb20_button'
# Issue NIA asset page
ISSUE_NIA_ASSET = 'issue_nia_asset'
ISSUE_NIA_ASSET_CLOSE_BUTTON = 'issue_nia_asset_close_button'
NIA_ASSET_TICKER = 'nia_asset_ticker'
NIA_ASSET_NAME = 'nia_asset_name'
NIA_ASSET_AMOUNT = 'nia_asset_amount'
ISSUE_NIA_BUTTON = 'issue_nia_button'

# Success page
SUCCESS_PAGE_CLOSE_BUTTON = 'success_page_close_button'
Expand All @@ -95,14 +95,14 @@
VIEW_UNSPENT_LIST_BUTTON = 'view_unspent_list_button'
SETTINGS_BUTTON = 'settings_button'

# Issue RGB25 asset page
ISSUE_RGB25_ASSET = 'issue_rgb25_asset'
ISSUE_RGB25_BUTTON = 'issue_rgb25_button'
RGB25_ASSET_DESCRIPTION = 'rgb25_asset_description'
RGB25_ASSET_NAME = 'rgb25_asset_name'
RGB25_ASSET_AMOUNT = 'rgb25_asset_amount'
RGB25_UPLOAD_FILE_BUTTON = 'rgb25_upload_file_button'
ISSUE_RGB25_ASSET_CLOSE_BUTTON = 'issue_rgb25_asset_close_button'
# Issue CFA asset page
ISSUE_CFA_ASSET = 'issue_cfa_asset'
ISSUE_CFA_BUTTON = 'issue_cfa_button'
CFA_ASSET_DESCRIPTION = 'cfa_asset_description'
CFA_ASSET_NAME = 'cfa_asset_name'
CFA_ASSET_AMOUNT = 'cfa_asset_amount'
CFA_UPLOAD_FILE_BUTTON = 'cfa_upload_file_button'
ISSUE_CFA_ASSET_CLOSE_BUTTON = 'issue_cfa_asset_close_button'

# File chooser
FILE_CHOOSER = 'file chooser'
Expand Down
4 changes: 2 additions & 2 deletions e2e_tests/compose.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
bitcoind:
image: registry.gitlab.com/hashbeam/docker/bitcoind:28.1
image: registry.gitlab.com/hashbeam/docker/bitcoind:30.0
command: "-fallbackfee=0.0002"
environment:
MYUID: 1000
Expand All @@ -11,7 +11,7 @@ services:
volumes:
- ./datacore:/srv/app/.bitcoin
electrs:
image: registry.gitlab.com/hashbeam/docker/electrs:0.10.9
image: registry.gitlab.com/hashbeam/docker/electrs:0.10.10
environment:
MYUID: 1000
MYGID: 1000
Expand Down
81 changes: 81 additions & 0 deletions e2e_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@
"""
from __future__ import annotations

import io
import os
import subprocess
import time

import allure
import pytest
from dogtail.tree import root
from PIL import Image
from Xlib import display
from Xlib import X

from accessible_constant import DEFAULT_WALLET_MODES
from src.model.enums.enums_model import WalletType
Expand Down Expand Up @@ -132,6 +137,82 @@ def pytest_runtest_logreport(report):
_print_test_result('⏭️', 'SKIPPED', test_name)


def _capture_screenshot():
"""
Capture a screenshot of the entire screen using Xlib.

Returns:
bytes: PNG image data, or None if capture fails
"""
try:
# Get the display and screen
dpy = display.Display()
screen = dpy.screen()
root_window = screen.root

# Get screen dimensions
width = screen.width_in_pixels
height = screen.height_in_pixels

# Capture the screen
raw_image = root_window.get_image(
0, 0, width, height, X.ZPixmap, 0xffffffff,
)

# Convert to PIL Image
image = Image.frombytes(
'RGB',
(width, height),
raw_image.data,
'raw',
'BGRX',
)

# Save to bytes buffer
buffer = io.BytesIO()
image.save(buffer, format='PNG')
buffer.seek(0)

return buffer.getvalue()
except Exception as e:
print(f"[SCREENSHOT] Failed to capture screenshot: {e}")
return None


@pytest.hookimpl(tryfirst=True, hookwrapper=True)
def pytest_runtest_makereport(item):
"""
Pytest hook to capture screenshots on test failure and attach to Allure report.

This hook runs after each test phase (setup, call, teardown) and captures
a screenshot if the test failed during the 'call' phase.
"""
# Execute all other hooks to obtain the report object
outcome = yield
report = outcome.get_result()

# Only capture screenshot on test failure during the 'call' phase
if report.when == 'call' and report.failed:
try:
screenshot_bytes = _capture_screenshot()

if screenshot_bytes:
# Attach screenshot to Allure report
allure.attach(
screenshot_bytes,
name='failure_screenshot',
attachment_type=allure.attachment_type.PNG,
)
print(f"""[SCREENSHOT] ✅ Screenshot captured and attached for failed test:
{item.nodeid}""")
else:
print(f"""[SCREENSHOT] ⚠️ Failed to capture screenshot for:
{item.nodeid}""")
except Exception as e:
print(f"""[SCREENSHOT] ❌ Error capturing screenshot for
{item.nodeid}: {e}""")


def _is_ci_environment():
"""Check if running in CI environment."""
return os.getenv('CI', '').lower() in ('true', '1', 'yes')
Expand Down
6 changes: 3 additions & 3 deletions e2e_tests/test/features/channel.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# pylint:disable=too-many-branches
"""
This module contains the IssueRgb20 class, which provides methods for issuing RGB20 assets.
This module contains the Channel class, which provides methods for channel operations.
"""
from __future__ import annotations

Expand Down Expand Up @@ -144,7 +144,7 @@ def get_node_uri_for_embedded(self, application, ip_address):
if self.do_is_displayed(self.sidebar_page_objects.fungibles_button()):
self.sidebar_page_objects.click_fungibles_button()

embedded_node_uri = f"{node_pubkey}@{ip_address}:{ln_port}"
embedded_node_uri = f'{node_pubkey}@{ip_address}:{ln_port}'

return embedded_node_uri

Expand All @@ -163,6 +163,6 @@ def get_node_uri_for_remote(self, application, ip_address, ln_port):
if self.do_is_displayed(self.sidebar_page_objects.fungibles_button()):
self.sidebar_page_objects.click_fungibles_button()

remote_node_uri = f"{node_pubkey}@{ip_address}:{ln_port}"
remote_node_uri = f'{node_pubkey}@{ip_address}:{ln_port}'

return remote_node_uri
Loading
Loading