Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Protected Member Functions
PrototypeAjaxRequests Class Reference
Inheritance diagram for PrototypeAjaxRequests:
AbstractMetricCheck

Protected Member Functions

 doesMetricPass ($value)
 
 fetchValueFromPage ()
 
 clearFailureOnPage ()
 
- Protected Member Functions inherited from AbstractMetricCheck
 doesMetricPass ($value)
 
 fetchValueFromPage ()
 
 clearFailureOnPage ()
 
 getDriver ()
 
 executeJs ($script, $arguments=[])
 
 errorLog ($message, $context=[])
 
 infoLog ($message, $context=[])
 
 debugLog ($message, $context=[])
 

Additional Inherited Members

- Public Member Functions inherited from AbstractMetricCheck
 __construct ($extension, $resetFailureThreshold)
 
 getName ()
 
 runCheck ()
 
 finalizeForStep ($step)
 
 getStoredValue ()
 
 getFailureCount ()
 
 setTracker ($value, $failCount)
 
 resetTracker ()
 
- Protected Attributes inherited from AbstractMetricCheck
 $extension
 
 $currentValue
 
 $storedValue
 
 $failCount
 
 $resetFailureThreshold
 
 $logger
 
 $verbose
 

Detailed Description

Class PrototypeAjaxRequests

Looks for all active prototype ajax requests to finish before passing the readiness check

Definition at line 16 of file PrototypeAjaxRequests.php.

Member Function Documentation

◆ clearFailureOnPage()

clearFailureOnPage ( )
protected

Active request count can get stuck above zero if an exception is thrown during a callback, causing the ajax handler method to fail before decrementing the request count

Returns
void
Exceptions
UnexpectedAlertOpenException

Definition at line 54 of file PrototypeAjaxRequests.php.

55  {
56  $this->executeJS('if (!!window.Prototype) { window.Ajax.activeRequestCount = 0; };');
57  }

◆ doesMetricPass()

doesMetricPass (   $value)
protected

Metric passes once there are no remaining active requests

Parameters
integer$value
Returns
boolean

Definition at line 24 of file PrototypeAjaxRequests.php.

25  {
26  return $value == 0;
27  }
$value
Definition: gender.phtml:16

◆ fetchValueFromPage()

fetchValueFromPage ( )
protected

Grabs the number of active prototype ajax requests if available

Returns
integer
Exceptions
UnexpectedAlertOpenException

Definition at line 35 of file PrototypeAjaxRequests.php.

36  {
37  return intval(
38  $this->executeJS(
39  'if (!!window.Prototype) {
40  return window.Ajax.activeRequestCount;
41  }
42  return 0;'
43  )
44  );
45  }

The documentation for this class was generated from the following file: