diff --git a/packages/near-fast-auth-signer-e2e-tests/pages/AuthCallBackPage.ts b/packages/near-fast-auth-signer-e2e-tests/pages/AuthCallBackPage.ts index 160a0677..489a4da0 100644 --- a/packages/near-fast-auth-signer-e2e-tests/pages/AuthCallBackPage.ts +++ b/packages/near-fast-auth-signer-e2e-tests/pages/AuthCallBackPage.ts @@ -43,22 +43,23 @@ class AuthCallBackPage { return emailData.uidl; } - async handleInPageAccountCreation(email: string) { - await expect(this.page.getByText('Oops! This account doesn\'t seem to exist. Please create one below.')).toBeVisible(); - await expect(this.page.locator('[data-testid="email_create"]')).toHaveValue(email); - await expect(this.page.locator('[data-testid="username_create"]')).toHaveValue(getEmailId(email)); - await this.page.waitForSelector('button:has-text("Continue"):enabled'); - await this.page.click('button:has-text("Continue")'); + // eslint-disable-next-line class-methods-use-this + async handleInPageAccountCreation(email: string, page: Page) { + await expect(page.getByText('Oops! This account doesn\'t seem to exist. Please create one below.')).toBeVisible(); + await expect(page.locator('[data-testid="email_create"]')).toHaveValue(email); + await expect(page.locator('[data-testid="username_create"]')).toHaveValue(getEmailId(email)); + await page.waitForSelector('button:has-text("Continue"):enabled'); + await page.click('button:has-text("Continue")'); - await this.page.locator('text=Loading...').waitFor({ state: 'visible' }); - await expect(this.page.getByText('Loading...')).toBeVisible(); - await this.page.locator('text=Loading...').waitFor({ state: 'hidden' }); - await expect(this.page.getByText('Loading...')).not.toBeVisible(); + await page.locator('text=Loading...').waitFor({ state: 'visible' }); + await expect(page.getByText('Loading...')).toBeVisible(); + await page.locator('text=Loading...').waitFor({ state: 'hidden' }); + await expect(page.getByText('Loading...')).not.toBeVisible(); - await this.page.locator('text=Redirecting to app...').waitFor({ state: 'visible' }); - await expect(this.page.getByText('Redirecting to app...')).toBeVisible(); - await this.page.locator('text=Redirecting to app...').waitFor({ state: 'hidden' }); - await expect(this.page.getByText('Redirecting to app...')).not.toBeVisible(); + await page.locator('text=Redirecting to app...').waitFor({ state: 'visible' }); + await expect(page.getByText('Redirecting to app...')).toBeVisible(); + /* await page.locator('text=Redirecting to app...').waitFor({ state: 'hidden' }); + await expect(page.getByText('Redirecting to app...')).not.toBeVisible(); */ } } diff --git a/packages/near-fast-auth-signer-e2e-tests/tests/auth.spec.ts b/packages/near-fast-auth-signer-e2e-tests/tests/auth.spec.ts index 0189b70e..8e9f3fc3 100644 --- a/packages/near-fast-auth-signer-e2e-tests/tests/auth.spec.ts +++ b/packages/near-fast-auth-signer-e2e-tests/tests/auth.spec.ts @@ -89,6 +89,6 @@ test('should create account if logged in with an unregistered account details ', creationKeypair: KeyPair.fromRandom('ED25519'), retrievalKeypair: KeyPair.fromRandom('ED25519'), }); - await pm.getAuthCallBackPage().handleInPageAccountCreation(email); + await pm.getAuthCallBackPage().handleInPageAccountCreation(email, page); await pm.getAppPage().isLoggedIn(); });