mirror of
https://github.com/AppFlowy-IO/AppFlowy-Web.git
synced 2025-11-29 19:08:33 +08:00
chore: replace cy.task log
This commit is contained in:
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user