chore: replace cy.task log

This commit is contained in:
Nathan
2025-11-17 12:35:52 +08:00
parent 3fc1975a9d
commit 87c5c2f10e
28 changed files with 569 additions and 541 deletions

View File

@@ -1,3 +1,4 @@
import { testLog } from './test-helpers';
/// <reference types="cypress" />
export interface AuthConfig {
@@ -168,7 +169,7 @@ export class AuthTestUtils {
// First, we need to call the verify endpoint to create the user profile
// This endpoint creates the user in the AppFlowy backend
cy.task('log', 'Calling verify endpoint to create user profile');
testLog.info( 'Calling verify endpoint to create user profile');
// Make the verify call with retry logic for CI environment
const verifyWithRetry = (retries = 3): Cypress.Chainable<any> => {
@@ -178,11 +179,11 @@ export class AuthTestUtils {
failOnStatusCode: false,
timeout: 30000,
}).then((verifyResponse) => {
cy.task('log', `Verify response status: ${verifyResponse.status}`);
testLog.info( `Verify response status: ${verifyResponse.status}`);
// If we get a 502 or 503 error, retry
if ((verifyResponse.status === 502 || verifyResponse.status === 503) && retries > 0) {
cy.task('log', `Retrying verify endpoint, ${retries} attempts remaining`);
testLog.info( `Retrying verify endpoint, ${retries} attempts remaining`);
return cy.wait(2000).then(() => verifyWithRetry(retries - 1));
}
@@ -265,4 +266,4 @@ Cypress.Commands.add('signIn', (email: string = 'test@example.com') => {
Cypress.Commands.add('generateSignInUrl', (email: string) => {
const authUtils = new AuthTestUtils();
return authUtils.generateSignInUrl(email);
});
});