diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 6ade71d344..0b055bd65c 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -11,6 +11,9 @@ jobs: docker-build-e2e: runs-on: ubuntu-20.04 steps: + - name: Delete unnecessary tools folder to free space + run: rm -rf /opt/hostedtoolcache + - name: Checkout uses: actions/checkout@v4 diff --git a/Dockerfile.e2e b/Dockerfile.e2e index 3ebfdd9dae..032e3df93c 100644 --- a/Dockerfile.e2e +++ b/Dockerfile.e2e @@ -9,6 +9,9 @@ RUN DEBIAN_FRONTEND=noninteractive apt update && apt install -y \ netcat \ ca-certificates \ build-essential \ + llvm-dev \ + clang \ + jq \ && rm -rf /var/lib/apt/lists/* # Install NodeJS @@ -29,12 +32,8 @@ ENV RUSTUP_HOME=/home/apprunner/.rustup \ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y RUN /bin/bash -c "source /home/apprunner/.cargo/env && rustc --version && cargo --version" -# Install jq -RUN apt-get install jq - # Add wasm32-unknown-unknown target RUN /bin/bash -c "source /home/apprunner/.cargo/env && rustup target add wasm32-unknown-unknown" - # Install dfx ENV DFX_PORT=4943 ENV DFX_VERSION=0.20.0 diff --git a/docker/deploy b/docker/deploy index 724cbc6f15..013ac1de48 100755 --- a/docker/deploy +++ b/docker/deploy @@ -6,6 +6,9 @@ dfx start --background --quiet ./docker/wait-port "$DFX_PORT" +dfx canister create internet_identity +dfx canister create pouh_issuer + npm run deploy dfx stop diff --git a/e2e/homepage.spec.ts b/e2e/homepage.spec.ts index ef760a7b30..bcbbffea21 100644 --- a/e2e/homepage.spec.ts +++ b/e2e/homepage.spec.ts @@ -26,13 +26,38 @@ test.describe('logged out user', () => { }); testWithII.describe('logged in user', () => { - testWithII.beforeEach(async ({ page, iiPage }) => { + testWithII.beforeEach(async ({ page, iiPage, context }) => { + const url = 'http://127.0.0.1:4943'; + const canisterId = 'bkyz2-fmaaa-aaaaa-qaaaq-cai'; + const timeout = 180000; + await iiPage.waitReady({ url, canisterId, timeout }); + await page.goto(testUrl); - await iiPage.signInWithNewIdentity(); + // test if adding timeout solves the issue + const iiPageCustomPromise = context.waitForEvent('page', { timeout }); + await page.getByTestId('login-button').click(); + + const iiPageCustom = await iiPageCustomPromise; + await expect(iiPageCustom).toHaveTitle('Internet Identity', { timeout }); + + await iiPageCustom.locator('#registerButton').click({ timeout }); + await iiPageCustom.locator('[data-action=construct-identity]').click({ timeout }); + + await iiPageCustom.locator('input#captchaInput').fill('a'); + await iiPageCustom.locator('#confirmRegisterButton').click({ timeout }); + + const identity = await iiPageCustom.locator('#userNumber').textContent({ timeout }); + expect(identity).not.toBeNull(); + + await iiPageCustom.locator('#displayUserContinue').click(); + await iiPageCustom.waitForEvent('close', { timeout }); + expect(iiPageCustom.isClosed()).toBe(true); + + // await iiPage.signInWithNewIdentity(); - await page.getByTestId('exchange-balance-output').waitFor(); - await page.getByTestId('tokens-skeletons-initialized').waitFor(); + await page.getByTestId('exchange-balance-output').waitFor({ timeout }); + await page.getByTestId('tokens-skeletons-initialized').waitFor({ timeout }); }); testWithII('should display logged in hero and tokens', async ({ page }) => {