Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,11 @@ public function testBroadcastsModuleInFrontendEditorWhenNoCredentials(EndToEndTe
);

// Confirm the on screen message displays.
$I->seeInSource('Not connected to Kit');
$I->seeInSource('Connect your Kit account at Settings > Kit, and then refresh this page to configure broadcasts to display.');
$I->seeTextInDiviModule(
$I,
title: 'Not connected to Kit',
text: 'Connect your Kit account at Settings > Kit, and then refresh this page to configure broadcasts to display.'
);
}

/**
Expand Down Expand Up @@ -272,8 +275,11 @@ public function testBroadcastsModuleInFrontendEditorWhenNoBroadcasts(EndToEndTes
);

// Confirm the on screen message displays.
$I->seeInSource('No broadcasts exist in Kit');
$I->seeInSource('Add a broadcast to your Kit account, and then refresh this page to configure broadcasts to display.');
$I->seeTextInDiviModule(
$I,
title: 'No broadcasts exist in Kit',
text: 'Add a broadcast to your Kit account, and then refresh this page to configure broadcasts to display.'
);
}

/**
Expand Down
14 changes: 10 additions & 4 deletions tests/EndToEnd/integrations/divi-builder/DiviPluginFormCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,11 @@ public function testFormModuleInFrontendEditorWhenNoCredentials(EndToEndTester $
);

// Confirm the on screen message displays.
$I->seeInSource('Not connected to Kit');
$I->seeInSource('Connect your Kit account at Settings > Kit, and then refresh this page to select a form.');
$I->seeTextInDiviModule(
$I,
title: 'Not connected to Kit',
text: 'Connect your Kit account at Settings > Kit, and then refresh this page to select a form.'
);
}

/**
Expand Down Expand Up @@ -145,8 +148,11 @@ public function testFormModuleInFrontendEditorWhenNoForms(EndToEndTester $I)
);

// Confirm the on screen message displays.
$I->seeInSource('No forms exist in Kit');
$I->seeInSource('Add a form to your Kit account, and then refresh this page to select a form.');
$I->seeTextInDiviModule(
$I,
title: 'No forms exist in Kit',
text: 'Add a form to your Kit account, and then refresh this page to select a form.'
);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,11 @@ public function testFormTriggerModuleInFrontendEditorWhenNoCredentials(EndToEndT
);

// Confirm the on screen message displays.
$I->seeInSource('Not connected to Kit');
$I->seeInSource('Connect your Kit account at Settings > Kit, and then refresh this page to select a form.');
$I->seeTextInDiviModule(
$I,
title: 'Not connected to Kit',
text: 'Connect your Kit account at Settings > Kit, and then refresh this page to select a form.'
);
}

/**
Expand Down Expand Up @@ -151,8 +154,11 @@ public function testFormTriggerModuleInFrontendEditorWhenNoForms(EndToEndTester
);

// Confirm the on screen message displays.
$I->seeInSource('No modal, sticky bar or slide in forms exist in Kit');
$I->seeInSource('Add a non-inline form to your Kit account, and then refresh this page to select a form.');
$I->seeTextInDiviModule(
$I,
title: 'No modal, sticky bar or slide in forms exist in Kit',
text: 'Add a non-inline form to your Kit account, and then refresh this page to select a form.'
);
}

/**
Expand Down
14 changes: 10 additions & 4 deletions tests/EndToEnd/integrations/divi-builder/DiviPluginProductCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,11 @@ public function testProductModuleInFrontendEditorWhenNoCredentials(EndToEndTeste
);

// Confirm the on screen message displays.
$I->seeInSource('Not connected to Kit');
$I->seeInSource('Connect your Kit account at Settings > Kit, and then refresh this page to select a product.');
$I->seeTextInDiviModule(
$I,
title: 'Not connected to Kit',
text: 'Connect your Kit account at Settings > Kit, and then refresh this page to select a product.'
);
}

/**
Expand Down Expand Up @@ -143,8 +146,11 @@ public function testProductModuleInFrontendEditorWhenNoProducts(EndToEndTester $
);

// Confirm the on screen message displays.
$I->seeInSource('No products exist in Kit');
$I->seeInSource('Add a product to your Kit account, and then refresh this page to select a product.');
$I->seeTextInDiviModule(
$I,
title: 'No products exist in Kit',
text: 'Add a product to your Kit account, and then refresh this page to select a product.'
);
}

/**
Expand Down
14 changes: 10 additions & 4 deletions tests/EndToEnd/integrations/divi-theme/DiviThemeBroadcastsCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,11 @@ public function testBroadcastsModuleInFrontendEditorWhenNoCredentials(EndToEndTe
);

// Confirm the on screen message displays.
$I->seeInSource('Not connected to Kit');
$I->seeInSource('Connect your Kit account at Settings > Kit, and then refresh this page to configure broadcasts to display.');
$I->seeTextInDiviModule(
$I,
title: 'Not connected to Kit',
text: 'Connect your Kit account at Settings > Kit, and then refresh this page to configure broadcasts to display.'
);
}

/**
Expand Down Expand Up @@ -274,8 +277,11 @@ public function testBroadcastsModuleInFrontendEditorWhenNoBroadcasts(EndToEndTes
);

// Confirm the on screen message displays.
$I->seeInSource('No broadcasts exist in Kit');
$I->seeInSource('Add a broadcast to your Kit account, and then refresh this page to configure broadcasts to display.');
$I->seeTextInDiviModule(
$I,
title: 'No broadcasts exist in Kit',
text: 'Add a broadcast to your Kit account, and then refresh this page to configure broadcasts to display.'
);
}

/**
Expand Down
14 changes: 10 additions & 4 deletions tests/EndToEnd/integrations/divi-theme/DiviThemeFormCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,11 @@ public function testFormModuleInFrontendEditorWhenNoCredentials(EndToEndTester $
);

// Confirm the on screen message displays.
$I->seeInSource('Not connected to Kit');
$I->seeInSource('Connect your Kit account at Settings > Kit, and then refresh this page to select a form.');
$I->seeTextInDiviModule(
$I,
title: 'Not connected to Kit',
text: 'Connect your Kit account at Settings > Kit, and then refresh this page to select a form.'
);
}

/**
Expand Down Expand Up @@ -145,8 +148,11 @@ public function testFormModuleInFrontendEditorWhenNoForms(EndToEndTester $I)
);

// Confirm the on screen message displays.
$I->seeInSource('No forms exist in Kit');
$I->seeInSource('Add a form to your Kit account, and then refresh this page to select a form.');
$I->seeTextInDiviModule(
$I,
title: 'No forms exist in Kit',
text: 'Add a form to your Kit account, and then refresh this page to select a form.'
);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,11 @@ public function testFormTriggerModuleInFrontendEditorWhenNoCredentials(EndToEndT
);

// Confirm the on screen message displays.
$I->seeInSource('Not connected to Kit');
$I->seeInSource('Connect your Kit account at Settings > Kit, and then refresh this page to select a form.');
$I->seeTextInDiviModule(
$I,
title: 'Not connected to Kit',
text: 'Connect your Kit account at Settings > Kit, and then refresh this page to select a form.'
);
}

/**
Expand Down Expand Up @@ -151,8 +154,11 @@ public function testFormTriggerModuleInFrontendEditorWhenNoForms(EndToEndTester
);

// Confirm the on screen message displays.
$I->seeInSource('No modal, sticky bar or slide in forms exist in Kit');
$I->seeInSource('Add a non-inline form to your Kit account, and then refresh this page to select a form.');
$I->seeTextInDiviModule(
$I,
title: 'No modal, sticky bar or slide in forms exist in Kit',
text: 'Add a non-inline form to your Kit account, and then refresh this page to select a form.'
);
}

/**
Expand Down
14 changes: 10 additions & 4 deletions tests/EndToEnd/integrations/divi-theme/DiviThemeProductCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,11 @@ public function testProductModuleInFrontendEditorWhenNoCredentials(EndToEndTeste
);

// Confirm the on screen message displays.
$I->seeInSource('Not connected to Kit');
$I->seeInSource('Connect your Kit account at Settings > Kit, and then refresh this page to select a product.');
$I->seeTextInDiviModule(
$I,
title: 'Not connected to Kit',
text: 'Connect your Kit account at Settings > Kit, and then refresh this page to select a product.'
);
}

/**
Expand Down Expand Up @@ -143,8 +146,11 @@ public function testProductModuleInFrontendEditorWhenNoProducts(EndToEndTester $
);

// Confirm the on screen message displays.
$I->seeInSource('No products exist in Kit');
$I->seeInSource('Add a product to your Kit account, and then refresh this page to select a product.');
$I->seeTextInDiviModule(
$I,
title: 'No products exist in Kit',
text: 'Add a product to your Kit account, and then refresh this page to select a product.'
);
}

/**
Expand Down
33 changes: 28 additions & 5 deletions tests/Support/Helper/DiviBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,13 @@ public function saveDiviModuleInBackendEditorAndViewPage($I)
// Update page.
$I->click('Update');

// Load the Page on the frontend site.
// Wait for the save to complete.
$I->waitForElementVisible('#message');
$I->see('Page updated.', '#message');
$I->waitForElementNotVisible('.et-fb-preloader');
$I->wait(2);
$I->waitForElementVisible('.notice-success');
$I->click('.notice-success a');

// Wait for frontend web site to load.
// Load the Page on the frontend site.
$I->click('.notice-success a');
$I->waitForElementVisible('body');

// Check that no PHP warnings or notices were output.
Expand Down Expand Up @@ -211,6 +211,29 @@ public function saveDiviModuleInFrontendEditorAndViewPage($I, $url)
$I->checkNoWarningsAndNoticesOnScreen($I);
}

/**
* Helper method to see specific text is displayed in a Divi module.
*
* @since 3.0.8
*
* @param EndToEndTester $I EndToEnd Tester.
* @param string $title Title of the module.
* @param string $text Text to confirm is displayed.
*/
public function seeTextInDiviModule($I, $title, $text)
{
// Switch to Divi Builder iframe.
$I->switchToIFrame('iframe[id="et-fb-app-frame"]');

// Confirm the on screen message displays.
$I->waitForElementVisible('div.convertkit-divi-module');
$I->see($title, 'div.convertkit-divi-module');
$I->see($text, 'div.convertkit-divi-module');

// Switch back to main window.
$I->switchToIFrame();
}

/**
* Create a Page in the database comprising of Divi Page Builder data
* containing a Kit module.
Expand Down