{"id":2792,"date":"2022-07-15T17:33:33","date_gmt":"2022-07-15T09:33:33","guid":{"rendered":"https:\/\/www.intelliwolf.com\/?p=2792"},"modified":"2022-07-15T17:33:36","modified_gmt":"2022-07-15T09:33:36","slug":"how-to-change-the-window-size-for-codeception-wp-web-driver","status":"publish","type":"post","link":"https:\/\/www.intelliwolf.com\/how-to-change-the-window-size-for-codeception-wp-web-driver\/","title":{"rendered":"How To Change The Window Size For Codeception WP Web Driver"},"content":{"rendered":"\n

If you use acceptance testing for you WordPress plugin or theme development, it's likely you're using Codeception<\/a>.<\/p>\n\n\n\n

I use the WP Web Driver<\/a> browser in my testing as it has the most testing options.<\/p>\n\n\n\n

Usually the size of the browser window doesn't matter, because I'm running it headless. Today I was testing menu access.<\/p>\n\n\n\n

Somewhat frustratingly, the window size defaulted to something small enough to make the WordPress side menu collapse into touch icons.<\/p>\n\n\n\n

I could get my tests to pass if I ran Chrome without the --headless flag, but as soon as I turned it on, it couldn't see the submenu links.<\/p>\n\n\n\n

I figured out the problem was the screen width by looking at the fail.png for that test. It clearly showed the compressed sidebar, even though in the fail.html everything looked fine.<\/p>\n\n\n\n

After way too much time debugging, the problem is the window_size<\/em> in the configuration in acceptance.suite.yml.<\/p>\n\n\n

\n
\"WP<\/figure><\/div>\n\n\n

By default, the window size is set to false<\/em>.<\/p>\n\n\n\n

All the documentation I could find assumed you were running Chrome headless and didn't care about window size.<\/p>\n\n\n\n

Many of the answers given in some forums were promising, but wrong.<\/p>\n\n\n\n

I finally figured out the solution.<\/p>\n\n\n\n

To change the window size for codeception WP Web Driver, set window_size under config -> WPWebDriver in acceptance.suite.yml to 1920x1080<\/strong>.<\/p>\n\n\n\n

You can leave the --headless flag in. This will run at the correct screen size even though no browser window pops up.<\/p>\n\n\n\n

You can change the dimensions to whatever you need to test, but it needs to be widthxheight.<\/p>\n\n\n\n

Save acceptance.suite.yml and when you next run your acceptance test, your test should pass with the correct screen width.<\/p>\n","protected":false},"excerpt":{"rendered":"

If you use acceptance testing for you WordPress plugin or theme development, it’s likely you’re using Codeception. I use the WP Web Driver browser in my testing as it has the most testing options. Usually the size of the browser window doesn’t matter, because I’m running it headless. Today I was testing menu access. Somewhat<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[22],"yoast_head":"\nHow To Change The Window Size For Codeception WP Web Driver<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.intelliwolf.com\/how-to-change-the-window-size-for-codeception-wp-web-driver\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Change The Window Size For Codeception WP Web Driver\" \/>\n<meta property=\"og:description\" content=\"If you use acceptance testing for you WordPress plugin or theme development, it's likely you're using Codeception. I use the WP Web Driver browser in my testing as it has the most testing options. Usually the size of the browser window doesn't matter, because I'm running it headless. Today I was testing menu access. Somewhat\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.intelliwolf.com\/how-to-change-the-window-size-for-codeception-wp-web-driver\/\" \/>\n<meta property=\"og:site_name\" content=\"Intelliwolf\" \/>\n<meta property=\"article:published_time\" content=\"2022-07-15T09:33:33+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-07-15T09:33:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.intelliwolf.com\/wp-content\/uploads\/2022\/07\/2022-07-15-change-wp-browser-size-600x455.png\" \/>\n<meta name=\"author\" content=\"Mike Haydon\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mike Haydon\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.intelliwolf.com\/how-to-change-the-window-size-for-codeception-wp-web-driver\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.intelliwolf.com\/how-to-change-the-window-size-for-codeception-wp-web-driver\/\"},\"author\":{\"name\":\"Mike Haydon\",\"@id\":\"https:\/\/www.intelliwolf.com\/#\/schema\/person\/7209e3ff14822e4d70d5f194a310f343\"},\"headline\":\"How To Change The Window Size For Codeception WP Web Driver\",\"datePublished\":\"2022-07-15T09:33:33+00:00\",\"dateModified\":\"2022-07-15T09:33:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.intelliwolf.com\/how-to-change-the-window-size-for-codeception-wp-web-driver\/\"},\"wordCount\":294,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.intelliwolf.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.intelliwolf.com\/how-to-change-the-window-size-for-codeception-wp-web-driver\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.intelliwolf.com\/wp-content\/uploads\/2022\/07\/2022-07-15-change-wp-browser-size-600x455.png\",\"keywords\":[\"testing\"],\"articleSection\":[\"General\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.intelliwolf.com\/how-to-change-the-window-size-for-codeception-wp-web-driver\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.intelliwolf.com\/how-to-change-the-window-size-for-codeception-wp-web-driver\/\",\"url\":\"https:\/\/www.intelliwolf.com\/how-to-change-the-window-size-for-codeception-wp-web-driver\/\",\"name\":\"How To Change The Window Size For Codeception WP Web Driver\",\"isPartOf\":{\"@id\":\"https:\/\/www.intelliwolf.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.intelliwolf.com\/how-to-change-the-window-size-for-codeception-wp-web-driver\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.intelliwolf.com\/how-to-change-the-window-size-for-codeception-wp-web-driver\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.intelliwolf.com\/wp-content\/uploads\/2022\/07\/2022-07-15-change-wp-browser-size-600x455.png\",\"datePublished\":\"2022-07-15T09:33:33+00:00\",\"dateModified\":\"2022-07-15T09:33:36+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.intelliwolf.com\/how-to-change-the-window-size-for-codeception-wp-web-driver\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.intelliwolf.com\/how-to-change-the-window-size-for-codeception-wp-web-driver\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.intelliwolf.com\/how-to-change-the-window-size-for-codeception-wp-web-driver\/#primaryimage\",\"url\":\"https:\/\/www.intelliwolf.com\/wp-content\/uploads\/2022\/07\/2022-07-15-change-wp-browser-size.png\",\"contentUrl\":\"https:\/\/www.intelliwolf.com\/wp-content\/uploads\/2022\/07\/2022-07-15-change-wp-browser-size.png\",\"width\":854,\"height\":647},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.intelliwolf.com\/how-to-change-the-window-size-for-codeception-wp-web-driver\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.intelliwolf.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"General\",\"item\":\"https:\/\/www.intelliwolf.com\/category\/general\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How To Change The Window Size For Codeception WP Web Driver\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.intelliwolf.com\/#website\",\"url\":\"https:\/\/www.intelliwolf.com\/\",\"name\":\"Intelliwolf\",\"description\":\"WordPress, Web Design & Coding Tutorials\",\"publisher\":{\"@id\":\"https:\/\/www.intelliwolf.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.intelliwolf.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.intelliwolf.com\/#organization\",\"name\":\"Intelliwolf\",\"url\":\"https:\/\/www.intelliwolf.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.intelliwolf.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.intelliwolf.com\/wp-content\/uploads\/intelliwolf-logo-300t.png\",\"contentUrl\":\"https:\/\/www.intelliwolf.com\/wp-content\/uploads\/intelliwolf-logo-300t.png\",\"width\":300,\"height\":100,\"caption\":\"Intelliwolf\"},\"image\":{\"@id\":\"https:\/\/www.intelliwolf.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.intelliwolf.com\/#\/schema\/person\/7209e3ff14822e4d70d5f194a310f343\",\"name\":\"Mike Haydon\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.intelliwolf.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d5f4754fae310a04dede91d15e57c8a0?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d5f4754fae310a04dede91d15e57c8a0?s=96&d=mm&r=g\",\"caption\":\"Mike Haydon\"},\"sameAs\":[\"https:\/\/intelliwolf.com\/about-mike-haydon\/\"]}]}<\/script>\n","yoast_head_json":{"title":"How To Change The Window Size For Codeception WP Web Driver","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.intelliwolf.com\/how-to-change-the-window-size-for-codeception-wp-web-driver\/","og_locale":"en_US","og_type":"article","og_title":"How To Change The Window Size For Codeception WP Web Driver","og_description":"If you use acceptance testing for you WordPress plugin or theme development, it's likely you're using Codeception. I use the WP Web Driver browser in my testing as it has the most testing options. Usually the size of the browser window doesn't matter, because I'm running it headless. Today I was testing menu access. Somewhat","og_url":"https:\/\/www.intelliwolf.com\/how-to-change-the-window-size-for-codeception-wp-web-driver\/","og_site_name":"Intelliwolf","article_published_time":"2022-07-15T09:33:33+00:00","article_modified_time":"2022-07-15T09:33:36+00:00","og_image":[{"url":"https:\/\/www.intelliwolf.com\/wp-content\/uploads\/2022\/07\/2022-07-15-change-wp-browser-size-600x455.png"}],"author":"Mike Haydon","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Mike Haydon","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.intelliwolf.com\/how-to-change-the-window-size-for-codeception-wp-web-driver\/#article","isPartOf":{"@id":"https:\/\/www.intelliwolf.com\/how-to-change-the-window-size-for-codeception-wp-web-driver\/"},"author":{"name":"Mike Haydon","@id":"https:\/\/www.intelliwolf.com\/#\/schema\/person\/7209e3ff14822e4d70d5f194a310f343"},"headline":"How To Change The Window Size For Codeception WP Web Driver","datePublished":"2022-07-15T09:33:33+00:00","dateModified":"2022-07-15T09:33:36+00:00","mainEntityOfPage":{"@id":"https:\/\/www.intelliwolf.com\/how-to-change-the-window-size-for-codeception-wp-web-driver\/"},"wordCount":294,"commentCount":0,"publisher":{"@id":"https:\/\/www.intelliwolf.com\/#organization"},"image":{"@id":"https:\/\/www.intelliwolf.com\/how-to-change-the-window-size-for-codeception-wp-web-driver\/#primaryimage"},"thumbnailUrl":"https:\/\/www.intelliwolf.com\/wp-content\/uploads\/2022\/07\/2022-07-15-change-wp-browser-size-600x455.png","keywords":["testing"],"articleSection":["General"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.intelliwolf.com\/how-to-change-the-window-size-for-codeception-wp-web-driver\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.intelliwolf.com\/how-to-change-the-window-size-for-codeception-wp-web-driver\/","url":"https:\/\/www.intelliwolf.com\/how-to-change-the-window-size-for-codeception-wp-web-driver\/","name":"How To Change The Window Size For Codeception WP Web Driver","isPartOf":{"@id":"https:\/\/www.intelliwolf.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.intelliwolf.com\/how-to-change-the-window-size-for-codeception-wp-web-driver\/#primaryimage"},"image":{"@id":"https:\/\/www.intelliwolf.com\/how-to-change-the-window-size-for-codeception-wp-web-driver\/#primaryimage"},"thumbnailUrl":"https:\/\/www.intelliwolf.com\/wp-content\/uploads\/2022\/07\/2022-07-15-change-wp-browser-size-600x455.png","datePublished":"2022-07-15T09:33:33+00:00","dateModified":"2022-07-15T09:33:36+00:00","breadcrumb":{"@id":"https:\/\/www.intelliwolf.com\/how-to-change-the-window-size-for-codeception-wp-web-driver\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.intelliwolf.com\/how-to-change-the-window-size-for-codeception-wp-web-driver\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.intelliwolf.com\/how-to-change-the-window-size-for-codeception-wp-web-driver\/#primaryimage","url":"https:\/\/www.intelliwolf.com\/wp-content\/uploads\/2022\/07\/2022-07-15-change-wp-browser-size.png","contentUrl":"https:\/\/www.intelliwolf.com\/wp-content\/uploads\/2022\/07\/2022-07-15-change-wp-browser-size.png","width":854,"height":647},{"@type":"BreadcrumbList","@id":"https:\/\/www.intelliwolf.com\/how-to-change-the-window-size-for-codeception-wp-web-driver\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.intelliwolf.com\/"},{"@type":"ListItem","position":2,"name":"General","item":"https:\/\/www.intelliwolf.com\/category\/general\/"},{"@type":"ListItem","position":3,"name":"How To Change The Window Size For Codeception WP Web Driver"}]},{"@type":"WebSite","@id":"https:\/\/www.intelliwolf.com\/#website","url":"https:\/\/www.intelliwolf.com\/","name":"Intelliwolf","description":"WordPress, Web Design & Coding Tutorials","publisher":{"@id":"https:\/\/www.intelliwolf.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.intelliwolf.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.intelliwolf.com\/#organization","name":"Intelliwolf","url":"https:\/\/www.intelliwolf.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.intelliwolf.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.intelliwolf.com\/wp-content\/uploads\/intelliwolf-logo-300t.png","contentUrl":"https:\/\/www.intelliwolf.com\/wp-content\/uploads\/intelliwolf-logo-300t.png","width":300,"height":100,"caption":"Intelliwolf"},"image":{"@id":"https:\/\/www.intelliwolf.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.intelliwolf.com\/#\/schema\/person\/7209e3ff14822e4d70d5f194a310f343","name":"Mike Haydon","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.intelliwolf.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d5f4754fae310a04dede91d15e57c8a0?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d5f4754fae310a04dede91d15e57c8a0?s=96&d=mm&r=g","caption":"Mike Haydon"},"sameAs":["https:\/\/intelliwolf.com\/about-mike-haydon\/"]}]}},"_links":{"self":[{"href":"https:\/\/www.intelliwolf.com\/wp-json\/wp\/v2\/posts\/2792"}],"collection":[{"href":"https:\/\/www.intelliwolf.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.intelliwolf.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.intelliwolf.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.intelliwolf.com\/wp-json\/wp\/v2\/comments?post=2792"}],"version-history":[{"count":1,"href":"https:\/\/www.intelliwolf.com\/wp-json\/wp\/v2\/posts\/2792\/revisions"}],"predecessor-version":[{"id":2799,"href":"https:\/\/www.intelliwolf.com\/wp-json\/wp\/v2\/posts\/2792\/revisions\/2799"}],"wp:attachment":[{"href":"https:\/\/www.intelliwolf.com\/wp-json\/wp\/v2\/media?parent=2792"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.intelliwolf.com\/wp-json\/wp\/v2\/categories?post=2792"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.intelliwolf.com\/wp-json\/wp\/v2\/tags?post=2792"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}