Skip to content

Commit 5871372

Browse files
refactor: extract spec constants for container (#62)
1 parent a085923 commit 5871372

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

e2e/captcha.spec.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import {testWithII} from '../src';
2+
import {DOCKER_CONTAINER} from './spec.constants';
23

34
testWithII.beforeEach(async ({iiPage, browser}) => {
4-
const DOCKER_CONTAINER_URL = 'http://127.0.0.1:5987';
5-
const DOCKER_INTERNET_IDENTITY_ID = 'rdmx6-jaaaa-aaaaa-aaadq-cai';
6-
7-
await iiPage.waitReady({url: DOCKER_CONTAINER_URL, canisterId: DOCKER_INTERNET_IDENTITY_ID});
5+
await iiPage.waitReady(DOCKER_CONTAINER);
86
});
97

108
testWithII('should sign-in with a new user when II requires a captcha', async ({page, iiPage}) => {

e2e/login.spec.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
import {testWithII} from '../src';
2+
import {DOCKER_CONTAINER} from './spec.constants';
23

34
const loginSelector = '#login';
45
const logoutSelector = '#logout';
56

67
testWithII.beforeEach(async ({iiPage, browser}) => {
7-
const DOCKER_CONTAINER_URL = 'http://127.0.0.1:5987';
8-
const DOCKER_INTERNET_IDENTITY_ID = 'rdmx6-jaaaa-aaaaa-aaadq-cai';
9-
10-
await iiPage.waitReady({url: DOCKER_CONTAINER_URL, canisterId: DOCKER_INTERNET_IDENTITY_ID});
8+
await iiPage.waitReady(DOCKER_CONTAINER);
119
});
1210

1311
testWithII.describe('without selector', () => {

e2e/spec.constants.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const DOCKER_CONTAINER_URL = 'http://127.0.0.1:5987';
2+
const DOCKER_INTERNET_IDENTITY_ID = 'rdmx6-jaaaa-aaaaa-aaadq-cai';
3+
4+
export const DOCKER_CONTAINER = {
5+
url: DOCKER_CONTAINER_URL,
6+
canisterId: DOCKER_INTERNET_IDENTITY_ID
7+
};

0 commit comments

Comments
 (0)