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 .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:
run: make webe2etest

- name: Upload Playwright artifacts
if: failure()
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-artifacts
Expand Down
1 change: 1 addition & 0 deletions frontends/web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions frontends/web/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ export default defineConfig({
use: {
baseURL: `http://${HOST}:${FRONTEND_PORT}`,
headless: true,
video: 'retain-on-failure',
video: 'on',
screenshot: 'only-on-failure',
trace: 'retain-on-failure',
trace: 'on',
launchOptions: {
// By default, tests are not run in slow motion.
// Can be enabled by setting the PLAYWRIGHT_SLOW_MO environment variable to a value > 0.
Expand Down
79 changes: 79 additions & 0 deletions frontends/web/tests/gapSettings.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/**
* Copyright 2025 Shift Crypto AG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/



import { test } from './helpers/fixtures';
import { ServeWallet } from './helpers/servewallet';
import { expect } from '@playwright/test';
import { clickButtonWithText } from './helpers/dom';
import { deleteAccountsFile } from './helpers/fs';

let servewallet: ServeWallet;

test('Gap limits are correctly saved', async ({ page, host, frontendPort, servewalletPort }) => {

await test.step('Start servewallet', async () => {
servewallet = new ServeWallet(page, servewalletPort, frontendPort, host);
await servewallet.start();
});


await test.step('Navigate to the app', async () => {
await page.goto(`http://${host}:${frontendPort}`);
const body = page.locator('body');
await expect(body).toContainText('Please connect your BitBox and tap the side to continue.');
});

await test.step('Type into gap limit inputs', async () => {
await page.getByRole('link', { name: 'Settings' }).click();
await page.getByRole('link', { name: 'Advanced settings' }).click();
await page.getByRole('button', { name: 'Custom gap limit settings' }).click();

const recvInput = page.locator('#gapLimitReceive');
await recvInput.clear();
await recvInput.click();
await page.keyboard.press('5');
await page.waitForTimeout(1000);
await page.keyboard.press('0');


const changeInput = page.locator('#gapLimitChange');
await changeInput.clear();
await changeInput.click();
await page.keyboard.press('6');
await page.waitForTimeout(1000);
await page.keyboard.press('0');

await clickButtonWithText(page, 'Confirm');
});

await test.step('Verify gap limit inputs are correctly saved', async () => {
await page.getByRole('button', { name: 'Custom gap limit settings' }).click();
const recvInput = page.locator('#gapLimitReceive');
await expect(recvInput).toHaveValue('50');
const changeInput = page.locator('#gapLimitChange');
await expect(changeInput).toHaveValue('60');
});
});

test.beforeEach(() => {
deleteAccountsFile();
});

test.afterAll(() => {
servewallet.stop();
});
Loading