Add comments for scroll offsets
[MAILPOET-2544]
This commit is contained in:
committed by
Pavel Dohnal
parent
158a914ff0
commit
56c0eb8cba
@@ -342,7 +342,9 @@ class AcceptanceTester extends \Codeception\Actor { // phpcs:ignore PSR1.Classes
|
||||
*/
|
||||
public function selectPaymentMethod($method = 'cod') {
|
||||
$I = $this;
|
||||
$I->scrollTo('#payment_method_' . $method, 0, -40);
|
||||
// We need to scroll with some negative offset so that the input is not hidden above the top page fold
|
||||
$approximate_payment_method_input_height = 40;
|
||||
$I->scrollTo('#payment_method_' . $method, 0, -$approximate_payment_method_input_height);
|
||||
$I->waitForElementNotVisible('.blockOverlay', 30); // wait for payment method loading overlay to disappear
|
||||
$I->click('#payment_method_' . $method);
|
||||
}
|
||||
|
@@ -45,15 +45,16 @@ class ManageSubscriptionLinkCest {
|
||||
$form_status_element = '[data-automation-id="form_status"]';
|
||||
|
||||
// set status to unsubscribed
|
||||
$approximate_save_button_height = 50; // Used for scroll offset to ensure that button is not hidden above the top fold
|
||||
$I->selectOption($form_status_element, 'Unsubscribed');
|
||||
$I->scrollTo('[data-automation-id="subscribe-submit-button"]', 0, -50);
|
||||
$I->scrollTo('[data-automation-id="subscribe-submit-button"]', 0, -$approximate_save_button_height);
|
||||
$I->click('Save');
|
||||
$I->waitForElement($form_status_element);
|
||||
$I->seeOptionIsSelected($form_status_element, 'Unsubscribed');
|
||||
|
||||
// change status back to subscribed
|
||||
$I->selectOption($form_status_element, 'Subscribed');
|
||||
$I->scrollTo('[data-automation-id="subscribe-submit-button"]', 0, -50);
|
||||
$I->scrollTo('[data-automation-id="subscribe-submit-button"]', 0, -$approximate_save_button_height);
|
||||
$I->click('Save');
|
||||
$I->waitForElement($form_status_element);
|
||||
$I->seeOptionIsSelected($form_status_element, 'Subscribed');
|
||||
|
Reference in New Issue
Block a user