Skip to content

Commit ab92e2c

Browse files
authored
Merge branch 'develop' into tooling-dapp/test-purchase-a-name
2 parents 31fb0f6 + ac10bf8 commit ab92e2c

File tree

3 files changed

+51
-19
lines changed

3 files changed

+51
-19
lines changed

.github/workflows/typescript.yaml

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ jobs:
4848
"devnet":{
4949
"network": "devnet",
5050
"namesDisplayUrl": "http://localhost",
51-
"indexerUrl": "http://localhost",
52-
"baseUrl": "http://localhost:3000"
51+
"indexerUrl": "http://localhost:3030",
52+
"baseUrl": "http://localhost:3005"
5353
}
5454
}
5555
run: |
@@ -144,8 +144,8 @@ jobs:
144144
"localnet": {
145145
"network": "localnet",
146146
"namesDisplayUrl": "http://localhost",
147-
"indexerUrl": "http://localhost",
148-
"baseUrl": "http://localhost:3000"
147+
"indexerUrl": "http://localhost:3030",
148+
"baseUrl": "http://localhost:3005"
149149
}
150150
}
151151
services:
@@ -192,10 +192,6 @@ jobs:
192192
pnpm install
193193
working-directory: ./
194194

195-
- name: Build Dapp
196-
run: pnpm dapp build
197-
working-directory: ./
198-
199195
- name: Download IOTA Wallet Extension
200196
env:
201197
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -230,6 +226,22 @@ jobs:
230226
pnpm inject-localnet
231227
232228
cd ..
229+
INDEXER_ENV_FILE="$(mktemp)"
230+
pnpm --dir=scripts ts-node utils/envs.ts localnet bash | sed 's/^export //' > "$INDEXER_ENV_FILE"
231+
232+
docker pull ghcr.io/iotaledger/iota-names/iota-names-indexer:latest
233+
docker rm -f localnet-iota-names-indexer || true
234+
docker run -d \
235+
--name localnet-iota-names-indexer \
236+
--env-file "$INDEXER_ENV_FILE" \
237+
--add-host host.docker.internal:host-gateway \
238+
-p 3030:3030 \
239+
-p 9189:9189 \
240+
ghcr.io/iotaledger/iota-names/iota-names-indexer:latest \
241+
start \
242+
--node-url=http://host.docker.internal:9000 \
243+
--checkpoint-url=http://host.docker.internal:9000
244+
233245
pnpm dapp build
234246
cd dapp
235247
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- pnpm run test:e2e

dapp/tests/common/basic.spec.ts

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,30 @@
11
// Copyright (c) 2025 IOTA Stiftung
22
// SPDX-License-Identifier: Apache-2.0
3+
import 'dotenv/config';
4+
5+
import { CONFIG } from '@/config';
36

47
import { expect, test } from '../helpers/fixtures';
58

6-
test('should load the application', async ({ appPage, sharedState }) => {
7-
await appPage.waitForLoadState('domcontentloaded');
8-
await expect(appPage).toHaveTitle(/IOTA Names/i);
9-
});
9+
test.describe('Basic e2e tests', () => {
10+
test('should load the application', async ({ appPage, sharedState }) => {
11+
await appPage.waitForLoadState('domcontentloaded');
12+
await expect(appPage).toHaveTitle(/IOTA Names/i);
13+
});
14+
15+
test('should have IOTA Wallet extension loaded', async ({ extensionId, context }) => {
16+
expect(extensionId).toBeTruthy();
17+
expect(extensionId).toMatch(/^[a-z]{32}$/);
1018

11-
test('should have IOTA Wallet extension loaded', async ({ extensionId, context }) => {
12-
expect(extensionId).toBeTruthy();
13-
expect(extensionId).toMatch(/^[a-z]{32}$/);
19+
const extensionUrl = `chrome-extension://${extensionId}/ui.html`;
20+
const extensionPage = await context.newPage();
21+
await extensionPage.goto(extensionUrl, { waitUntil: 'commit' });
1422

15-
const extensionUrl = `chrome-extension://${extensionId}/ui.html`;
16-
const extensionPage = await context.newPage();
17-
await extensionPage.goto(extensionUrl);
23+
await expect(extensionPage).toHaveURL((url) => url.toString().startsWith(extensionUrl));
24+
});
1825

19-
await expect(extensionPage).toHaveURL((url) => url.toString().startsWith(extensionUrl));
26+
test('indexer is up and running', async () => {
27+
const res = await fetch(`${CONFIG.indexerUrl}/health`);
28+
expect(res.ok).toBe(true);
29+
});
2030
});

dapp/tests/utils.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,16 @@ export async function createWallet(page: Page) {
6464
await page.getByText('I saved my mnemonic').click();
6565
await page.getByRole('button', { name: 'Open Wallet' }).click();
6666

67+
await page.getByLabel('Open settings menu').click();
68+
await page.getByText('Network').click();
69+
await page.getByText('Custom RPC').click();
70+
const networkId = CONFIG.network;
71+
const networkConfig = getNetwork(networkId);
72+
await page.getByPlaceholder('http://localhost:3000/').fill(networkConfig.url);
73+
await page.getByRole('button', { name: 'Save' }).click();
74+
75+
await page.getByTestId('close-icon').click();
76+
6777
return {
6878
mnemonic,
6979
address,

0 commit comments

Comments
 (0)