File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -71,18 +71,18 @@ public function testResizeWindow(): void
7171 {
7272 $ this ->getSession ()->visit ($ this ->pathTo ('/index.html ' ));
7373 $ session = $ this ->getSession ();
74- $ testWidth = 640 ;
75- $ testHeight = 480 ;
74+ $ expectedWidth = 640 ;
75+ $ expectedHeight = 480 ;
7676
77- $ session ->resizeWindow ($ testWidth , $ testHeight );
77+ $ session ->resizeWindow ($ expectedWidth , $ expectedHeight );
7878 $ session ->wait (1000 , 'false ' );
79+
7980 $ jsWindowSizeScript = <<<"JS"
8081 (function () {
81- var check =
82- function(w, h){
83- return Math.abs(w - $ testWidth) <= 100
84- && Math.abs(h - $ testHeight) <= 100;
85- },
82+ var check = function (actualWidth, actualHeight) {
83+ return Math.abs(actualWidth - $ expectedWidth) <= 100
84+ && Math.abs(actualHeight - $ expectedHeight) <= 100;
85+ },
8686 htmlElem = document.documentElement,
8787 bodyElem = document.getElementsByTagName('body')[0];
8888
@@ -93,7 +93,6 @@ function(w, h){
9393 );
9494 })();
9595JS ;
96-
9796 $ this ->assertTrue ($ session ->evaluateScript ($ jsWindowSizeScript ));
9897 }
9998
You can’t perform that action at this time.
0 commit comments