diff --git a/e2e/captcha.spec.ts b/e2e/captcha.spec.ts index 7f8d74f..60fc019 100644 --- a/e2e/captcha.spec.ts +++ b/e2e/captcha.spec.ts @@ -1,10 +1,8 @@ import {testWithII} from '../src'; +import {DOCKER_CONTAINER} from './spec.constants'; testWithII.beforeEach(async ({iiPage, browser}) => { - const DOCKER_CONTAINER_URL = 'http://127.0.0.1:5987'; - const DOCKER_INTERNET_IDENTITY_ID = 'rdmx6-jaaaa-aaaaa-aaadq-cai'; - - await iiPage.waitReady({url: DOCKER_CONTAINER_URL, canisterId: DOCKER_INTERNET_IDENTITY_ID}); + await iiPage.waitReady(DOCKER_CONTAINER); }); testWithII('should sign-in with a new user when II requires a captcha', async ({page, iiPage}) => { diff --git a/e2e/login.spec.ts b/e2e/login.spec.ts index 0daa4e2..875b557 100644 --- a/e2e/login.spec.ts +++ b/e2e/login.spec.ts @@ -1,13 +1,11 @@ import {testWithII} from '../src'; +import {DOCKER_CONTAINER} from './spec.constants'; const loginSelector = '#login'; const logoutSelector = '#logout'; testWithII.beforeEach(async ({iiPage, browser}) => { - const DOCKER_CONTAINER_URL = 'http://127.0.0.1:5987'; - const DOCKER_INTERNET_IDENTITY_ID = 'rdmx6-jaaaa-aaaaa-aaadq-cai'; - - await iiPage.waitReady({url: DOCKER_CONTAINER_URL, canisterId: DOCKER_INTERNET_IDENTITY_ID}); + await iiPage.waitReady(DOCKER_CONTAINER); }); testWithII.describe('without selector', () => { diff --git a/e2e/spec.constants.ts b/e2e/spec.constants.ts new file mode 100644 index 0000000..c15ae7f --- /dev/null +++ b/e2e/spec.constants.ts @@ -0,0 +1,7 @@ +const DOCKER_CONTAINER_URL = 'http://127.0.0.1:5987'; +const DOCKER_INTERNET_IDENTITY_ID = 'rdmx6-jaaaa-aaaaa-aaadq-cai'; + +export const DOCKER_CONTAINER = { + url: DOCKER_CONTAINER_URL, + canisterId: DOCKER_INTERNET_IDENTITY_ID +};