WebUtil is a helper for Codeception, it just support for making screenshot. It should have a better name, not webutil or helper...
composer require vuongggggg/codecept-webutil
- To make custom screenshot instead default
makeScreenshot
function:$I->makeCustomScreenshot($filename)
: The screenshot file will be saved intests/_output/screenshots/
.$I->setCustomScreenshotDir($screenshotOutputFolder)
: To create custom folder to save screenshots. Customized folder will be a child oftests/_output/screenshots
.$I->renewCustomScreenshotDir()
: To delete and re-create screenshot dir when test is started.
Enable Helper\WebUtil
module and make configurations for it instead WebDriver. Example:
modules:
enabled:
- Helper\WebUtil
config:
Helper\WebUtil:
url: 'https://github.com/' # Ec server orange website
browser: chrome # Browser: <chrome|firefox|internet explorer|MicrosoftEdge>
host: '10.0.2.2' # Selenium Browser server host that is running
window_size: 1024x864
port: 4444 # Selenium Browser server port
cleanup_screenshot: true
: Always clean screenshot folder when starting test.
modules:
enabled:
- Helper\WebUtil
config:
Helper\WebUtil:
#...
cleanup_screenshot: true #Cleanup screenshot when started test