Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

A helper instead WebDriver module (and extended it, sure).

Notifications You must be signed in to change notification settings

vuon9/codecept-webutil-helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Codecept WebUtil

Build Status

WebUtil is a helper for Codeception, it just support for making screenshot. It should have a better name, not webutil or helper...

Composer installation

composer require vuongggggg/codecept-webutil

Functions

  • To make custom screenshot instead default makeScreenshot function:
    • $I->makeCustomScreenshot($filename): The screenshot file will be saved in tests/_output/screenshots/.
    • $I->setCustomScreenshotDir($screenshotOutputFolder): To create custom folder to save screenshots. Customized folder will be a child of tests/_output/screenshots.
    • $I->renewCustomScreenshotDir(): To delete and re-create screenshot dir when test is started.

Suite configuration

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

Optional configurations

  • 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