diff --git a/cypress/e2e/pages/create_wallet.pages.js b/cypress/e2e/pages/create_wallet.pages.js index c060f35682..4545f8dc29 100644 --- a/cypress/e2e/pages/create_wallet.pages.js +++ b/cypress/e2e/pages/create_wallet.pages.js @@ -8,6 +8,7 @@ const thresholdInput = 'input[name="threshold"]' export const removeOwnerBtn = 'button[aria-label="Remove owner"]' const connectingContainer = 'div[class*="connecting-container"]' const createNewSafeBtn = 'span[data-track="create-safe: Continue to creation"]' +const connectWalletBtn = 'Connect wallet' const changeNetworkWarningStr = 'Change your wallet network' const safeAccountSetupStr = 'Safe Account setup' @@ -49,6 +50,10 @@ export function clickOnCreateNewSafeBtn() { cy.get(createNewSafeBtn).click().wait(1000) } +export function clickOnConnectWalletAndCreateBtn() { + cy.contains('[data-testid="welcome-login"]', connectWalletBtn).click().wait(1000) +} + export function typeWalletName(name) { cy.get(nameInput).type(name).should('have.value', name) } diff --git a/cypress/e2e/smoke/create_safe_simple.cy.js b/cypress/e2e/smoke/create_safe_simple.cy.js index e38c2796eb..7f602b3c8a 100644 --- a/cypress/e2e/smoke/create_safe_simple.cy.js +++ b/cypress/e2e/smoke/create_safe_simple.cy.js @@ -13,15 +13,17 @@ describe('Create Safe tests', () => { main.acceptCookies() }) - it('C55742: Verify a Wallet can be connected', () => { - /** TODO: Update this for the new safe creation flow - * e.g. connect and observe being navigated to the create safe page - * disconnect and observe being on the welcome page again - */ + it.only('C55742: Verify a Wallet can be connected', () => { createwallet.clickOnCreateNewSafeBtn() + owner.clickOnWalletExpandMoreIcon() + owner.clickOnDisconnectBtn() + cy.url().should('include', constants.welcomeUrl) + createwallet.clickOnConnectWalletAndCreateBtn() + createwallet.connectWallet() + cy.url().should('include', constants.createNewSafeSepoliaUrl) }) - it('C55743: Verify Next button is disabled until switching to network is done', () => { + it.only('C55743: Verify Next button is disabled until switching to network is done', () => { owner.waitForConnectionStatus() createwallet.selectNetwork(constants.networks.ethereum) createwallet.checkNetworkChangeWarningMsg() @@ -30,12 +32,12 @@ describe('Create Safe tests', () => { createwallet.verifyNextBtnIsEnabled() }) - it('C32378: Verify that a new Wallet has default name related to the selected network', () => { + it.only('C32378: Verify that a new Wallet has default name related to the selected network', () => { owner.waitForConnectionStatus() createwallet.verifyDefaultWalletName(createwallet.defaltSepoliaPlaceholder) }) - it('C4790: Verify error message is displayed if wallet name input exceeds 50 characters', () => { + it.only('C4790: Verify error message is displayed if wallet name input exceeds 50 characters', () => { owner.waitForConnectionStatus() createwallet.typeWalletName(main.generateRandomString(51)) owner.verifyErrorMsgInvalidAddress(constants.addressBookErrrMsg.exceedChars) diff --git a/src/components/new-safe/create/__tests__/useSyncSafeCreationStep.test.ts b/src/components/new-safe/create/__tests__/useSyncSafeCreationStep.test.ts index a3bc08f3da..310b09fbf7 100644 --- a/src/components/new-safe/create/__tests__/useSyncSafeCreationStep.test.ts +++ b/src/components/new-safe/create/__tests__/useSyncSafeCreationStep.test.ts @@ -36,7 +36,7 @@ describe('useSyncSafeCreationStep', () => { renderHook(() => useSyncSafeCreationStep(mockSetStep)) expect(mockSetStep).not.toHaveBeenCalled() - expect(mockPushRoute).toHaveBeenCalledWith(AppRoutes.welcome) + expect(mockPushRoute).toHaveBeenCalledWith({ pathname: AppRoutes.welcome, query: undefined }) }) it('should go to the fourth step if there is a pending safe', async () => { diff --git a/src/components/new-safe/create/useSyncSafeCreationStep.ts b/src/components/new-safe/create/useSyncSafeCreationStep.ts index 3033daf932..9604114671 100644 --- a/src/components/new-safe/create/useSyncSafeCreationStep.ts +++ b/src/components/new-safe/create/useSyncSafeCreationStep.ts @@ -22,7 +22,7 @@ const useSyncSafeCreationStep = (setStep: StepRenderProps['setS // Jump to connect wallet step if there is no wallet and no pending Safe if (!wallet) { - router.push(AppRoutes.welcome) + router.push({ pathname: AppRoutes.welcome, query: router.query }) } // Jump to choose name and network step if the wallet is connected to the wrong chain and there is no pending Safe diff --git a/src/components/welcome/WelcomeLogin/index.tsx b/src/components/welcome/WelcomeLogin/index.tsx index 24fc232d7d..998d660307 100644 --- a/src/components/welcome/WelcomeLogin/index.tsx +++ b/src/components/welcome/WelcomeLogin/index.tsx @@ -14,11 +14,11 @@ const WelcomeLogin = () => { const continueToCreation = () => { trackEvent(CREATE_SAFE_EVENTS.OPEN_SAFE_CREATION) - router.push(AppRoutes.newSafe.create) + router.push({ pathname: AppRoutes.newSafe.create, query: router.query }) } return ( - +