@@ -565,32 +565,17 @@ public function createPageWithWPFormsShortcode($I, $formID)
565565 }
566566
567567 /**
568- * Disconnects the given account ID via the UI in WPForms > Settings > Integrations .
568+ * Removes the given account ID from the WPForms provider settings .
569569 *
570570 * @since 1.7.0
571571 *
572572 * @param EndToEndTester $I Tester.
573573 * @param string $accountID Account ID.
574574 */
575- public function disconnectAccount ($ I , $ accountID )
575+ public function removeProviderConnection ($ I , $ accountID )
576576 {
577- // Login as the Administrator, if we're not already logged in.
578- if ( ! $ I ->amLoggedInAsAdmin ($ I ) ) {
579- $ I ->doLoginAsAdmin ($ I );
580- }
581-
582- // Click Disconnect.
583- $ I ->amOnAdminPage ('admin.php?page=wpforms-settings&view=integrations ' );
584- $ I ->click ('#wpforms-integration-convertkit ' );
585- $ I ->waitForElementVisible ('#wpforms-integration-convertkit .wpforms-settings-provider-accounts-list span.remove a[data-key=" ' . $ accountID . '"] ' );
586- $ I ->click ('#wpforms-integration-convertkit .wpforms-settings-provider-accounts-list span.remove a[data-key=" ' . $ accountID . '"] ' );
587-
588- // Confirm that we want to disconnect.
589- $ I ->waitForElementVisible ('.jconfirm-box ' );
590- $ I ->click ('.jconfirm-box button.btn-confirm ' );
591-
592- // Confirm connection is no longer listed.
593- $ I ->wait (5 );
594- $ I ->dontSeeElementInDOM ('a[data-key=" ' . $ accountID . '"] ' );
577+ $ providers = $ I ->grabOptionFromDatabase ('wpforms_providers ' );
578+ unset($ providers ['convertkit ' ][ $ accountID ]);
579+ $ I ->haveOptionInDatabase ('wpforms_providers ' , $ providers );
595580 }
596581}
0 commit comments